From 07fcc1fb1eddb7f70e102306f23109b45794cdaa Mon Sep 17 00:00:00 2001 From: Johannes Zottele Date: Tue, 9 Sep 2025 16:42:43 +0200 Subject: [PATCH 1/7] protobuf: Add Groups encode/decode Signed-off-by: Johannes Zottele --- .../protobuf/kotlin/_rpc_internal/Any.kt | 82 +- .../protobuf/kotlin/_rpc_internal/Api.kt | 366 +- .../protobuf/kotlin/_rpc_internal/Duration.kt | 75 +- .../protobuf/kotlin/_rpc_internal/Empty.kt | 49 +- .../kotlin/_rpc_internal/FieldMask.kt | 67 +- .../kotlin/_rpc_internal/SourceContext.kt | 66 +- .../protobuf/kotlin/_rpc_internal/Struct.kt | 363 +- .../kotlin/_rpc_internal/Timestamp.kt | 75 +- .../protobuf/kotlin/_rpc_internal/Type.kt | 693 ++- .../protobuf/kotlin/_rpc_internal/Wrappers.kt | 493 +- .../rpc/protobuf/internal/WireDecoder.kt | 21 +- .../rpc/protobuf/internal/WireEncoder.kt | 6 + .../src/commonTest/proto/groups.proto | 5 + .../rpc/protobuf/internal/WireEncoder.jvm.kt | 10 + .../protobuf/internal/WireEncoder.native.kt | 54 +- .../rpc/protoc/gen/core/codeRequestToModel.kt | 13 +- .../rpc/protoc/gen/core/model/FieldType.kt | 4 +- .../rpc/protoc/gen/core/model/model.kt | 11 +- .../ModelToProtobufKotlinCommonGenerator.kt | 92 +- .setup_protoscope.sh => setup_protocscope.sh | 0 .../conformance/_rpc_internal/Conformance.kt | 615 ++- .../TestMessagesProto3Editions.kt | 4272 +++++++++++------ .../_rpc_internal/TestMessagesProto3.kt | 4045 ++++++++++------ .../rpc/protoc/gen/test/ConformanceTest.kt | 4 +- 24 files changed, 7302 insertions(+), 4179 deletions(-) create mode 100644 protobuf/protobuf-core/src/commonTest/proto/groups.proto rename .setup_protoscope.sh => setup_protocscope.sh (100%) mode change 100644 => 100755 diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt index 61f9897aa..685b8a28c 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt @@ -1,11 +1,21 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) + package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.* +import kotlinx.rpc.internal.utils.ExperimentalRpcApi import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.* - -public class AnyInternal: com.google.protobuf.kotlin.Any, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +import kotlinx.rpc.protobuf.internal.MsgFieldDelegate +import kotlinx.rpc.protobuf.internal.bytes +import kotlinx.rpc.protobuf.internal.int32 +import kotlinx.rpc.protobuf.internal.string +import kotlinx.rpc.protobuf.internal.tag + +public class AnyInternal : com.google.protobuf.kotlin.Any, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -13,21 +23,21 @@ public class AnyInternal: com.google.protobuf.kotlin.Any, kotlinx.rpc.protobuf.i public override var value: ByteArray by MsgFieldDelegate { byteArrayOf() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Any): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Any): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Any { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Any { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.AnyInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.AnyInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -40,64 +50,78 @@ public class AnyInternal: com.google.protobuf.kotlin.Any, kotlinx.rpc.protobuf.i public companion object } -public operator fun com.google.protobuf.kotlin.Any.Companion.invoke(body: com.google.protobuf.kotlin.AnyInternal.() -> Unit): com.google.protobuf.kotlin.Any { +public operator fun com.google.protobuf.kotlin.Any.Companion.invoke(body: com.google.protobuf.kotlin.AnyInternal.() -> Unit): com.google.protobuf.kotlin.Any { val msg = com.google.protobuf.kotlin.AnyInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.AnyInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.AnyInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.AnyInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (typeUrl.isNotEmpty()) { +public fun com.google.protobuf.kotlin.AnyInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (typeUrl.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = typeUrl) } - if (value.isNotEmpty()) { + if (value.isNotEmpty()) { encoder.writeBytes(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.AnyInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.AnyInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.AnyInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.AnyInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.typeUrl = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readBytes() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.AnyInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.AnyInternal.computeSize(): Int { var __result = 0 - if (typeUrl.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(typeUrl).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (typeUrl.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(typeUrl).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Any.asInternal(): com.google.protobuf.kotlin.AnyInternal { - return this as? com.google.protobuf.kotlin.AnyInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Any.asInternal(): com.google.protobuf.kotlin.AnyInternal { + return this as? com.google.protobuf.kotlin.AnyInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt index 66760e11f..bf9ff3be5 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt @@ -1,12 +1,23 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) + package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.* +import kotlinx.rpc.internal.utils.ExperimentalRpcApi import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.* - -public class ApiInternal: com.google.protobuf.kotlin.Api, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { +import kotlinx.rpc.protobuf.internal.MsgFieldDelegate +import kotlinx.rpc.protobuf.internal.bool +import kotlinx.rpc.protobuf.internal.enum +import kotlinx.rpc.protobuf.internal.int32 +import kotlinx.rpc.protobuf.internal.string +import kotlinx.rpc.protobuf.internal.tag + +public class ApiInternal : com.google.protobuf.kotlin.Api, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { public const val sourceContext: Int = 0 } @@ -22,21 +33,21 @@ public class ApiInternal: com.google.protobuf.kotlin.Api, kotlinx.rpc.protobuf.i public override var syntax: com.google.protobuf.kotlin.Syntax by MsgFieldDelegate { com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2 } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Api): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Api): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Api { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Api { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.ApiInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.ApiInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -49,7 +60,8 @@ public class ApiInternal: com.google.protobuf.kotlin.Api, kotlinx.rpc.protobuf.i public companion object } -public class MethodInternal: com.google.protobuf.kotlin.Method, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class MethodInternal : com.google.protobuf.kotlin.Method, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -62,21 +74,21 @@ public class MethodInternal: com.google.protobuf.kotlin.Method, kotlinx.rpc.prot public override var syntax: com.google.protobuf.kotlin.Syntax by MsgFieldDelegate { com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2 } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Method): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Method): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Method { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Method { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.MethodInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.MethodInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -89,7 +101,8 @@ public class MethodInternal: com.google.protobuf.kotlin.Method, kotlinx.rpc.prot public companion object } -public class MixinInternal: com.google.protobuf.kotlin.Mixin, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class MixinInternal : com.google.protobuf.kotlin.Mixin, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -97,21 +110,21 @@ public class MixinInternal: com.google.protobuf.kotlin.Mixin, kotlinx.rpc.protob public override var root: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Mixin): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Mixin): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Mixin { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Mixin { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.MixinInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.MixinInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -124,344 +137,431 @@ public class MixinInternal: com.google.protobuf.kotlin.Mixin, kotlinx.rpc.protob public companion object } -public operator fun com.google.protobuf.kotlin.Api.Companion.invoke(body: com.google.protobuf.kotlin.ApiInternal.() -> Unit): com.google.protobuf.kotlin.Api { +public operator fun com.google.protobuf.kotlin.Api.Companion.invoke(body: com.google.protobuf.kotlin.ApiInternal.() -> Unit): com.google.protobuf.kotlin.Api { val msg = com.google.protobuf.kotlin.ApiInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Method.Companion.invoke(body: com.google.protobuf.kotlin.MethodInternal.() -> Unit): com.google.protobuf.kotlin.Method { +public operator fun com.google.protobuf.kotlin.Method.Companion.invoke(body: com.google.protobuf.kotlin.MethodInternal.() -> Unit): com.google.protobuf.kotlin.Method { val msg = com.google.protobuf.kotlin.MethodInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Mixin.Companion.invoke(body: com.google.protobuf.kotlin.MixinInternal.() -> Unit): com.google.protobuf.kotlin.Mixin { +public operator fun com.google.protobuf.kotlin.Mixin.Companion.invoke(body: com.google.protobuf.kotlin.MixinInternal.() -> Unit): com.google.protobuf.kotlin.Mixin { val msg = com.google.protobuf.kotlin.MixinInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ApiInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.ApiInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { sourceContext.asInternal().checkRequiredFields() } - methods.forEach { + methods.forEach { it.asInternal().checkRequiredFields() } - options.forEach { + options.forEach { it.asInternal().checkRequiredFields() } - mixins.forEach { + mixins.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ApiInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.ApiInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (methods.isNotEmpty()) { - methods.forEach { + if (methods.isNotEmpty()) { + methods.forEach { encoder.writeMessage(fieldNr = 2, value = it.asInternal()) { encodeWith(it) } } } - if (options.isNotEmpty()) { - options.forEach { + if (options.isNotEmpty()) { + options.forEach { encoder.writeMessage(fieldNr = 3, value = it.asInternal()) { encodeWith(it) } } } - if (version.isNotEmpty()) { + if (version.isNotEmpty()) { encoder.writeString(fieldNr = 4, value = version) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 5, value = sourceContext.asInternal()) { encodeWith(it) } } - if (mixins.isNotEmpty()) { - mixins.forEach { + if (mixins.isNotEmpty()) { + mixins.forEach { encoder.writeMessage(fieldNr = 6, value = it.asInternal()) { encodeWith(it) } } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { encoder.writeEnum(fieldNr = 7, value = syntax.number) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ApiInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.ApiInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.ApiInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.ApiInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.MethodInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.MethodInternal::decodeWith) (msg.methods as MutableList).add(elem) } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.OptionInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.OptionInternal::decodeWith) (msg.options as MutableList).add(elem) } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.version = decoder.readString() } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { msg.sourceContext = com.google.protobuf.kotlin.SourceContextInternal() } - decoder.readMessage(msg.sourceContext.asInternal(), com.google.protobuf.kotlin.SourceContextInternal::decodeWith) + decoder.readMessage( + msg.sourceContext.asInternal(), + com.google.protobuf.kotlin.SourceContextInternal::decodeWith + ) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.MixinInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.MixinInternal::decodeWith) (msg.mixins as MutableList).add(elem) } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.syntax = com.google.protobuf.kotlin.Syntax.fromNumber(decoder.readEnum()) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.ApiInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.ApiInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (methods.isNotEmpty()) { - __result += methods.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (methods.isNotEmpty()) { + __result += methods.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (options.isNotEmpty()) { - __result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (options.isNotEmpty()) { + __result += options.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 3, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (version.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(version).let { kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (version.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(version).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 4, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[0]) { - __result += sourceContext.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += sourceContext.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 5, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (mixins.isNotEmpty()) { - __result += mixins.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (mixins.isNotEmpty()) { + __result += mixins.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 6, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 7, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Api.asInternal(): com.google.protobuf.kotlin.ApiInternal { - return this as? com.google.protobuf.kotlin.ApiInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Api.asInternal(): com.google.protobuf.kotlin.ApiInternal { + return this as? com.google.protobuf.kotlin.ApiInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.MethodInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.MethodInternal.checkRequiredFields() { // no required fields to check - options.forEach { + options.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.MethodInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.MethodInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (requestTypeUrl.isNotEmpty()) { + if (requestTypeUrl.isNotEmpty()) { encoder.writeString(fieldNr = 2, value = requestTypeUrl) } - if (requestStreaming != false) { + if (requestStreaming != false) { encoder.writeBool(fieldNr = 3, value = requestStreaming) } - if (responseTypeUrl.isNotEmpty()) { + if (responseTypeUrl.isNotEmpty()) { encoder.writeString(fieldNr = 4, value = responseTypeUrl) } - if (responseStreaming != false) { + if (responseStreaming != false) { encoder.writeBool(fieldNr = 5, value = responseStreaming) } - if (options.isNotEmpty()) { - options.forEach { + if (options.isNotEmpty()) { + options.forEach { encoder.writeMessage(fieldNr = 6, value = it.asInternal()) { encodeWith(it) } } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { encoder.writeEnum(fieldNr = 7, value = syntax.number) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.MethodInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.MethodInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.MethodInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.MethodInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.requestTypeUrl = decoder.readString() } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.requestStreaming = decoder.readBool() } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.responseTypeUrl = decoder.readString() } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.responseStreaming = decoder.readBool() } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.OptionInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.OptionInternal::decodeWith) (msg.options as MutableList).add(elem) } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.syntax = com.google.protobuf.kotlin.Syntax.fromNumber(decoder.readEnum()) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.MethodInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.MethodInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (requestTypeUrl.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(requestTypeUrl).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (requestTypeUrl.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(requestTypeUrl).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (requestStreaming != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(requestStreaming)) + if (requestStreaming != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 3, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(requestStreaming)) } - if (responseTypeUrl.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(responseTypeUrl).let { kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (responseTypeUrl.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(responseTypeUrl).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 4, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (responseStreaming != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(responseStreaming)) + if (responseStreaming != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 5, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(responseStreaming)) } - if (options.isNotEmpty()) { - __result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (options.isNotEmpty()) { + __result += options.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 6, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 7, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Method.asInternal(): com.google.protobuf.kotlin.MethodInternal { - return this as? com.google.protobuf.kotlin.MethodInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Method.asInternal(): com.google.protobuf.kotlin.MethodInternal { + return this as? com.google.protobuf.kotlin.MethodInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.MixinInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.MixinInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.MixinInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.MixinInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (root.isNotEmpty()) { + if (root.isNotEmpty()) { encoder.writeString(fieldNr = 2, value = root) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.MixinInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.MixinInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.MixinInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.MixinInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.root = decoder.readString() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.MixinInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.MixinInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (root.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(root).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (root.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(root).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Mixin.asInternal(): com.google.protobuf.kotlin.MixinInternal { - return this as? com.google.protobuf.kotlin.MixinInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Mixin.asInternal(): com.google.protobuf.kotlin.MixinInternal { + return this as? com.google.protobuf.kotlin.MixinInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt index a21fd44ae..11b6778a9 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt @@ -1,11 +1,20 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) + package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.* +import kotlinx.rpc.internal.utils.ExperimentalRpcApi import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.* +import kotlinx.rpc.protobuf.internal.MsgFieldDelegate +import kotlinx.rpc.protobuf.internal.int32 +import kotlinx.rpc.protobuf.internal.int64 +import kotlinx.rpc.protobuf.internal.tag -public class DurationInternal: com.google.protobuf.kotlin.Duration, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class DurationInternal : com.google.protobuf.kotlin.Duration, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -13,21 +22,21 @@ public class DurationInternal: com.google.protobuf.kotlin.Duration, kotlinx.rpc. public override var nanos: Int by MsgFieldDelegate { 0 } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Duration): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Duration): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Duration { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Duration { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.DurationInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.DurationInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -40,64 +49,74 @@ public class DurationInternal: com.google.protobuf.kotlin.Duration, kotlinx.rpc. public companion object } -public operator fun com.google.protobuf.kotlin.Duration.Companion.invoke(body: com.google.protobuf.kotlin.DurationInternal.() -> Unit): com.google.protobuf.kotlin.Duration { +public operator fun com.google.protobuf.kotlin.Duration.Companion.invoke(body: com.google.protobuf.kotlin.DurationInternal.() -> Unit): com.google.protobuf.kotlin.Duration { val msg = com.google.protobuf.kotlin.DurationInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DurationInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.DurationInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DurationInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (seconds != 0L) { +public fun com.google.protobuf.kotlin.DurationInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (seconds != 0L) { encoder.writeInt64(fieldNr = 1, value = seconds) } - if (nanos != 0) { + if (nanos != 0) { encoder.writeInt32(fieldNr = 2, value = nanos) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DurationInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.DurationInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.DurationInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.DurationInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.seconds = decoder.readInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.nanos = decoder.readInt32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.DurationInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.DurationInternal.computeSize(): Int { var __result = 0 - if (seconds != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(seconds)) + if (seconds != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int64(seconds)) } - if (nanos != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(nanos)) + if (nanos != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(nanos)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Duration.asInternal(): com.google.protobuf.kotlin.DurationInternal { - return this as? com.google.protobuf.kotlin.DurationInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Duration.asInternal(): com.google.protobuf.kotlin.DurationInternal { + return this as? com.google.protobuf.kotlin.DurationInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt index 710388e37..5d99a7628 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt @@ -1,30 +1,35 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) + package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.* +import kotlinx.rpc.internal.utils.ExperimentalRpcApi import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.* -public class EmptyInternal: com.google.protobuf.kotlin.Empty, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class EmptyInternal : com.google.protobuf.kotlin.Empty, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Empty): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Empty): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Empty { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Empty { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.EmptyInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.EmptyInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -37,42 +42,46 @@ public class EmptyInternal: com.google.protobuf.kotlin.Empty, kotlinx.rpc.protob public companion object } -public operator fun com.google.protobuf.kotlin.Empty.Companion.invoke(body: com.google.protobuf.kotlin.EmptyInternal.() -> Unit): com.google.protobuf.kotlin.Empty { +public operator fun com.google.protobuf.kotlin.Empty.Companion.invoke(body: com.google.protobuf.kotlin.EmptyInternal.() -> Unit): com.google.protobuf.kotlin.Empty { val msg = com.google.protobuf.kotlin.EmptyInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EmptyInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.EmptyInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EmptyInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { +public fun com.google.protobuf.kotlin.EmptyInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { // no fields to encode } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EmptyInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.EmptyInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.EmptyInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.EmptyInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - else -> { + when { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.EmptyInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.EmptyInternal.computeSize(): Int { var __result = 0 return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Empty.asInternal(): com.google.protobuf.kotlin.EmptyInternal { - return this as? com.google.protobuf.kotlin.EmptyInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Empty.asInternal(): com.google.protobuf.kotlin.EmptyInternal { + return this as? com.google.protobuf.kotlin.EmptyInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt index da3284fca..1e5197b6b 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt @@ -1,32 +1,40 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) + package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.* +import kotlinx.rpc.internal.utils.ExperimentalRpcApi import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.* +import kotlinx.rpc.protobuf.internal.MsgFieldDelegate +import kotlinx.rpc.protobuf.internal.string +import kotlinx.rpc.protobuf.internal.tag -public class FieldMaskInternal: com.google.protobuf.kotlin.FieldMask, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class FieldMaskInternal : com.google.protobuf.kotlin.FieldMask, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var paths: List by MsgFieldDelegate { mutableListOf() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.FieldMask): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.FieldMask): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.FieldMask { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.FieldMask { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.FieldMaskInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.FieldMaskInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -39,55 +47,64 @@ public class FieldMaskInternal: com.google.protobuf.kotlin.FieldMask, kotlinx.rp public companion object } -public operator fun com.google.protobuf.kotlin.FieldMask.Companion.invoke(body: com.google.protobuf.kotlin.FieldMaskInternal.() -> Unit): com.google.protobuf.kotlin.FieldMask { +public operator fun com.google.protobuf.kotlin.FieldMask.Companion.invoke(body: com.google.protobuf.kotlin.FieldMaskInternal.() -> Unit): com.google.protobuf.kotlin.FieldMask { val msg = com.google.protobuf.kotlin.FieldMaskInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldMaskInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.FieldMaskInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldMaskInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (paths.isNotEmpty()) { - paths.forEach { +public fun com.google.protobuf.kotlin.FieldMaskInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (paths.isNotEmpty()) { + paths.forEach { encoder.writeString(1, it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldMaskInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.FieldMaskInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.FieldMaskInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.FieldMaskInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.paths as MutableList).add(elem) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.FieldMaskInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.FieldMaskInternal.computeSize(): Int { var __result = 0 - if (paths.isNotEmpty()) { - __result += paths.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (paths.isNotEmpty()) { + __result += paths.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldMask.asInternal(): com.google.protobuf.kotlin.FieldMaskInternal { - return this as? com.google.protobuf.kotlin.FieldMaskInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.FieldMask.asInternal(): com.google.protobuf.kotlin.FieldMaskInternal { + return this as? com.google.protobuf.kotlin.FieldMaskInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt index 4c79763a7..cecfa79fa 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt @@ -1,32 +1,41 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) + package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.* +import kotlinx.rpc.internal.utils.ExperimentalRpcApi import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.* +import kotlinx.rpc.protobuf.internal.MsgFieldDelegate +import kotlinx.rpc.protobuf.internal.int32 +import kotlinx.rpc.protobuf.internal.string +import kotlinx.rpc.protobuf.internal.tag -public class SourceContextInternal: com.google.protobuf.kotlin.SourceContext, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class SourceContextInternal : com.google.protobuf.kotlin.SourceContext, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var fileName: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.SourceContext): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.SourceContext): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.SourceContext { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.SourceContext { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.SourceContextInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.SourceContextInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -39,52 +48,61 @@ public class SourceContextInternal: com.google.protobuf.kotlin.SourceContext, ko public companion object } -public operator fun com.google.protobuf.kotlin.SourceContext.Companion.invoke(body: com.google.protobuf.kotlin.SourceContextInternal.() -> Unit): com.google.protobuf.kotlin.SourceContext { +public operator fun com.google.protobuf.kotlin.SourceContext.Companion.invoke(body: com.google.protobuf.kotlin.SourceContextInternal.() -> Unit): com.google.protobuf.kotlin.SourceContext { val msg = com.google.protobuf.kotlin.SourceContextInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.SourceContextInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.SourceContextInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.SourceContextInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (fileName.isNotEmpty()) { +public fun com.google.protobuf.kotlin.SourceContextInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (fileName.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = fileName) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.SourceContextInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.SourceContextInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.SourceContextInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.SourceContextInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.fileName = decoder.readString() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.SourceContextInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.SourceContextInternal.computeSize(): Int { var __result = 0 - if (fileName.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(fileName).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (fileName.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(fileName).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.SourceContext.asInternal(): com.google.protobuf.kotlin.SourceContextInternal { - return this as? com.google.protobuf.kotlin.SourceContextInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.SourceContext.asInternal(): com.google.protobuf.kotlin.SourceContextInternal { + return this as? com.google.protobuf.kotlin.SourceContextInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt index 4f69c5022..669fb6996 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt @@ -1,18 +1,30 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) + package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.* +import kotlinx.rpc.internal.utils.ExperimentalRpcApi import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.* - -public class StructInternal: com.google.protobuf.kotlin.Struct, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +import kotlinx.rpc.protobuf.internal.MsgFieldDelegate +import kotlinx.rpc.protobuf.internal.bool +import kotlinx.rpc.protobuf.internal.double +import kotlinx.rpc.protobuf.internal.enum +import kotlinx.rpc.protobuf.internal.int32 +import kotlinx.rpc.protobuf.internal.string +import kotlinx.rpc.protobuf.internal.tag + +public class StructInternal : com.google.protobuf.kotlin.Struct, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var fields: Map by MsgFieldDelegate { mutableMapOf() } - public class FieldsEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + public class FieldsEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { public const val value: Int = 0 } @@ -27,21 +39,21 @@ public class StructInternal: com.google.protobuf.kotlin.Struct, kotlinx.rpc.prot } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Struct): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Struct): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Struct { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Struct { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.StructInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.StructInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -54,28 +66,29 @@ public class StructInternal: com.google.protobuf.kotlin.Struct, kotlinx.rpc.prot public companion object } -public class ValueInternal: com.google.protobuf.kotlin.Value, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class ValueInternal : com.google.protobuf.kotlin.Value, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var kind: com.google.protobuf.kotlin.Value.Kind? = null @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Value): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Value): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Value { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Value { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.ValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.ValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -88,28 +101,29 @@ public class ValueInternal: com.google.protobuf.kotlin.Value, kotlinx.rpc.protob public companion object } -public class ListValueInternal: com.google.protobuf.kotlin.ListValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class ListValueInternal : com.google.protobuf.kotlin.ListValue, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var values: List by MsgFieldDelegate { mutableListOf() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.ListValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.ListValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.ListValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.ListValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.ListValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.ListValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -122,76 +136,82 @@ public class ListValueInternal: com.google.protobuf.kotlin.ListValue, kotlinx.rp public companion object } -public operator fun com.google.protobuf.kotlin.Struct.Companion.invoke(body: com.google.protobuf.kotlin.StructInternal.() -> Unit): com.google.protobuf.kotlin.Struct { +public operator fun com.google.protobuf.kotlin.Struct.Companion.invoke(body: com.google.protobuf.kotlin.StructInternal.() -> Unit): com.google.protobuf.kotlin.Struct { val msg = com.google.protobuf.kotlin.StructInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Value.Companion.invoke(body: com.google.protobuf.kotlin.ValueInternal.() -> Unit): com.google.protobuf.kotlin.Value { +public operator fun com.google.protobuf.kotlin.Value.Companion.invoke(body: com.google.protobuf.kotlin.ValueInternal.() -> Unit): com.google.protobuf.kotlin.Value { val msg = com.google.protobuf.kotlin.ValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.ListValue.Companion.invoke(body: com.google.protobuf.kotlin.ListValueInternal.() -> Unit): com.google.protobuf.kotlin.ListValue { +public operator fun com.google.protobuf.kotlin.ListValue.Companion.invoke(body: com.google.protobuf.kotlin.ListValueInternal.() -> Unit): com.google.protobuf.kotlin.ListValue { val msg = com.google.protobuf.kotlin.ListValueInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.StructInternal.checkRequiredFields() { // no required fields to check - fields.values.forEach { + fields.values.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (fields.isNotEmpty()) { +public fun com.google.protobuf.kotlin.StructInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (fields.isNotEmpty()) { fields.forEach { kEntry -> - com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal().apply { + com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 1, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 1, value = entry.asInternal()) { encodeWith(it) } + } } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.StructInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.StructInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.StructInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal::decodeWith) + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal::decodeWith + ) (msg.fields as MutableMap)[key] = value } } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.StructInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.StructInternal.computeSize(): Int { var __result = 0 - if (fields.isNotEmpty()) { + if (fields.isNotEmpty()) { __result += fields.entries.sumOf { kEntry -> - com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal().apply { + com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } @@ -199,20 +219,21 @@ private fun com.google.protobuf.kotlin.StructInternal.computeSize(): Int { } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Struct.asInternal(): com.google.protobuf.kotlin.StructInternal { - return this as? com.google.protobuf.kotlin.StructInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Struct.asInternal(): com.google.protobuf.kotlin.StructInternal { + return this as? com.google.protobuf.kotlin.StructInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.ValueInternal.checkRequiredFields() { // no required fields to check - kind?.also { - when { - it is com.google.protobuf.kotlin.Value.Kind.StructValue -> { + kind?.also { + when { + it is com.google.protobuf.kotlin.Value.Kind.StructValue -> { it.value.asInternal().checkRequiredFields() } - it is com.google.protobuf.kotlin.Value.Kind.ListValue -> { + it is com.google.protobuf.kotlin.Value.Kind.ListValue -> { it.value.asInternal().checkRequiredFields() } } @@ -220,30 +241,30 @@ public fun com.google.protobuf.kotlin.ValueInternal.checkRequiredFields() { } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - kind?.also { - when (val value = it) { - is com.google.protobuf.kotlin.Value.Kind.NullValue -> { +public fun com.google.protobuf.kotlin.ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + kind?.also { + when (val value = it) { + is com.google.protobuf.kotlin.Value.Kind.NullValue -> { encoder.writeEnum(fieldNr = 1, value = value.value.number) } - is com.google.protobuf.kotlin.Value.Kind.NumberValue -> { + is com.google.protobuf.kotlin.Value.Kind.NumberValue -> { encoder.writeDouble(fieldNr = 2, value = value.value) } - is com.google.protobuf.kotlin.Value.Kind.StringValue -> { + is com.google.protobuf.kotlin.Value.Kind.StringValue -> { encoder.writeString(fieldNr = 3, value = value.value) } - is com.google.protobuf.kotlin.Value.Kind.BoolValue -> { + is com.google.protobuf.kotlin.Value.Kind.BoolValue -> { encoder.writeBool(fieldNr = 4, value = value.value) } - is com.google.protobuf.kotlin.Value.Kind.StructValue -> { + is com.google.protobuf.kotlin.Value.Kind.StructValue -> { encoder.writeMessage(fieldNr = 5, value = value.value.asInternal()) { encodeWith(it) } } - is com.google.protobuf.kotlin.Value.Kind.ListValue -> { + is com.google.protobuf.kotlin.Value.Kind.ListValue -> { encoder.writeMessage(fieldNr = 6, value = value.value.asInternal()) { encodeWith(it) } } } @@ -251,76 +272,109 @@ public fun com.google.protobuf.kotlin.ValueInternal.encodeWith(encoder: kotlinx. } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.ValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.ValueInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.ValueInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.kind = com.google.protobuf.kotlin.Value.Kind.NullValue(com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum())) + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.kind = com.google.protobuf.kotlin.Value.Kind.NullValue( + com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum()) + ) } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.kind = com.google.protobuf.kotlin.Value.Kind.NumberValue(decoder.readDouble()) } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.kind = com.google.protobuf.kotlin.Value.Kind.StringValue(decoder.readString()) } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.kind = com.google.protobuf.kotlin.Value.Kind.BoolValue(decoder.readBool()) } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - val field = (msg.kind as? com.google.protobuf.kotlin.Value.Kind.StructValue) ?: com.google.protobuf.kotlin.Value.Kind.StructValue(com.google.protobuf.kotlin.StructInternal()).also { - msg.kind = it - } + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + val field = (msg.kind as? com.google.protobuf.kotlin.Value.Kind.StructValue) + ?: com.google.protobuf.kotlin.Value.Kind.StructValue(com.google.protobuf.kotlin.StructInternal()) + .also { + msg.kind = it + } decoder.readMessage(field.value.asInternal(), com.google.protobuf.kotlin.StructInternal::decodeWith) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - val field = (msg.kind as? com.google.protobuf.kotlin.Value.Kind.ListValue) ?: com.google.protobuf.kotlin.Value.Kind.ListValue(com.google.protobuf.kotlin.ListValueInternal()).also { - msg.kind = it - } + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + val field = (msg.kind as? com.google.protobuf.kotlin.Value.Kind.ListValue) + ?: com.google.protobuf.kotlin.Value.Kind.ListValue(com.google.protobuf.kotlin.ListValueInternal()) + .also { + msg.kind = it + } decoder.readMessage(field.value.asInternal(), com.google.protobuf.kotlin.ListValueInternal::decodeWith) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.ValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.ValueInternal.computeSize(): Int { var __result = 0 - kind?.also { - when (val value = it) { - is com.google.protobuf.kotlin.Value.Kind.NullValue -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) - } - - is com.google.protobuf.kotlin.Value.Kind.NumberValue -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(value.value)) - } - - is com.google.protobuf.kotlin.Value.Kind.StringValue -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + kind?.also { + when (val value = it) { + is com.google.protobuf.kotlin.Value.Kind.NullValue -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) + } + + is com.google.protobuf.kotlin.Value.Kind.NumberValue -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.double(value.value)) + } + + is com.google.protobuf.kotlin.Value.Kind.StringValue -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 3, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf.kotlin.Value.Kind.BoolValue -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(value.value)) + is com.google.protobuf.kotlin.Value.Kind.BoolValue -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 4, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(value.value)) } - is com.google.protobuf.kotlin.Value.Kind.StructValue -> { - __result += value.value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf.kotlin.Value.Kind.StructValue -> { + __result += value.value.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 5, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf.kotlin.Value.Kind.ListValue -> { - __result += value.value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf.kotlin.Value.Kind.ListValue -> { + __result += value.value.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 6, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } } } @@ -329,130 +383,153 @@ private fun com.google.protobuf.kotlin.ValueInternal.computeSize(): Int { } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Value.asInternal(): com.google.protobuf.kotlin.ValueInternal { - return this as? com.google.protobuf.kotlin.ValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Value.asInternal(): com.google.protobuf.kotlin.ValueInternal { + return this as? com.google.protobuf.kotlin.ValueInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ListValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.ListValueInternal.checkRequiredFields() { // no required fields to check - values.forEach { + values.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ListValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (values.isNotEmpty()) { - values.forEach { +public fun com.google.protobuf.kotlin.ListValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (values.isNotEmpty()) { + values.forEach { encoder.writeMessage(fieldNr = 1, value = it.asInternal()) { encodeWith(it) } } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ListValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.ListValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.ListValueInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.ListValueInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.ValueInternal::decodeWith) (msg.values as MutableList).add(elem) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.ListValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.ListValueInternal.computeSize(): Int { var __result = 0 - if (values.isNotEmpty()) { - __result += values.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (values.isNotEmpty()) { + __result += values.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ListValue.asInternal(): com.google.protobuf.kotlin.ListValueInternal { - return this as? com.google.protobuf.kotlin.ListValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.ListValue.asInternal(): com.google.protobuf.kotlin.ListValueInternal { + return this as? com.google.protobuf.kotlin.ListValueInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { value.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = value.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { msg.value = com.google.protobuf.kotlin.ValueInternal() } decoder.readMessage(msg.value.asInternal(), com.google.protobuf.kotlin.ValueInternal::decodeWith) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[0]) { - __result += value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += value.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.asInternal(): com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal { +public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.asInternal(): com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.NullValue.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.NullValue { - return when (number) { - 0 -> { +public fun com.google.protobuf.kotlin.NullValue.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.NullValue { + return when (number) { + 0 -> { com.google.protobuf.kotlin.NullValue.NULL_VALUE } - else -> { + else -> { com.google.protobuf.kotlin.NullValue.UNRECOGNIZED(number) } } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt index c3b2f51ea..94c7ce7a3 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt @@ -1,11 +1,20 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) + package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.* +import kotlinx.rpc.internal.utils.ExperimentalRpcApi import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.* +import kotlinx.rpc.protobuf.internal.MsgFieldDelegate +import kotlinx.rpc.protobuf.internal.int32 +import kotlinx.rpc.protobuf.internal.int64 +import kotlinx.rpc.protobuf.internal.tag -public class TimestampInternal: com.google.protobuf.kotlin.Timestamp, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class TimestampInternal : com.google.protobuf.kotlin.Timestamp, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -13,21 +22,21 @@ public class TimestampInternal: com.google.protobuf.kotlin.Timestamp, kotlinx.rp public override var nanos: Int by MsgFieldDelegate { 0 } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Timestamp): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Timestamp): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Timestamp { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Timestamp { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.TimestampInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.TimestampInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -40,64 +49,74 @@ public class TimestampInternal: com.google.protobuf.kotlin.Timestamp, kotlinx.rp public companion object } -public operator fun com.google.protobuf.kotlin.Timestamp.Companion.invoke(body: com.google.protobuf.kotlin.TimestampInternal.() -> Unit): com.google.protobuf.kotlin.Timestamp { +public operator fun com.google.protobuf.kotlin.Timestamp.Companion.invoke(body: com.google.protobuf.kotlin.TimestampInternal.() -> Unit): com.google.protobuf.kotlin.Timestamp { val msg = com.google.protobuf.kotlin.TimestampInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.TimestampInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.TimestampInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.TimestampInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (seconds != 0L) { +public fun com.google.protobuf.kotlin.TimestampInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (seconds != 0L) { encoder.writeInt64(fieldNr = 1, value = seconds) } - if (nanos != 0) { + if (nanos != 0) { encoder.writeInt32(fieldNr = 2, value = nanos) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.TimestampInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.TimestampInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.TimestampInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.TimestampInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.seconds = decoder.readInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.nanos = decoder.readInt32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.TimestampInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.TimestampInternal.computeSize(): Int { var __result = 0 - if (seconds != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(seconds)) + if (seconds != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int64(seconds)) } - if (nanos != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(nanos)) + if (nanos != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(nanos)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Timestamp.asInternal(): com.google.protobuf.kotlin.TimestampInternal { - return this as? com.google.protobuf.kotlin.TimestampInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Timestamp.asInternal(): com.google.protobuf.kotlin.TimestampInternal { + return this as? com.google.protobuf.kotlin.TimestampInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt index 39e19e2d2..dcc7e3deb 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt @@ -1,12 +1,23 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) + package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.* +import kotlinx.rpc.internal.utils.ExperimentalRpcApi import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.* - -public class TypeInternal: com.google.protobuf.kotlin.Type, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { +import kotlinx.rpc.protobuf.internal.MsgFieldDelegate +import kotlinx.rpc.protobuf.internal.bool +import kotlinx.rpc.protobuf.internal.enum +import kotlinx.rpc.protobuf.internal.int32 +import kotlinx.rpc.protobuf.internal.string +import kotlinx.rpc.protobuf.internal.tag + +public class TypeInternal : com.google.protobuf.kotlin.Type, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { public const val sourceContext: Int = 0 } @@ -22,21 +33,21 @@ public class TypeInternal: com.google.protobuf.kotlin.Type, kotlinx.rpc.protobuf public override var edition: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Type): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Type): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Type { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Type { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.TypeInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.TypeInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -49,7 +60,8 @@ public class TypeInternal: com.google.protobuf.kotlin.Type, kotlinx.rpc.protobuf public companion object } -public class FieldInternal: com.google.protobuf.kotlin.Field, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class FieldInternal : com.google.protobuf.kotlin.Field, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -65,21 +77,21 @@ public class FieldInternal: com.google.protobuf.kotlin.Field, kotlinx.rpc.protob public override var defaultValue: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Field): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Field): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Field { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Field { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.FieldInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.FieldInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -92,8 +104,9 @@ public class FieldInternal: com.google.protobuf.kotlin.Field, kotlinx.rpc.protob public companion object } -public class EnumInternal: com.google.protobuf.kotlin.Enum, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { +public class EnumInternal : com.google.protobuf.kotlin.Enum, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { public const val sourceContext: Int = 0 } @@ -108,21 +121,21 @@ public class EnumInternal: com.google.protobuf.kotlin.Enum, kotlinx.rpc.protobuf public override var edition: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Enum): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Enum): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Enum { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Enum { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.EnumInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.EnumInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -135,7 +148,8 @@ public class EnumInternal: com.google.protobuf.kotlin.Enum, kotlinx.rpc.protobuf public companion object } -public class EnumValueInternal: com.google.protobuf.kotlin.EnumValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class EnumValueInternal : com.google.protobuf.kotlin.EnumValue, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -144,21 +158,21 @@ public class EnumValueInternal: com.google.protobuf.kotlin.EnumValue, kotlinx.rp public override var options: List by MsgFieldDelegate { mutableListOf() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.EnumValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.EnumValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.EnumValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.EnumValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.EnumValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.EnumValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -171,8 +185,9 @@ public class EnumValueInternal: com.google.protobuf.kotlin.EnumValue, kotlinx.rp public companion object } -public class OptionInternal: com.google.protobuf.kotlin.Option, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { +public class OptionInternal : com.google.protobuf.kotlin.Option, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { public const val value: Int = 0 } @@ -183,21 +198,21 @@ public class OptionInternal: com.google.protobuf.kotlin.Option, kotlinx.rpc.prot public override var value: com.google.protobuf.kotlin.Any by MsgFieldDelegate(PresenceIndices.value) { com.google.protobuf.kotlin.AnyInternal() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Option): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Option): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Option { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Option { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.OptionInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.OptionInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -210,723 +225,873 @@ public class OptionInternal: com.google.protobuf.kotlin.Option, kotlinx.rpc.prot public companion object } -public operator fun com.google.protobuf.kotlin.Type.Companion.invoke(body: com.google.protobuf.kotlin.TypeInternal.() -> Unit): com.google.protobuf.kotlin.Type { +public operator fun com.google.protobuf.kotlin.Type.Companion.invoke(body: com.google.protobuf.kotlin.TypeInternal.() -> Unit): com.google.protobuf.kotlin.Type { val msg = com.google.protobuf.kotlin.TypeInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Field.Companion.invoke(body: com.google.protobuf.kotlin.FieldInternal.() -> Unit): com.google.protobuf.kotlin.Field { +public operator fun com.google.protobuf.kotlin.Field.Companion.invoke(body: com.google.protobuf.kotlin.FieldInternal.() -> Unit): com.google.protobuf.kotlin.Field { val msg = com.google.protobuf.kotlin.FieldInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Enum.Companion.invoke(body: com.google.protobuf.kotlin.EnumInternal.() -> Unit): com.google.protobuf.kotlin.Enum { +public operator fun com.google.protobuf.kotlin.Enum.Companion.invoke(body: com.google.protobuf.kotlin.EnumInternal.() -> Unit): com.google.protobuf.kotlin.Enum { val msg = com.google.protobuf.kotlin.EnumInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.EnumValue.Companion.invoke(body: com.google.protobuf.kotlin.EnumValueInternal.() -> Unit): com.google.protobuf.kotlin.EnumValue { +public operator fun com.google.protobuf.kotlin.EnumValue.Companion.invoke(body: com.google.protobuf.kotlin.EnumValueInternal.() -> Unit): com.google.protobuf.kotlin.EnumValue { val msg = com.google.protobuf.kotlin.EnumValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Option.Companion.invoke(body: com.google.protobuf.kotlin.OptionInternal.() -> Unit): com.google.protobuf.kotlin.Option { +public operator fun com.google.protobuf.kotlin.Option.Companion.invoke(body: com.google.protobuf.kotlin.OptionInternal.() -> Unit): com.google.protobuf.kotlin.Option { val msg = com.google.protobuf.kotlin.OptionInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.TypeInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.TypeInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { sourceContext.asInternal().checkRequiredFields() } - fields.forEach { + fields.forEach { it.asInternal().checkRequiredFields() } - options.forEach { + options.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.TypeInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.TypeInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (fields.isNotEmpty()) { - fields.forEach { + if (fields.isNotEmpty()) { + fields.forEach { encoder.writeMessage(fieldNr = 2, value = it.asInternal()) { encodeWith(it) } } } - if (oneofs.isNotEmpty()) { - oneofs.forEach { + if (oneofs.isNotEmpty()) { + oneofs.forEach { encoder.writeString(3, it) } } - if (options.isNotEmpty()) { - options.forEach { + if (options.isNotEmpty()) { + options.forEach { encoder.writeMessage(fieldNr = 4, value = it.asInternal()) { encodeWith(it) } } } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 5, value = sourceContext.asInternal()) { encodeWith(it) } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { encoder.writeEnum(fieldNr = 6, value = syntax.number) } - if (edition.isNotEmpty()) { + if (edition.isNotEmpty()) { encoder.writeString(fieldNr = 7, value = edition) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.TypeInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.TypeInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.TypeInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.TypeInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.FieldInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.FieldInternal::decodeWith) (msg.fields as MutableList).add(elem) } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.oneofs as MutableList).add(elem) } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.OptionInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.OptionInternal::decodeWith) (msg.options as MutableList).add(elem) } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { msg.sourceContext = com.google.protobuf.kotlin.SourceContextInternal() } - decoder.readMessage(msg.sourceContext.asInternal(), com.google.protobuf.kotlin.SourceContextInternal::decodeWith) + decoder.readMessage( + msg.sourceContext.asInternal(), + com.google.protobuf.kotlin.SourceContextInternal::decodeWith + ) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.syntax = com.google.protobuf.kotlin.Syntax.fromNumber(decoder.readEnum()) } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.edition = decoder.readString() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.TypeInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.TypeInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (fields.isNotEmpty()) { - __result += fields.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (fields.isNotEmpty()) { + __result += fields.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (oneofs.isNotEmpty()) { - __result += oneofs.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (oneofs.isNotEmpty()) { + __result += oneofs.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 3, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (options.isNotEmpty()) { - __result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (options.isNotEmpty()) { + __result += options.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 4, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (presenceMask[0]) { - __result += sourceContext.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += sourceContext.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 5, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 6, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) } - if (edition.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(edition).let { kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (edition.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(edition).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 7, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Type.asInternal(): com.google.protobuf.kotlin.TypeInternal { - return this as? com.google.protobuf.kotlin.TypeInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Type.asInternal(): com.google.protobuf.kotlin.TypeInternal { + return this as? com.google.protobuf.kotlin.TypeInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.FieldInternal.checkRequiredFields() { // no required fields to check - options.forEach { + options.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (kind != com.google.protobuf.kotlin.Field.Kind.TYPE_UNKNOWN) { +public fun com.google.protobuf.kotlin.FieldInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (kind != com.google.protobuf.kotlin.Field.Kind.TYPE_UNKNOWN) { encoder.writeEnum(fieldNr = 1, value = kind.number) } - if (cardinality != com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_UNKNOWN) { + if (cardinality != com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_UNKNOWN) { encoder.writeEnum(fieldNr = 2, value = cardinality.number) } - if (number != 0) { + if (number != 0) { encoder.writeInt32(fieldNr = 3, value = number) } - if (name.isNotEmpty()) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 4, value = name) } - if (typeUrl.isNotEmpty()) { + if (typeUrl.isNotEmpty()) { encoder.writeString(fieldNr = 6, value = typeUrl) } - if (oneofIndex != 0) { + if (oneofIndex != 0) { encoder.writeInt32(fieldNr = 7, value = oneofIndex) } - if (packed != false) { + if (packed != false) { encoder.writeBool(fieldNr = 8, value = packed) } - if (options.isNotEmpty()) { - options.forEach { + if (options.isNotEmpty()) { + options.forEach { encoder.writeMessage(fieldNr = 9, value = it.asInternal()) { encodeWith(it) } } } - if (jsonName.isNotEmpty()) { + if (jsonName.isNotEmpty()) { encoder.writeString(fieldNr = 10, value = jsonName) } - if (defaultValue.isNotEmpty()) { + if (defaultValue.isNotEmpty()) { encoder.writeString(fieldNr = 11, value = defaultValue) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.FieldInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.FieldInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.FieldInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.kind = com.google.protobuf.kotlin.Field.Kind.fromNumber(decoder.readEnum()) } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.cardinality = com.google.protobuf.kotlin.Field.Cardinality.fromNumber(decoder.readEnum()) } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.number = decoder.readInt32() } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.typeUrl = decoder.readString() } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.oneofIndex = decoder.readInt32() } - tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.packed = decoder.readBool() } - tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.OptionInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.OptionInternal::decodeWith) (msg.options as MutableList).add(elem) } - tag.fieldNr == 10 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 10 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.jsonName = decoder.readString() } - tag.fieldNr == 11 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 11 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.defaultValue = decoder.readString() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.FieldInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.FieldInternal.computeSize(): Int { var __result = 0 - if (kind != com.google.protobuf.kotlin.Field.Kind.TYPE_UNKNOWN) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(kind.number)) + if (kind != com.google.protobuf.kotlin.Field.Kind.TYPE_UNKNOWN) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(kind.number)) } - if (cardinality != com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_UNKNOWN) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(cardinality.number)) + if (cardinality != com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_UNKNOWN) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(cardinality.number)) } - if (number != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(number)) + if (number != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 3, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(number)) } - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 4, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (typeUrl.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(typeUrl).let { kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (typeUrl.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(typeUrl).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 6, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (oneofIndex != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(oneofIndex)) + if (oneofIndex != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 7, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(oneofIndex)) } - if (packed != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(8, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(packed)) + if (packed != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 8, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(packed)) } - if (options.isNotEmpty()) { - __result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(9, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (options.isNotEmpty()) { + __result += options.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 9, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (jsonName.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(jsonName).let { kotlinx.rpc.protobuf.internal.WireSize.tag(10, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (jsonName.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(jsonName).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 10, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (defaultValue.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(defaultValue).let { kotlinx.rpc.protobuf.internal.WireSize.tag(11, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (defaultValue.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(defaultValue).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 11, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Field.asInternal(): com.google.protobuf.kotlin.FieldInternal { - return this as? com.google.protobuf.kotlin.FieldInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Field.asInternal(): com.google.protobuf.kotlin.FieldInternal { + return this as? com.google.protobuf.kotlin.FieldInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.EnumInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { sourceContext.asInternal().checkRequiredFields() } - enumvalue.forEach { + enumvalue.forEach { it.asInternal().checkRequiredFields() } - options.forEach { + options.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.EnumInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (enumvalue.isNotEmpty()) { - enumvalue.forEach { + if (enumvalue.isNotEmpty()) { + enumvalue.forEach { encoder.writeMessage(fieldNr = 2, value = it.asInternal()) { encodeWith(it) } } } - if (options.isNotEmpty()) { - options.forEach { + if (options.isNotEmpty()) { + options.forEach { encoder.writeMessage(fieldNr = 3, value = it.asInternal()) { encodeWith(it) } } } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 4, value = sourceContext.asInternal()) { encodeWith(it) } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { encoder.writeEnum(fieldNr = 5, value = syntax.number) } - if (edition.isNotEmpty()) { + if (edition.isNotEmpty()) { encoder.writeString(fieldNr = 6, value = edition) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.EnumInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.EnumInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.EnumInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.EnumValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.EnumValueInternal::decodeWith) (msg.enumvalue as MutableList).add(elem) } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.OptionInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.OptionInternal::decodeWith) (msg.options as MutableList).add(elem) } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { msg.sourceContext = com.google.protobuf.kotlin.SourceContextInternal() } - decoder.readMessage(msg.sourceContext.asInternal(), com.google.protobuf.kotlin.SourceContextInternal::decodeWith) + decoder.readMessage( + msg.sourceContext.asInternal(), + com.google.protobuf.kotlin.SourceContextInternal::decodeWith + ) } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.syntax = com.google.protobuf.kotlin.Syntax.fromNumber(decoder.readEnum()) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.edition = decoder.readString() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.EnumInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.EnumInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (enumvalue.isNotEmpty()) { - __result += enumvalue.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (enumvalue.isNotEmpty()) { + __result += enumvalue.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (options.isNotEmpty()) { - __result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (options.isNotEmpty()) { + __result += options.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 3, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (presenceMask[0]) { - __result += sourceContext.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += sourceContext.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 4, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 5, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) } - if (edition.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(edition).let { kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (edition.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(edition).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 6, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Enum.asInternal(): com.google.protobuf.kotlin.EnumInternal { - return this as? com.google.protobuf.kotlin.EnumInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Enum.asInternal(): com.google.protobuf.kotlin.EnumInternal { + return this as? com.google.protobuf.kotlin.EnumInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.EnumValueInternal.checkRequiredFields() { // no required fields to check - options.forEach { + options.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.EnumValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (number != 0) { + if (number != 0) { encoder.writeInt32(fieldNr = 2, value = number) } - if (options.isNotEmpty()) { - options.forEach { + if (options.isNotEmpty()) { + options.forEach { encoder.writeMessage(fieldNr = 3, value = it.asInternal()) { encodeWith(it) } } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.EnumValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.EnumValueInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.EnumValueInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.number = decoder.readInt32() } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.OptionInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.OptionInternal::decodeWith) (msg.options as MutableList).add(elem) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.EnumValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.EnumValueInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (number != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(number)) + if (number != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(number)) } - if (options.isNotEmpty()) { - __result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (options.isNotEmpty()) { + __result += options.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 3, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumValue.asInternal(): com.google.protobuf.kotlin.EnumValueInternal { - return this as? com.google.protobuf.kotlin.EnumValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.EnumValue.asInternal(): com.google.protobuf.kotlin.EnumValueInternal { + return this as? com.google.protobuf.kotlin.EnumValueInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.OptionInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.OptionInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { value.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.OptionInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.OptionInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = value.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.OptionInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.OptionInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.OptionInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.OptionInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { msg.value = com.google.protobuf.kotlin.AnyInternal() } decoder.readMessage(msg.value.asInternal(), com.google.protobuf.kotlin.AnyInternal::decodeWith) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.OptionInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.OptionInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[0]) { - __result += value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += value.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Option.asInternal(): com.google.protobuf.kotlin.OptionInternal { - return this as? com.google.protobuf.kotlin.OptionInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Option.asInternal(): com.google.protobuf.kotlin.OptionInternal { + return this as? com.google.protobuf.kotlin.OptionInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Syntax.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.Syntax { - return when (number) { - 0 -> { +public fun com.google.protobuf.kotlin.Syntax.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.Syntax { + return when (number) { + 0 -> { com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2 } - 1 -> { + 1 -> { com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO3 } - 2 -> { + 2 -> { com.google.protobuf.kotlin.Syntax.SYNTAX_EDITIONS } - else -> { + else -> { com.google.protobuf.kotlin.Syntax.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Field.Kind.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.Field.Kind { - return when (number) { - 0 -> { +public fun com.google.protobuf.kotlin.Field.Kind.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.Field.Kind { + return when (number) { + 0 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_UNKNOWN } - 1 -> { + 1 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_DOUBLE } - 2 -> { + 2 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_FLOAT } - 3 -> { + 3 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_INT64 } - 4 -> { + 4 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_UINT64 } - 5 -> { + 5 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_INT32 } - 6 -> { + 6 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_FIXED64 } - 7 -> { + 7 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_FIXED32 } - 8 -> { + 8 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_BOOL } - 9 -> { + 9 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_STRING } - 10 -> { + 10 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_GROUP } - 11 -> { + 11 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_MESSAGE } - 12 -> { + 12 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_BYTES } - 13 -> { + 13 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_UINT32 } - 14 -> { + 14 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_ENUM } - 15 -> { + 15 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_SFIXED32 } - 16 -> { + 16 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_SFIXED64 } - 17 -> { + 17 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_SINT32 } - 18 -> { + 18 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_SINT64 } - else -> { + else -> { com.google.protobuf.kotlin.Field.Kind.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Field.Cardinality.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.Field.Cardinality { - return when (number) { - 0 -> { +public fun com.google.protobuf.kotlin.Field.Cardinality.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.Field.Cardinality { + return when (number) { + 0 -> { com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_UNKNOWN } - 1 -> { + 1 -> { com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_OPTIONAL } - 2 -> { + 2 -> { com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_REQUIRED } - 3 -> { + 3 -> { com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_REPEATED } - else -> { + else -> { com.google.protobuf.kotlin.Field.Cardinality.UNRECOGNIZED(number) } } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt index 19f862504..ac3c212dc 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt @@ -1,32 +1,48 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) + package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.* +import kotlinx.rpc.internal.utils.ExperimentalRpcApi import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.* - -public class DoubleValueInternal: com.google.protobuf.kotlin.DoubleValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +import kotlinx.rpc.protobuf.internal.MsgFieldDelegate +import kotlinx.rpc.protobuf.internal.bool +import kotlinx.rpc.protobuf.internal.bytes +import kotlinx.rpc.protobuf.internal.double +import kotlinx.rpc.protobuf.internal.float +import kotlinx.rpc.protobuf.internal.int32 +import kotlinx.rpc.protobuf.internal.int64 +import kotlinx.rpc.protobuf.internal.string +import kotlinx.rpc.protobuf.internal.tag +import kotlinx.rpc.protobuf.internal.uInt32 +import kotlinx.rpc.protobuf.internal.uInt64 + +public class DoubleValueInternal : com.google.protobuf.kotlin.DoubleValue, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: Double by MsgFieldDelegate { 0.0 } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.DoubleValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.DoubleValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.DoubleValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.DoubleValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.DoubleValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.DoubleValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -39,28 +55,29 @@ public class DoubleValueInternal: com.google.protobuf.kotlin.DoubleValue, kotlin public companion object } -public class FloatValueInternal: com.google.protobuf.kotlin.FloatValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class FloatValueInternal : com.google.protobuf.kotlin.FloatValue, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: Float by MsgFieldDelegate { 0.0f } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.FloatValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.FloatValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.FloatValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.FloatValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.FloatValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.FloatValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -73,28 +90,29 @@ public class FloatValueInternal: com.google.protobuf.kotlin.FloatValue, kotlinx. public companion object } -public class Int64ValueInternal: com.google.protobuf.kotlin.Int64Value, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class Int64ValueInternal : com.google.protobuf.kotlin.Int64Value, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: Long by MsgFieldDelegate { 0L } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Int64Value): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Int64Value): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Int64Value { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Int64Value { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.Int64ValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.Int64ValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -107,28 +125,29 @@ public class Int64ValueInternal: com.google.protobuf.kotlin.Int64Value, kotlinx. public companion object } -public class UInt64ValueInternal: com.google.protobuf.kotlin.UInt64Value, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class UInt64ValueInternal : com.google.protobuf.kotlin.UInt64Value, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: ULong by MsgFieldDelegate { 0uL } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.UInt64Value): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.UInt64Value): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.UInt64Value { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.UInt64Value { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.UInt64ValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.UInt64ValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -141,28 +160,29 @@ public class UInt64ValueInternal: com.google.protobuf.kotlin.UInt64Value, kotlin public companion object } -public class Int32ValueInternal: com.google.protobuf.kotlin.Int32Value, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class Int32ValueInternal : com.google.protobuf.kotlin.Int32Value, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: Int by MsgFieldDelegate { 0 } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Int32Value): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Int32Value): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Int32Value { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Int32Value { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.Int32ValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.Int32ValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -175,28 +195,29 @@ public class Int32ValueInternal: com.google.protobuf.kotlin.Int32Value, kotlinx. public companion object } -public class UInt32ValueInternal: com.google.protobuf.kotlin.UInt32Value, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class UInt32ValueInternal : com.google.protobuf.kotlin.UInt32Value, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: UInt by MsgFieldDelegate { 0u } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.UInt32Value): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.UInt32Value): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.UInt32Value { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.UInt32Value { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.UInt32ValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.UInt32ValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -209,28 +230,29 @@ public class UInt32ValueInternal: com.google.protobuf.kotlin.UInt32Value, kotlin public companion object } -public class BoolValueInternal: com.google.protobuf.kotlin.BoolValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class BoolValueInternal : com.google.protobuf.kotlin.BoolValue, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: Boolean by MsgFieldDelegate { false } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.BoolValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.BoolValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.BoolValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.BoolValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.BoolValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.BoolValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -243,28 +265,29 @@ public class BoolValueInternal: com.google.protobuf.kotlin.BoolValue, kotlinx.rp public companion object } -public class StringValueInternal: com.google.protobuf.kotlin.StringValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class StringValueInternal : com.google.protobuf.kotlin.StringValue, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.StringValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.StringValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.StringValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.StringValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.StringValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.StringValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -277,28 +300,29 @@ public class StringValueInternal: com.google.protobuf.kotlin.StringValue, kotlin public companion object } -public class BytesValueInternal: com.google.protobuf.kotlin.BytesValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class BytesValueInternal : com.google.protobuf.kotlin.BytesValue, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: ByteArray by MsgFieldDelegate { byteArrayOf() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.BytesValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.BytesValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.BytesValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.BytesValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.BytesValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.BytesValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -311,444 +335,511 @@ public class BytesValueInternal: com.google.protobuf.kotlin.BytesValue, kotlinx. public companion object } -public operator fun com.google.protobuf.kotlin.DoubleValue.Companion.invoke(body: com.google.protobuf.kotlin.DoubleValueInternal.() -> Unit): com.google.protobuf.kotlin.DoubleValue { +public operator fun com.google.protobuf.kotlin.DoubleValue.Companion.invoke(body: com.google.protobuf.kotlin.DoubleValueInternal.() -> Unit): com.google.protobuf.kotlin.DoubleValue { val msg = com.google.protobuf.kotlin.DoubleValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.FloatValue.Companion.invoke(body: com.google.protobuf.kotlin.FloatValueInternal.() -> Unit): com.google.protobuf.kotlin.FloatValue { +public operator fun com.google.protobuf.kotlin.FloatValue.Companion.invoke(body: com.google.protobuf.kotlin.FloatValueInternal.() -> Unit): com.google.protobuf.kotlin.FloatValue { val msg = com.google.protobuf.kotlin.FloatValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Int64Value.Companion.invoke(body: com.google.protobuf.kotlin.Int64ValueInternal.() -> Unit): com.google.protobuf.kotlin.Int64Value { +public operator fun com.google.protobuf.kotlin.Int64Value.Companion.invoke(body: com.google.protobuf.kotlin.Int64ValueInternal.() -> Unit): com.google.protobuf.kotlin.Int64Value { val msg = com.google.protobuf.kotlin.Int64ValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.UInt64Value.Companion.invoke(body: com.google.protobuf.kotlin.UInt64ValueInternal.() -> Unit): com.google.protobuf.kotlin.UInt64Value { +public operator fun com.google.protobuf.kotlin.UInt64Value.Companion.invoke(body: com.google.protobuf.kotlin.UInt64ValueInternal.() -> Unit): com.google.protobuf.kotlin.UInt64Value { val msg = com.google.protobuf.kotlin.UInt64ValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Int32Value.Companion.invoke(body: com.google.protobuf.kotlin.Int32ValueInternal.() -> Unit): com.google.protobuf.kotlin.Int32Value { +public operator fun com.google.protobuf.kotlin.Int32Value.Companion.invoke(body: com.google.protobuf.kotlin.Int32ValueInternal.() -> Unit): com.google.protobuf.kotlin.Int32Value { val msg = com.google.protobuf.kotlin.Int32ValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.UInt32Value.Companion.invoke(body: com.google.protobuf.kotlin.UInt32ValueInternal.() -> Unit): com.google.protobuf.kotlin.UInt32Value { +public operator fun com.google.protobuf.kotlin.UInt32Value.Companion.invoke(body: com.google.protobuf.kotlin.UInt32ValueInternal.() -> Unit): com.google.protobuf.kotlin.UInt32Value { val msg = com.google.protobuf.kotlin.UInt32ValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.BoolValue.Companion.invoke(body: com.google.protobuf.kotlin.BoolValueInternal.() -> Unit): com.google.protobuf.kotlin.BoolValue { +public operator fun com.google.protobuf.kotlin.BoolValue.Companion.invoke(body: com.google.protobuf.kotlin.BoolValueInternal.() -> Unit): com.google.protobuf.kotlin.BoolValue { val msg = com.google.protobuf.kotlin.BoolValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.StringValue.Companion.invoke(body: com.google.protobuf.kotlin.StringValueInternal.() -> Unit): com.google.protobuf.kotlin.StringValue { +public operator fun com.google.protobuf.kotlin.StringValue.Companion.invoke(body: com.google.protobuf.kotlin.StringValueInternal.() -> Unit): com.google.protobuf.kotlin.StringValue { val msg = com.google.protobuf.kotlin.StringValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.BytesValue.Companion.invoke(body: com.google.protobuf.kotlin.BytesValueInternal.() -> Unit): com.google.protobuf.kotlin.BytesValue { +public operator fun com.google.protobuf.kotlin.BytesValue.Companion.invoke(body: com.google.protobuf.kotlin.BytesValueInternal.() -> Unit): com.google.protobuf.kotlin.BytesValue { val msg = com.google.protobuf.kotlin.BytesValueInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DoubleValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.DoubleValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DoubleValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != 0.0) { +public fun com.google.protobuf.kotlin.DoubleValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != 0.0) { encoder.writeDouble(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DoubleValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.DoubleValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.DoubleValueInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.DoubleValueInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readDouble() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.DoubleValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.DoubleValueInternal.computeSize(): Int { var __result = 0 - if (value != 0.0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(value)) + if (value != 0.0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.double(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DoubleValue.asInternal(): com.google.protobuf.kotlin.DoubleValueInternal { - return this as? com.google.protobuf.kotlin.DoubleValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.DoubleValue.asInternal(): com.google.protobuf.kotlin.DoubleValueInternal { + return this as? com.google.protobuf.kotlin.DoubleValueInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FloatValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.FloatValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FloatValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != 0.0f) { +public fun com.google.protobuf.kotlin.FloatValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != 0.0f) { encoder.writeFloat(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FloatValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.FloatValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.FloatValueInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.FloatValueInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readFloat() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.FloatValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.FloatValueInternal.computeSize(): Int { var __result = 0 - if (value != 0.0f) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(value)) + if (value != 0.0f) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.float(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FloatValue.asInternal(): com.google.protobuf.kotlin.FloatValueInternal { - return this as? com.google.protobuf.kotlin.FloatValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.FloatValue.asInternal(): com.google.protobuf.kotlin.FloatValueInternal { + return this as? com.google.protobuf.kotlin.FloatValueInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int64ValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.Int64ValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int64ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != 0L) { +public fun com.google.protobuf.kotlin.Int64ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != 0L) { encoder.writeInt64(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int64ValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.Int64ValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.Int64ValueInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.Int64ValueInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readInt64() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.Int64ValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.Int64ValueInternal.computeSize(): Int { var __result = 0 - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int64Value.asInternal(): com.google.protobuf.kotlin.Int64ValueInternal { - return this as? com.google.protobuf.kotlin.Int64ValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Int64Value.asInternal(): com.google.protobuf.kotlin.Int64ValueInternal { + return this as? com.google.protobuf.kotlin.Int64ValueInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt64ValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.UInt64ValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt64ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != 0uL) { +public fun com.google.protobuf.kotlin.UInt64ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != 0uL) { encoder.writeUInt64(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt64ValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.UInt64ValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.UInt64ValueInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.UInt64ValueInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readUInt64() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.UInt64ValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.UInt64ValueInternal.computeSize(): Int { var __result = 0 - if (value != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value)) + if (value != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt64Value.asInternal(): com.google.protobuf.kotlin.UInt64ValueInternal { - return this as? com.google.protobuf.kotlin.UInt64ValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.UInt64Value.asInternal(): com.google.protobuf.kotlin.UInt64ValueInternal { + return this as? com.google.protobuf.kotlin.UInt64ValueInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int32ValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.Int32ValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int32ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != 0) { +public fun com.google.protobuf.kotlin.Int32ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != 0) { encoder.writeInt32(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int32ValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.Int32ValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.Int32ValueInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.Int32ValueInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readInt32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.Int32ValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.Int32ValueInternal.computeSize(): Int { var __result = 0 - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int32Value.asInternal(): com.google.protobuf.kotlin.Int32ValueInternal { - return this as? com.google.protobuf.kotlin.Int32ValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Int32Value.asInternal(): com.google.protobuf.kotlin.Int32ValueInternal { + return this as? com.google.protobuf.kotlin.Int32ValueInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt32ValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.UInt32ValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt32ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != 0u) { +public fun com.google.protobuf.kotlin.UInt32ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != 0u) { encoder.writeUInt32(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt32ValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.UInt32ValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.UInt32ValueInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.UInt32ValueInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readUInt32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.UInt32ValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.UInt32ValueInternal.computeSize(): Int { var __result = 0 - if (value != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value)) + if (value != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt32Value.asInternal(): com.google.protobuf.kotlin.UInt32ValueInternal { - return this as? com.google.protobuf.kotlin.UInt32ValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.UInt32Value.asInternal(): com.google.protobuf.kotlin.UInt32ValueInternal { + return this as? com.google.protobuf.kotlin.UInt32ValueInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BoolValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.BoolValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BoolValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != false) { +public fun com.google.protobuf.kotlin.BoolValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != false) { encoder.writeBool(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BoolValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.BoolValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.BoolValueInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.BoolValueInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readBool() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.BoolValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.BoolValueInternal.computeSize(): Int { var __result = 0 - if (value != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(value)) + if (value != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BoolValue.asInternal(): com.google.protobuf.kotlin.BoolValueInternal { - return this as? com.google.protobuf.kotlin.BoolValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.BoolValue.asInternal(): com.google.protobuf.kotlin.BoolValueInternal { + return this as? com.google.protobuf.kotlin.BoolValueInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StringValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.StringValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StringValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value.isNotEmpty()) { +public fun com.google.protobuf.kotlin.StringValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StringValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.StringValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.StringValueInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.StringValueInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readString() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.StringValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.StringValueInternal.computeSize(): Int { var __result = 0 - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StringValue.asInternal(): com.google.protobuf.kotlin.StringValueInternal { - return this as? com.google.protobuf.kotlin.StringValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.StringValue.asInternal(): com.google.protobuf.kotlin.StringValueInternal { + return this as? com.google.protobuf.kotlin.StringValueInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BytesValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.BytesValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BytesValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value.isNotEmpty()) { +public fun com.google.protobuf.kotlin.BytesValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value.isNotEmpty()) { encoder.writeBytes(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BytesValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.BytesValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +public fun com.google.protobuf.kotlin.BytesValueInternal.Companion.decodeWith( + msg: com.google.protobuf.kotlin.BytesValueInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readBytes() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.kotlin.BytesValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.BytesValueInternal.computeSize(): Int { var __result = 0 - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BytesValue.asInternal(): com.google.protobuf.kotlin.BytesValueInternal { - return this as? com.google.protobuf.kotlin.BytesValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.BytesValue.asInternal(): com.google.protobuf.kotlin.BytesValueInternal { + return this as? com.google.protobuf.kotlin.BytesValueInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/kotlin/kotlinx/rpc/protobuf/internal/WireDecoder.kt b/protobuf/protobuf-core/src/commonMain/kotlin/kotlinx/rpc/protobuf/internal/WireDecoder.kt index 79a3324d9..630c4dd82 100644 --- a/protobuf/protobuf-core/src/commonMain/kotlin/kotlinx/rpc/protobuf/internal/WireDecoder.kt +++ b/protobuf/protobuf-core/src/commonMain/kotlin/kotlinx/rpc/protobuf/internal/WireDecoder.kt @@ -91,16 +91,31 @@ public interface WireDecoder : AutoCloseable { popLimit(limit) } - public fun skipValue(writeType: WireType) { - when (writeType) { + public fun skipValue(tag: KTag) { + when (tag.wireType) { WireType.VARINT -> readInt64() WireType.FIXED32 -> readFixed32() WireType.FIXED64 -> readFixed64() WireType.LENGTH_DELIMITED -> readBytes() - WireType.START_GROUP -> throw ProtobufDecodingException("Unexpected START_GROUP wire type (KRPC-193)") + WireType.START_GROUP -> skipGroup(tag.fieldNr) WireType.END_GROUP -> {} // nothing to do } } + + private fun skipGroup(startField: Int) { + // read until END_GROUP with the same field number + while (true) { + val t = readTag() ?: throw ProtobufDecodingException.truncatedMessage() + if (t.wireType == WireType.END_GROUP) { + if (t.fieldNr != startField) { + throw ProtobufDecodingException("Mismatched END_GROUP: got ${t.fieldNr}, want $startField") + } + return + } + // recursively skip nested values (groups can nest) + skipValue(t) + } + } } /** diff --git a/protobuf/protobuf-core/src/commonMain/kotlin/kotlinx/rpc/protobuf/internal/WireEncoder.kt b/protobuf/protobuf-core/src/commonMain/kotlin/kotlinx/rpc/protobuf/internal/WireEncoder.kt index 856550539..d000fea08 100644 --- a/protobuf/protobuf-core/src/commonMain/kotlin/kotlinx/rpc/protobuf/internal/WireEncoder.kt +++ b/protobuf/protobuf-core/src/commonMain/kotlin/kotlinx/rpc/protobuf/internal/WireEncoder.kt @@ -60,6 +60,12 @@ public interface WireEncoder { encode: T.(WireEncoder) -> Unit, ) + public fun writeGroupMessage( + fieldNr: Int, + value: T, + encode: T.(WireEncoder) -> Unit, + ) + } /** diff --git a/protobuf/protobuf-core/src/commonTest/proto/groups.proto b/protobuf/protobuf-core/src/commonTest/proto/groups.proto new file mode 100644 index 000000000..bd11ac055 --- /dev/null +++ b/protobuf/protobuf-core/src/commonTest/proto/groups.proto @@ -0,0 +1,5 @@ +message WithGroups { + required group FirstGroup = 1 { + required fixed32 value = 2; + } +} \ No newline at end of file diff --git a/protobuf/protobuf-core/src/jvmMain/kotlin/kotlinx/rpc/protobuf/internal/WireEncoder.jvm.kt b/protobuf/protobuf-core/src/jvmMain/kotlin/kotlinx/rpc/protobuf/internal/WireEncoder.jvm.kt index 6054d5668..1bc1e78a9 100644 --- a/protobuf/protobuf-core/src/jvmMain/kotlin/kotlinx/rpc/protobuf/internal/WireEncoder.jvm.kt +++ b/protobuf/protobuf-core/src/jvmMain/kotlin/kotlinx/rpc/protobuf/internal/WireEncoder.jvm.kt @@ -182,6 +182,16 @@ private class WireEncoderJvm(sink: Sink) : WireEncoder { value.encode(this) } + override fun writeGroupMessage( + fieldNr: Int, + value: T, + encode: T.(WireEncoder) -> Unit, + ) { + codedOutputStream.writeTag(fieldNr, WireType.START_GROUP.ordinal) + value.encode(this) + codedOutputStream.writeTag(fieldNr, WireType.END_GROUP.ordinal) + } + private inline fun writePackedInternal( fieldNr: Int, value: List, diff --git a/protobuf/protobuf-core/src/nativeMain/kotlin/kotlinx/rpc/protobuf/internal/WireEncoder.native.kt b/protobuf/protobuf-core/src/nativeMain/kotlin/kotlinx/rpc/protobuf/internal/WireEncoder.native.kt index b8171c74d..2cec9cfff 100644 --- a/protobuf/protobuf-core/src/nativeMain/kotlin/kotlinx/rpc/protobuf/internal/WireEncoder.native.kt +++ b/protobuf/protobuf-core/src/nativeMain/kotlin/kotlinx/rpc/protobuf/internal/WireEncoder.native.kt @@ -4,9 +4,53 @@ package kotlinx.rpc.protobuf.internal -import kotlinx.cinterop.* +import kotlinx.cinterop.ByteVar +import kotlinx.cinterop.CPointer +import kotlinx.cinterop.CValuesRef +import kotlinx.cinterop.ExperimentalForeignApi +import kotlinx.cinterop.StableRef +import kotlinx.cinterop.addressOf +import kotlinx.cinterop.asStableRef +import kotlinx.cinterop.cstr +import kotlinx.cinterop.memScoped +import kotlinx.cinterop.reinterpret +import kotlinx.cinterop.staticCFunction +import kotlinx.cinterop.usePinned import kotlinx.io.Sink -import libprotowire.* +import libprotowire.pw_encoder_delete +import libprotowire.pw_encoder_flush +import libprotowire.pw_encoder_new +import libprotowire.pw_encoder_t +import libprotowire.pw_encoder_write_bool +import libprotowire.pw_encoder_write_bool_no_tag +import libprotowire.pw_encoder_write_bytes +import libprotowire.pw_encoder_write_double +import libprotowire.pw_encoder_write_double_no_tag +import libprotowire.pw_encoder_write_enum +import libprotowire.pw_encoder_write_fixed32 +import libprotowire.pw_encoder_write_fixed32_no_tag +import libprotowire.pw_encoder_write_fixed64 +import libprotowire.pw_encoder_write_fixed64_no_tag +import libprotowire.pw_encoder_write_float +import libprotowire.pw_encoder_write_float_no_tag +import libprotowire.pw_encoder_write_int32 +import libprotowire.pw_encoder_write_int32_no_tag +import libprotowire.pw_encoder_write_int64 +import libprotowire.pw_encoder_write_int64_no_tag +import libprotowire.pw_encoder_write_sfixed32 +import libprotowire.pw_encoder_write_sfixed32_no_tag +import libprotowire.pw_encoder_write_sfixed64 +import libprotowire.pw_encoder_write_sfixed64_no_tag +import libprotowire.pw_encoder_write_sint32 +import libprotowire.pw_encoder_write_sint32_no_tag +import libprotowire.pw_encoder_write_sint64 +import libprotowire.pw_encoder_write_sint64_no_tag +import libprotowire.pw_encoder_write_string +import libprotowire.pw_encoder_write_tag +import libprotowire.pw_encoder_write_uint32 +import libprotowire.pw_encoder_write_uint32_no_tag +import libprotowire.pw_encoder_write_uint64 +import libprotowire.pw_encoder_write_uint64_no_tag import kotlin.experimental.ExperimentalNativeApi import kotlin.native.ref.createCleaner @@ -177,6 +221,12 @@ internal class WireEncoderNative(private val sink: Sink) : WireEncoder { pw_encoder_write_uint32_no_tag(raw, value._size.toUInt()) value.encode(this) } + + override fun writeGroupMessage(fieldNr: Int, value: T, encode: T.(WireEncoder) -> Unit) { + pw_encoder_write_tag(raw, fieldNr, WireType.START_GROUP.ordinal) + value.encode(this) + pw_encoder_write_tag(raw, fieldNr, WireType.END_GROUP.ordinal) + } } public actual fun WireEncoder(sink: Sink): WireEncoder = WireEncoderNative(sink) diff --git a/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/codeRequestToModel.kt b/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/codeRequestToModel.kt index 0cd5a1980..a40b3d191 100644 --- a/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/codeRequestToModel.kt +++ b/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/codeRequestToModel.kt @@ -7,7 +7,16 @@ package kotlinx.rpc.protoc.gen.core import com.google.protobuf.DescriptorProtos import com.google.protobuf.Descriptors import com.google.protobuf.compiler.PluginProtos.CodeGeneratorRequest -import kotlinx.rpc.protoc.gen.core.model.* +import kotlinx.rpc.protoc.gen.core.model.EnumDeclaration +import kotlinx.rpc.protoc.gen.core.model.FieldDeclaration +import kotlinx.rpc.protoc.gen.core.model.FieldType +import kotlinx.rpc.protoc.gen.core.model.FileDeclaration +import kotlinx.rpc.protoc.gen.core.model.FqName +import kotlinx.rpc.protoc.gen.core.model.MessageDeclaration +import kotlinx.rpc.protoc.gen.core.model.MethodDeclaration +import kotlinx.rpc.protoc.gen.core.model.Model +import kotlinx.rpc.protoc.gen.core.model.OneOfDeclaration +import kotlinx.rpc.protoc.gen.core.model.ServiceDeclaration private val nameCache = mutableMapOf() private val modelCache = mutableMapOf() @@ -251,7 +260,7 @@ private fun Descriptors.FieldDescriptor.modelType(): FieldType { Descriptors.FieldDescriptor.Type.SINT64 -> FieldType.IntegralType.SINT64 Descriptors.FieldDescriptor.Type.ENUM -> FieldType.Enum(enumType.toModel()) Descriptors.FieldDescriptor.Type.MESSAGE -> FieldType.Message(lazy { messageType!!.toModel() }) - Descriptors.FieldDescriptor.Type.GROUP -> error("GROUP type is unsupported") + Descriptors.FieldDescriptor.Type.GROUP -> FieldType.Message(lazy { messageType!!.toModel() }) } if (isMapField) { diff --git a/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/FieldType.kt b/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/FieldType.kt index 2992e373c..2b9baf8cc 100644 --- a/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/FieldType.kt +++ b/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/FieldType.kt @@ -52,7 +52,7 @@ sealed interface FieldType { simpleName: String, override val defaultValue: String, override val wireType: WireType, - override val isPackable: Boolean = true + override val isPackable: Boolean = true, ) : FieldType { STRING("String", "\"\"", WireType.LENGTH_DELIMITED, false), BYTES("ByteArray", "byteArrayOf()", WireType.LENGTH_DELIMITED, false), @@ -77,7 +77,7 @@ sealed interface FieldType { fun FieldType.scalarDefaultSuffix(): String = when (this) { FieldType.IntegralType.BOOL -> "" FieldType.IntegralType.FLOAT -> "f" - FieldType.IntegralType.DOUBLE -> "" + FieldType.IntegralType.DOUBLE -> "" FieldType.IntegralType.INT32 -> "" FieldType.IntegralType.INT64 -> "L" FieldType.IntegralType.UINT32 -> "u" diff --git a/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/model.kt b/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/model.kt index 9077791ce..7167ed869 100644 --- a/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/model.kt +++ b/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/model.kt @@ -33,6 +33,13 @@ data class MessageDeclaration( ) { val isMapEntry = dec.options.mapEntry val isUserFacing = !isMapEntry + + val isGroup by lazy { + val parent = dec.containingType ?: return@lazy false // top-level types can’t be groups + parent.fields.any { f -> + f.type == Descriptors.FieldDescriptor.Type.GROUP && f.messageType == dec + } + } } data class EnumDeclaration( @@ -68,7 +75,7 @@ data class EnumDeclaration( data class OneOfDeclaration( val name: FqName, val variants: List, - val dec: Descriptors.OneofDescriptor + val dec: Descriptors.OneofDescriptor, ) data class FieldDeclaration( @@ -78,7 +85,7 @@ data class FieldDeclaration( val dec: Descriptors.FieldDescriptor, // defines the index in the presenceMask of the Message. // this cannot be the number, as only fields with hasPresence == true are part of the presenceMask - val presenceIdx: Int? = null + val presenceIdx: Int? = null, ) { val packedFixedSize = type.wireType == WireType.FIXED64 || type.wireType == WireType.FIXED32 diff --git a/protoc-gen/protobuf/src/main/kotlin/kotlinx/rpc/protoc/gen/ModelToProtobufKotlinCommonGenerator.kt b/protoc-gen/protobuf/src/main/kotlin/kotlinx/rpc/protoc/gen/ModelToProtobufKotlinCommonGenerator.kt index 96c3a9fbc..c439174bf 100644 --- a/protoc-gen/protobuf/src/main/kotlin/kotlinx/rpc/protoc/gen/ModelToProtobufKotlinCommonGenerator.kt +++ b/protoc-gen/protobuf/src/main/kotlin/kotlinx/rpc/protoc/gen/ModelToProtobufKotlinCommonGenerator.kt @@ -72,10 +72,15 @@ class ModelToProtobufKotlinCommonGenerator( private fun CodeGenerator.generatePublicMessage(declaration: MessageDeclaration) { if (!declaration.isUserFacing) return + val annotations = mutableListOf() + if (!declaration.isGroup) { + annotations.add("@$WITH_CODEC_ANNO(${declaration.internalClassFullName()}.CODEC::class)") + } + clazz( name = declaration.name.simpleName, declarationType = CodeGenerator.DeclarationType.Interface, - annotations = listOf("@$WITH_CODEC_ANNO(${declaration.internalClassFullName()}.CODEC::class)") + annotations = annotations ) { declaration.actualFields.forEachIndexed { i, field -> property( @@ -239,6 +244,8 @@ class ModelToProtobufKotlinCommonGenerator( private fun CodeGenerator.generateCodecObject(declaration: MessageDeclaration) { if (!declaration.isUserFacing) return + // the CODEC object is not necessary for groups, as they are inlined messages + if (declaration.isGroup) return val msgFqName = declaration.name.safeFullName() val inputStreamFqName = "kotlinx.rpc.protobuf.input.stream.InputStream" @@ -291,25 +298,42 @@ class ModelToProtobufKotlinCommonGenerator( } } - private fun CodeGenerator.generateMessageDecoder(declaration: MessageDeclaration) = function( - name = "decodeWith", - args = "msg: ${declaration.internalClassFullName()}, decoder: $PB_PKG.WireDecoder", - annotations = listOf("@$INTERNAL_RPC_API_ANNO"), - contextReceiver = "${declaration.internalClassFullName()}.Companion", - returnType = "Unit", - ) { - whileBlock("true") { - code("val tag = decoder.readTag() ?: break // EOF, we read the whole message") - whenBlock { - declaration.actualFields.forEach { field -> readMatchCase(field) } - whenCase("else") { - code("// we are currently just skipping unknown fields (KRPC-191)") - code("decoder.skipValue(tag.wireType)") + private fun CodeGenerator.generateMessageDecoder(declaration: MessageDeclaration) { + var args = "msg: ${declaration.internalClassFullName()}, decoder: $PB_PKG.WireDecoder"; + if (declaration.isGroup) { + args += ", startGroup: $PB_PKG.KTag" + } + + function( + name = "decodeWith", + args = args, + annotations = listOf("@$INTERNAL_RPC_API_ANNO"), + contextReceiver = "${declaration.internalClassFullName()}.Companion", + returnType = "Unit", + ) { + whileBlock("true") { + code("val tag = decoder.readTag() ?: break // EOF, we read the whole message") + + if (declaration.isGroup) { + ifBranch(condition = "tag.wireType == $PB_PKG.WireType.END_GROUP", ifBlock = { + ifBranch(condition = "tag.fieldNr != startGroup.fieldNr", ifBlock = { + code("throw ProtobufDecodingException(\"Wrong end group tag. Expected \${startGroup.fieldNr}, got \${tag.fieldNr}.\")") + }) + code("return") + }) + } + + whenBlock { + declaration.actualFields.forEach { field -> readMatchCase(field) } + whenCase("else") { + code("// we are currently just skipping unknown fields (KRPC-191)") + code("decoder.skipValue(tag)") + } } } - } - // TODO: Make lists and maps immutable (KRPC-190) + // TODO: Make lists and maps immutable (KRPC-190) + } } private fun CodeGenerator.readMatchCase( @@ -374,7 +398,14 @@ class ModelToProtobufKotlinCommonGenerator( } is FieldType.Message -> { - whenCase("tag.fieldNr == ${field.number} && tag.wireType == $PB_PKG.WireType.LENGTH_DELIMITED") { + val msg = fieldType.dec.value + val condition = if (msg.isUserFacing) { + "tag.fieldNr == ${field.number} && tag.wireType == $PB_PKG.WireType.START_GROUP" + } else { + "tag.fieldNr == ${field.number} && tag.wireType == $PB_PKG.WireType.LENGTH_DELIMITED" + } + + whenCase(condition) { if (field.presenceIdx != null) { // check if the current sub message object was already set, if not, set a new one // to set the field's presence tracker to true @@ -448,8 +479,13 @@ class ModelToProtobufKotlinCommonGenerator( } is FieldType.Message -> { - val internalClassName = fieldType.dec.value.internalClassFullName() - code("decoder.readMessage($lvalue.asInternal(), $internalClassName::decodeWith)") + val msg = fieldType.dec.value + val fullClassName = msg.internalClassFullName() + if (msg.isGroup) { + code("$fullClassName.decodeWith($lvalue.asInternal(), decoder, tag)") + } else { + code("decoder.readMessage($lvalue.asInternal(), $fullClassName::decodeWith)") + } } is FieldType.Map -> { @@ -578,7 +614,10 @@ class ModelToProtobufKotlinCommonGenerator( } } - is FieldType.Message -> code("encoder.writeMessage(fieldNr = ${number}, value = $valueVar.asInternal()) { encodeWith(it) }") + is FieldType.Message -> { + val writeMethod = if (type.dec.value.isGroup) "writeGroupMessage" else "writeMessage" + code("encoder.$writeMethod(fieldNr = ${number}, value = $valueVar.asInternal()) { encodeWith(it) }") + } } } @@ -729,14 +768,21 @@ class ModelToProtobufKotlinCommonGenerator( val valueSize by lazy { field.type.valueSizeCall(variable, field.number, field.dec.isPacked) } val tagSize = tagSizeCall(field.number, field.type.wireType) - when (field.type) { + when (val fieldType = field.type) { is FieldType.List -> when { // packed fields also have the tag + len field.dec.isPacked -> code("__result += $valueSize.let { $tagSize + ${int32SizeCall("it")} + it }") else -> code("__result += $valueSize") } - is FieldType.Message, + is FieldType.Message -> if (fieldType.dec.value.isGroup) { + val groupTagSize = tagSizeCall(field.number, WireType.START_GROUP) + // the group message size is the size of the message plus the start and end group tags + code("__result += $valueSize.let { (2 * $groupTagSize) + it }") + } else { + code("__result += $valueSize.let { $tagSize + ${int32SizeCall("it")} + it }") + } + FieldType.IntegralType.STRING, FieldType.IntegralType.BYTES, -> code("__result += $valueSize.let { $tagSize + ${int32SizeCall("it")} + it }") diff --git a/.setup_protoscope.sh b/setup_protocscope.sh old mode 100644 new mode 100755 similarity index 100% rename from .setup_protoscope.sh rename to setup_protocscope.sh diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt index 16a272564..650eab0ba 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt @@ -1,11 +1,23 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) + package com.google.protobuf.conformance -import kotlinx.rpc.internal.utils.* +import kotlinx.rpc.internal.utils.ExperimentalRpcApi import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.* - -class TestStatusInternal: com.google.protobuf.conformance.TestStatus, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +import kotlinx.rpc.protobuf.internal.MsgFieldDelegate +import kotlinx.rpc.protobuf.internal.bool +import kotlinx.rpc.protobuf.internal.bytes +import kotlinx.rpc.protobuf.internal.enum +import kotlinx.rpc.protobuf.internal.int32 +import kotlinx.rpc.protobuf.internal.string +import kotlinx.rpc.protobuf.internal.tag + +class TestStatusInternal : com.google.protobuf.conformance.TestStatus, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -14,21 +26,21 @@ class TestStatusInternal: com.google.protobuf.conformance.TestStatus, kotlinx.rp override var matchedName: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf.conformance.TestStatus): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf.conformance.TestStatus): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.TestStatus { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.TestStatus { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.conformance.TestStatusInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.conformance.TestStatusInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -41,28 +53,29 @@ class TestStatusInternal: com.google.protobuf.conformance.TestStatus, kotlinx.rp companion object } -class FailureSetInternal: com.google.protobuf.conformance.FailureSet, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class FailureSetInternal : com.google.protobuf.conformance.FailureSet, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } override var test: List by MsgFieldDelegate { mutableListOf() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf.conformance.FailureSet): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf.conformance.FailureSet): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.FailureSet { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.FailureSet { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.conformance.FailureSetInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.conformance.FailureSetInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -75,8 +88,9 @@ class FailureSetInternal: com.google.protobuf.conformance.FailureSet, kotlinx.rp companion object } -class ConformanceRequestInternal: com.google.protobuf.conformance.ConformanceRequest, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { +class ConformanceRequestInternal : com.google.protobuf.conformance.ConformanceRequest, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val jspbEncodingOptions: Int = 0 } @@ -86,26 +100,28 @@ class ConformanceRequestInternal: com.google.protobuf.conformance.ConformanceReq override var requestedOutputFormat: com.google.protobuf.conformance.WireFormat by MsgFieldDelegate { com.google.protobuf.conformance.WireFormat.UNSPECIFIED } override var messageType: String by MsgFieldDelegate { "" } override var testCategory: com.google.protobuf.conformance.TestCategory by MsgFieldDelegate { com.google.protobuf.conformance.TestCategory.UNSPECIFIED_TEST } - override var jspbEncodingOptions: com.google.protobuf.conformance.JspbEncodingConfig by MsgFieldDelegate(PresenceIndices.jspbEncodingOptions) { com.google.protobuf.conformance.JspbEncodingConfigInternal() } + override var jspbEncodingOptions: com.google.protobuf.conformance.JspbEncodingConfig by MsgFieldDelegate( + PresenceIndices.jspbEncodingOptions + ) { com.google.protobuf.conformance.JspbEncodingConfigInternal() } override var printUnknownFields: Boolean by MsgFieldDelegate { false } override var payload: com.google.protobuf.conformance.ConformanceRequest.Payload? = null @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf.conformance.ConformanceRequest): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf.conformance.ConformanceRequest): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.ConformanceRequest { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.ConformanceRequest { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.conformance.ConformanceRequestInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.conformance.ConformanceRequestInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -118,28 +134,29 @@ class ConformanceRequestInternal: com.google.protobuf.conformance.ConformanceReq companion object } -class ConformanceResponseInternal: com.google.protobuf.conformance.ConformanceResponse, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class ConformanceResponseInternal : com.google.protobuf.conformance.ConformanceResponse, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } override var result: com.google.protobuf.conformance.ConformanceResponse.Result? = null @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf.conformance.ConformanceResponse): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf.conformance.ConformanceResponse): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.ConformanceResponse { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.ConformanceResponse { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.conformance.ConformanceResponseInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.conformance.ConformanceResponseInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -152,28 +169,29 @@ class ConformanceResponseInternal: com.google.protobuf.conformance.ConformanceRe companion object } -class JspbEncodingConfigInternal: com.google.protobuf.conformance.JspbEncodingConfig, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class JspbEncodingConfigInternal : com.google.protobuf.conformance.JspbEncodingConfig, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } override var useJspbArrayAnyFormat: Boolean by MsgFieldDelegate { false } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf.conformance.JspbEncodingConfig): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf.conformance.JspbEncodingConfig): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.JspbEncodingConfig { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.JspbEncodingConfig { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.conformance.JspbEncodingConfigInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.conformance.JspbEncodingConfigInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -186,198 +204,226 @@ class JspbEncodingConfigInternal: com.google.protobuf.conformance.JspbEncodingCo companion object } -operator fun com.google.protobuf.conformance.TestStatus.Companion.invoke(body: com.google.protobuf.conformance.TestStatusInternal.() -> Unit): com.google.protobuf.conformance.TestStatus { +operator fun com.google.protobuf.conformance.TestStatus.Companion.invoke(body: com.google.protobuf.conformance.TestStatusInternal.() -> Unit): com.google.protobuf.conformance.TestStatus { val msg = com.google.protobuf.conformance.TestStatusInternal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf.conformance.FailureSet.Companion.invoke(body: com.google.protobuf.conformance.FailureSetInternal.() -> Unit): com.google.protobuf.conformance.FailureSet { +operator fun com.google.protobuf.conformance.FailureSet.Companion.invoke(body: com.google.protobuf.conformance.FailureSetInternal.() -> Unit): com.google.protobuf.conformance.FailureSet { val msg = com.google.protobuf.conformance.FailureSetInternal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf.conformance.ConformanceRequest.Companion.invoke(body: com.google.protobuf.conformance.ConformanceRequestInternal.() -> Unit): com.google.protobuf.conformance.ConformanceRequest { +operator fun com.google.protobuf.conformance.ConformanceRequest.Companion.invoke(body: com.google.protobuf.conformance.ConformanceRequestInternal.() -> Unit): com.google.protobuf.conformance.ConformanceRequest { val msg = com.google.protobuf.conformance.ConformanceRequestInternal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf.conformance.ConformanceResponse.Companion.invoke(body: com.google.protobuf.conformance.ConformanceResponseInternal.() -> Unit): com.google.protobuf.conformance.ConformanceResponse { +operator fun com.google.protobuf.conformance.ConformanceResponse.Companion.invoke(body: com.google.protobuf.conformance.ConformanceResponseInternal.() -> Unit): com.google.protobuf.conformance.ConformanceResponse { val msg = com.google.protobuf.conformance.ConformanceResponseInternal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf.conformance.JspbEncodingConfig.Companion.invoke(body: com.google.protobuf.conformance.JspbEncodingConfigInternal.() -> Unit): com.google.protobuf.conformance.JspbEncodingConfig { +operator fun com.google.protobuf.conformance.JspbEncodingConfig.Companion.invoke(body: com.google.protobuf.conformance.JspbEncodingConfigInternal.() -> Unit): com.google.protobuf.conformance.JspbEncodingConfig { val msg = com.google.protobuf.conformance.JspbEncodingConfigInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.TestStatusInternal.checkRequiredFields() { +fun com.google.protobuf.conformance.TestStatusInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.TestStatusInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +fun com.google.protobuf.conformance.TestStatusInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (failureMessage.isNotEmpty()) { + if (failureMessage.isNotEmpty()) { encoder.writeString(fieldNr = 2, value = failureMessage) } - if (matchedName.isNotEmpty()) { + if (matchedName.isNotEmpty()) { encoder.writeString(fieldNr = 3, value = matchedName) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.TestStatusInternal.Companion.decodeWith(msg: com.google.protobuf.conformance.TestStatusInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf.conformance.TestStatusInternal.Companion.decodeWith( + msg: com.google.protobuf.conformance.TestStatusInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.failureMessage = decoder.readString() } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.matchedName = decoder.readString() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.conformance.TestStatusInternal.computeSize(): Int { +private fun com.google.protobuf.conformance.TestStatusInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (failureMessage.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(failureMessage).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (failureMessage.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(failureMessage).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (matchedName.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(matchedName).let { kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (matchedName.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(matchedName).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 3, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.TestStatus.asInternal(): com.google.protobuf.conformance.TestStatusInternal { - return this as? com.google.protobuf.conformance.TestStatusInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf.conformance.TestStatus.asInternal(): com.google.protobuf.conformance.TestStatusInternal { + return this as? com.google.protobuf.conformance.TestStatusInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.FailureSetInternal.checkRequiredFields() { +fun com.google.protobuf.conformance.FailureSetInternal.checkRequiredFields() { // no required fields to check - test.forEach { + test.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.FailureSetInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (test.isNotEmpty()) { - test.forEach { +fun com.google.protobuf.conformance.FailureSetInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (test.isNotEmpty()) { + test.forEach { encoder.writeMessage(fieldNr = 2, value = it.asInternal()) { encodeWith(it) } } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.FailureSetInternal.Companion.decodeWith(msg: com.google.protobuf.conformance.FailureSetInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf.conformance.FailureSetInternal.Companion.decodeWith( + msg: com.google.protobuf.conformance.FailureSetInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.conformance.TestStatusInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.conformance.TestStatusInternal::decodeWith) (msg.test as MutableList).add(elem) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.conformance.FailureSetInternal.computeSize(): Int { +private fun com.google.protobuf.conformance.FailureSetInternal.computeSize(): Int { var __result = 0 - if (test.isNotEmpty()) { - __result += test.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (test.isNotEmpty()) { + __result += test.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.FailureSet.asInternal(): com.google.protobuf.conformance.FailureSetInternal { - return this as? com.google.protobuf.conformance.FailureSetInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf.conformance.FailureSet.asInternal(): com.google.protobuf.conformance.FailureSetInternal { + return this as? com.google.protobuf.conformance.FailureSetInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceRequestInternal.checkRequiredFields() { +fun com.google.protobuf.conformance.ConformanceRequestInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { jspbEncodingOptions.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceRequestInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (requestedOutputFormat != com.google.protobuf.conformance.WireFormat.UNSPECIFIED) { +fun com.google.protobuf.conformance.ConformanceRequestInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (requestedOutputFormat != com.google.protobuf.conformance.WireFormat.UNSPECIFIED) { encoder.writeEnum(fieldNr = 3, value = requestedOutputFormat.number) } - if (messageType.isNotEmpty()) { + if (messageType.isNotEmpty()) { encoder.writeString(fieldNr = 4, value = messageType) } - if (testCategory != com.google.protobuf.conformance.TestCategory.UNSPECIFIED_TEST) { + if (testCategory != com.google.protobuf.conformance.TestCategory.UNSPECIFIED_TEST) { encoder.writeEnum(fieldNr = 5, value = testCategory.number) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 6, value = jspbEncodingOptions.asInternal()) { encodeWith(it) } } - if (printUnknownFields != false) { + if (printUnknownFields != false) { encoder.writeBool(fieldNr = 9, value = printUnknownFields) } - payload?.also { - when (val value = it) { - is com.google.protobuf.conformance.ConformanceRequest.Payload.ProtobufPayload -> { + payload?.also { + when (val value = it) { + is com.google.protobuf.conformance.ConformanceRequest.Payload.ProtobufPayload -> { encoder.writeBytes(fieldNr = 1, value = value.value) } - is com.google.protobuf.conformance.ConformanceRequest.Payload.JsonPayload -> { + is com.google.protobuf.conformance.ConformanceRequest.Payload.JsonPayload -> { encoder.writeString(fieldNr = 2, value = value.value) } - is com.google.protobuf.conformance.ConformanceRequest.Payload.JspbPayload -> { + is com.google.protobuf.conformance.ConformanceRequest.Payload.JspbPayload -> { encoder.writeString(fieldNr = 7, value = value.value) } - is com.google.protobuf.conformance.ConformanceRequest.Payload.TextPayload -> { + is com.google.protobuf.conformance.ConformanceRequest.Payload.TextPayload -> { encoder.writeString(fieldNr = 8, value = value.value) } } @@ -385,96 +431,145 @@ fun com.google.protobuf.conformance.ConformanceRequestInternal.encodeWith(encode } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceRequestInternal.Companion.decodeWith(msg: com.google.protobuf.conformance.ConformanceRequestInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf.conformance.ConformanceRequestInternal.Companion.decodeWith( + msg: com.google.protobuf.conformance.ConformanceRequestInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.requestedOutputFormat = com.google.protobuf.conformance.WireFormat.fromNumber(decoder.readEnum()) } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.messageType = decoder.readString() } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.testCategory = com.google.protobuf.conformance.TestCategory.fromNumber(decoder.readEnum()) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { msg.jspbEncodingOptions = com.google.protobuf.conformance.JspbEncodingConfigInternal() } - decoder.readMessage(msg.jspbEncodingOptions.asInternal(), com.google.protobuf.conformance.JspbEncodingConfigInternal::decodeWith) + decoder.readMessage( + msg.jspbEncodingOptions.asInternal(), + com.google.protobuf.conformance.JspbEncodingConfigInternal::decodeWith + ) } - tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.printUnknownFields = decoder.readBool() } - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.payload = com.google.protobuf.conformance.ConformanceRequest.Payload.ProtobufPayload(decoder.readBytes()) + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.payload = + com.google.protobuf.conformance.ConformanceRequest.Payload.ProtobufPayload(decoder.readBytes()) } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.payload = com.google.protobuf.conformance.ConformanceRequest.Payload.JsonPayload(decoder.readString()) + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.payload = + com.google.protobuf.conformance.ConformanceRequest.Payload.JsonPayload(decoder.readString()) } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.payload = com.google.protobuf.conformance.ConformanceRequest.Payload.JspbPayload(decoder.readString()) + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.payload = + com.google.protobuf.conformance.ConformanceRequest.Payload.JspbPayload(decoder.readString()) } - tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.payload = com.google.protobuf.conformance.ConformanceRequest.Payload.TextPayload(decoder.readString()) + tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.payload = + com.google.protobuf.conformance.ConformanceRequest.Payload.TextPayload(decoder.readString()) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.conformance.ConformanceRequestInternal.computeSize(): Int { +private fun com.google.protobuf.conformance.ConformanceRequestInternal.computeSize(): Int { var __result = 0 - if (requestedOutputFormat != com.google.protobuf.conformance.WireFormat.UNSPECIFIED) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(requestedOutputFormat.number)) + if (requestedOutputFormat != com.google.protobuf.conformance.WireFormat.UNSPECIFIED) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 3, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(requestedOutputFormat.number)) } - if (messageType.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(messageType).let { kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (messageType.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(messageType).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 4, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (testCategory != com.google.protobuf.conformance.TestCategory.UNSPECIFIED_TEST) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(testCategory.number)) + if (testCategory != com.google.protobuf.conformance.TestCategory.UNSPECIFIED_TEST) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 5, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(testCategory.number)) } - if (presenceMask[0]) { - __result += jspbEncodingOptions.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += jspbEncodingOptions.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 6, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (printUnknownFields != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(9, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(printUnknownFields)) + if (printUnknownFields != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 9, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(printUnknownFields)) } - payload?.also { - when (val value = it) { - is com.google.protobuf.conformance.ConformanceRequest.Payload.ProtobufPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + payload?.also { + when (val value = it) { + is com.google.protobuf.conformance.ConformanceRequest.Payload.ProtobufPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf.conformance.ConformanceRequest.Payload.JsonPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf.conformance.ConformanceRequest.Payload.JsonPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf.conformance.ConformanceRequest.Payload.JspbPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf.conformance.ConformanceRequest.Payload.JspbPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 7, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf.conformance.ConformanceRequest.Payload.TextPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(8, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf.conformance.ConformanceRequest.Payload.TextPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 8, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } } } @@ -483,52 +578,53 @@ private fun com.google.protobuf.conformance.ConformanceRequestInternal.computeSi } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceRequest.asInternal(): com.google.protobuf.conformance.ConformanceRequestInternal { - return this as? com.google.protobuf.conformance.ConformanceRequestInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf.conformance.ConformanceRequest.asInternal(): com.google.protobuf.conformance.ConformanceRequestInternal { + return this as? com.google.protobuf.conformance.ConformanceRequestInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceResponseInternal.checkRequiredFields() { +fun com.google.protobuf.conformance.ConformanceResponseInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceResponseInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - result?.also { - when (val value = it) { - is com.google.protobuf.conformance.ConformanceResponse.Result.ParseError -> { +fun com.google.protobuf.conformance.ConformanceResponseInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + result?.also { + when (val value = it) { + is com.google.protobuf.conformance.ConformanceResponse.Result.ParseError -> { encoder.writeString(fieldNr = 1, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.SerializeError -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.SerializeError -> { encoder.writeString(fieldNr = 6, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.TimeoutError -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.TimeoutError -> { encoder.writeString(fieldNr = 9, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.RuntimeError -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.RuntimeError -> { encoder.writeString(fieldNr = 2, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.ProtobufPayload -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.ProtobufPayload -> { encoder.writeBytes(fieldNr = 3, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.JsonPayload -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.JsonPayload -> { encoder.writeString(fieldNr = 4, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.Skipped -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.Skipped -> { encoder.writeString(fieldNr = 5, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.JspbPayload -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.JspbPayload -> { encoder.writeString(fieldNr = 7, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.TextPayload -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.TextPayload -> { encoder.writeString(fieldNr = 8, value = value.value) } } @@ -536,92 +632,147 @@ fun com.google.protobuf.conformance.ConformanceResponseInternal.encodeWith(encod } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceResponseInternal.Companion.decodeWith(msg: com.google.protobuf.conformance.ConformanceResponseInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf.conformance.ConformanceResponseInternal.Companion.decodeWith( + msg: com.google.protobuf.conformance.ConformanceResponseInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.ParseError(decoder.readString()) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.SerializeError(decoder.readString()) + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = + com.google.protobuf.conformance.ConformanceResponse.Result.SerializeError(decoder.readString()) } - tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.TimeoutError(decoder.readString()) + tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = + com.google.protobuf.conformance.ConformanceResponse.Result.TimeoutError(decoder.readString()) } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.RuntimeError(decoder.readString()) + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = + com.google.protobuf.conformance.ConformanceResponse.Result.RuntimeError(decoder.readString()) } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.ProtobufPayload(decoder.readBytes()) + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = + com.google.protobuf.conformance.ConformanceResponse.Result.ProtobufPayload(decoder.readBytes()) } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.JsonPayload(decoder.readString()) + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = + com.google.protobuf.conformance.ConformanceResponse.Result.JsonPayload(decoder.readString()) } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.Skipped(decoder.readString()) } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.JspbPayload(decoder.readString()) + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = + com.google.protobuf.conformance.ConformanceResponse.Result.JspbPayload(decoder.readString()) } - tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.TextPayload(decoder.readString()) + tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = + com.google.protobuf.conformance.ConformanceResponse.Result.TextPayload(decoder.readString()) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.conformance.ConformanceResponseInternal.computeSize(): Int { +private fun com.google.protobuf.conformance.ConformanceResponseInternal.computeSize(): Int { var __result = 0 - result?.also { - when (val value = it) { - is com.google.protobuf.conformance.ConformanceResponse.Result.ParseError -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + result?.also { + when (val value = it) { + is com.google.protobuf.conformance.ConformanceResponse.Result.ParseError -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf.conformance.ConformanceResponse.Result.SerializeError -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf.conformance.ConformanceResponse.Result.SerializeError -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 6, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf.conformance.ConformanceResponse.Result.TimeoutError -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(9, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf.conformance.ConformanceResponse.Result.TimeoutError -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 9, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf.conformance.ConformanceResponse.Result.RuntimeError -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf.conformance.ConformanceResponse.Result.RuntimeError -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf.conformance.ConformanceResponse.Result.ProtobufPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf.conformance.ConformanceResponse.Result.ProtobufPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 3, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf.conformance.ConformanceResponse.Result.JsonPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf.conformance.ConformanceResponse.Result.JsonPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 4, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf.conformance.ConformanceResponse.Result.Skipped -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf.conformance.ConformanceResponse.Result.Skipped -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 5, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf.conformance.ConformanceResponse.Result.JspbPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf.conformance.ConformanceResponse.Result.JspbPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 7, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf.conformance.ConformanceResponse.Result.TextPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(8, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf.conformance.ConformanceResponse.Result.TextPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 8, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } } } @@ -630,110 +781,118 @@ private fun com.google.protobuf.conformance.ConformanceResponseInternal.computeS } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceResponse.asInternal(): com.google.protobuf.conformance.ConformanceResponseInternal { - return this as? com.google.protobuf.conformance.ConformanceResponseInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf.conformance.ConformanceResponse.asInternal(): com.google.protobuf.conformance.ConformanceResponseInternal { + return this as? com.google.protobuf.conformance.ConformanceResponseInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.JspbEncodingConfigInternal.checkRequiredFields() { +fun com.google.protobuf.conformance.JspbEncodingConfigInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.JspbEncodingConfigInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (useJspbArrayAnyFormat != false) { +fun com.google.protobuf.conformance.JspbEncodingConfigInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (useJspbArrayAnyFormat != false) { encoder.writeBool(fieldNr = 1, value = useJspbArrayAnyFormat) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.JspbEncodingConfigInternal.Companion.decodeWith(msg: com.google.protobuf.conformance.JspbEncodingConfigInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf.conformance.JspbEncodingConfigInternal.Companion.decodeWith( + msg: com.google.protobuf.conformance.JspbEncodingConfigInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.useJspbArrayAnyFormat = decoder.readBool() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf.conformance.JspbEncodingConfigInternal.computeSize(): Int { +private fun com.google.protobuf.conformance.JspbEncodingConfigInternal.computeSize(): Int { var __result = 0 - if (useJspbArrayAnyFormat != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(useJspbArrayAnyFormat)) + if (useJspbArrayAnyFormat != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(useJspbArrayAnyFormat)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.JspbEncodingConfig.asInternal(): com.google.protobuf.conformance.JspbEncodingConfigInternal { - return this as? com.google.protobuf.conformance.JspbEncodingConfigInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf.conformance.JspbEncodingConfig.asInternal(): com.google.protobuf.conformance.JspbEncodingConfigInternal { + return this as? com.google.protobuf.conformance.JspbEncodingConfigInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.WireFormat.Companion.fromNumber(number: Int): com.google.protobuf.conformance.WireFormat { - return when (number) { - 0 -> { +fun com.google.protobuf.conformance.WireFormat.Companion.fromNumber(number: Int): com.google.protobuf.conformance.WireFormat { + return when (number) { + 0 -> { com.google.protobuf.conformance.WireFormat.UNSPECIFIED } - 1 -> { + 1 -> { com.google.protobuf.conformance.WireFormat.PROTOBUF } - 2 -> { + 2 -> { com.google.protobuf.conformance.WireFormat.JSON } - 3 -> { + 3 -> { com.google.protobuf.conformance.WireFormat.JSPB } - 4 -> { + 4 -> { com.google.protobuf.conformance.WireFormat.TEXT_FORMAT } - else -> { + else -> { com.google.protobuf.conformance.WireFormat.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.TestCategory.Companion.fromNumber(number: Int): com.google.protobuf.conformance.TestCategory { - return when (number) { - 0 -> { +fun com.google.protobuf.conformance.TestCategory.Companion.fromNumber(number: Int): com.google.protobuf.conformance.TestCategory { + return when (number) { + 0 -> { com.google.protobuf.conformance.TestCategory.UNSPECIFIED_TEST } - 1 -> { + 1 -> { com.google.protobuf.conformance.TestCategory.BINARY_TEST } - 2 -> { + 2 -> { com.google.protobuf.conformance.TestCategory.JSON_TEST } - 3 -> { + 3 -> { com.google.protobuf.conformance.TestCategory.JSON_IGNORE_UNKNOWN_PARSING_TEST } - 4 -> { + 4 -> { com.google.protobuf.conformance.TestCategory.JSPB_TEST } - 5 -> { + 5 -> { com.google.protobuf.conformance.TestCategory.TEXT_FORMAT_TEST } - else -> { + else -> { com.google.protobuf.conformance.TestCategory.UNRECOGNIZED(number) } } diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt index 2ccd5e011..165a477b3 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt @@ -1,13 +1,54 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) + package com.google.protobuf_test_messages.editions.proto3 -import com.google.protobuf.kotlin.* -import kotlinx.rpc.internal.utils.* +import com.google.protobuf.kotlin.asInternal +import com.google.protobuf.kotlin.checkRequiredFields +import com.google.protobuf.kotlin.decodeWith +import com.google.protobuf.kotlin.encodeWith +import com.google.protobuf.kotlin.fromNumber +import kotlinx.rpc.internal.utils.ExperimentalRpcApi import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.* - -class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 18) { - private object PresenceIndices { +import kotlinx.rpc.protobuf.internal.MsgFieldDelegate +import kotlinx.rpc.protobuf.internal.bool +import kotlinx.rpc.protobuf.internal.bytes +import kotlinx.rpc.protobuf.internal.double +import kotlinx.rpc.protobuf.internal.enum +import kotlinx.rpc.protobuf.internal.fixed32 +import kotlinx.rpc.protobuf.internal.fixed64 +import kotlinx.rpc.protobuf.internal.float +import kotlinx.rpc.protobuf.internal.int32 +import kotlinx.rpc.protobuf.internal.int64 +import kotlinx.rpc.protobuf.internal.packedBool +import kotlinx.rpc.protobuf.internal.packedDouble +import kotlinx.rpc.protobuf.internal.packedEnum +import kotlinx.rpc.protobuf.internal.packedFixed32 +import kotlinx.rpc.protobuf.internal.packedFixed64 +import kotlinx.rpc.protobuf.internal.packedFloat +import kotlinx.rpc.protobuf.internal.packedInt32 +import kotlinx.rpc.protobuf.internal.packedInt64 +import kotlinx.rpc.protobuf.internal.packedSFixed32 +import kotlinx.rpc.protobuf.internal.packedSFixed64 +import kotlinx.rpc.protobuf.internal.packedSInt32 +import kotlinx.rpc.protobuf.internal.packedSInt64 +import kotlinx.rpc.protobuf.internal.packedUInt32 +import kotlinx.rpc.protobuf.internal.packedUInt64 +import kotlinx.rpc.protobuf.internal.sFixed32 +import kotlinx.rpc.protobuf.internal.sFixed64 +import kotlinx.rpc.protobuf.internal.sInt32 +import kotlinx.rpc.protobuf.internal.sInt64 +import kotlinx.rpc.protobuf.internal.string +import kotlinx.rpc.protobuf.internal.tag +import kotlinx.rpc.protobuf.internal.uInt32 +import kotlinx.rpc.protobuf.internal.uInt64 + +class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 18) { + private object PresenceIndices { const val optionalNestedMessage: Int = 0 const val optionalForeignMessage: Int = 1 const val recursiveMessage: Int = 2 @@ -46,14 +87,20 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro override var optionalBool: Boolean by MsgFieldDelegate { false } override var optionalString: String by MsgFieldDelegate { "" } override var optionalBytes: ByteArray by MsgFieldDelegate { byteArrayOf() } - override var optionalNestedMessage: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate(PresenceIndices.optionalNestedMessage) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } - override var optionalForeignMessage: com.google.protobuf_test_messages.editions.proto3.ForeignMessage by MsgFieldDelegate(PresenceIndices.optionalForeignMessage) { com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() } + override var optionalNestedMessage: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate( + PresenceIndices.optionalNestedMessage + ) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } + override var optionalForeignMessage: com.google.protobuf_test_messages.editions.proto3.ForeignMessage by MsgFieldDelegate( + PresenceIndices.optionalForeignMessage + ) { com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() } override var optionalNestedEnum: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum by MsgFieldDelegate { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO } override var optionalForeignEnum: com.google.protobuf_test_messages.editions.proto3.ForeignEnum by MsgFieldDelegate { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO } override var optionalAliasedEnum: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum by MsgFieldDelegate { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO } override var optionalStringPiece: String by MsgFieldDelegate { "" } override var optionalCord: String by MsgFieldDelegate { "" } - override var recursiveMessage: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 by MsgFieldDelegate(PresenceIndices.recursiveMessage) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() } + override var recursiveMessage: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 by MsgFieldDelegate( + PresenceIndices.recursiveMessage + ) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() } override var repeatedInt32: List by MsgFieldDelegate { mutableListOf() } override var repeatedInt64: List by MsgFieldDelegate { mutableListOf() } override var repeatedUint32: List by MsgFieldDelegate { mutableListOf() } @@ -174,8 +221,9 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro override var FieldName18__: Int by MsgFieldDelegate { 0 } override var oneofField: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField? = null - class NestedMessageInternal: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + class NestedMessageInternal : com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val corecursive: Int = 0 } @@ -183,25 +231,32 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro override val _size: Int by lazy { computeSize() } override var a: Int by MsgFieldDelegate { 0 } - override var corecursive: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 by MsgFieldDelegate(PresenceIndices.corecursive) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() } + override var corecursive: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 by MsgFieldDelegate( + PresenceIndices.corecursive + ) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : + kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { - val msg = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.decodeWith(msg, it) + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + val msg = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.decodeWith( + msg, + it + ) } msg.checkRequiredFields() return msg @@ -213,7 +268,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapInt32Int32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt32Int32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -224,7 +279,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapInt64Int64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt64Int64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -235,7 +290,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapUint32Uint32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapUint32Uint32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -246,7 +301,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapUint64Uint64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapUint64Uint64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -257,7 +312,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapSint32Sint32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSint32Sint32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -268,7 +323,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapSint64Sint64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSint64Sint64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -279,7 +334,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapFixed32Fixed32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapFixed32Fixed32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -290,7 +345,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapFixed64Fixed64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapFixed64Fixed64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -301,7 +356,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapSfixed32Sfixed32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSfixed32Sfixed32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -312,7 +367,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapSfixed64Sfixed64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSfixed64Sfixed64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -323,7 +378,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapInt32FloatEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt32FloatEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -334,7 +389,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapInt32DoubleEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt32DoubleEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -345,7 +400,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapBoolBoolEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapBoolBoolEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -356,7 +411,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapStringStringEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringStringEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -367,7 +422,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapStringBytesEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringBytesEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -378,8 +433,8 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapStringNestedMessageEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + class MapStringNestedMessageEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val value: Int = 0 } @@ -387,14 +442,16 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro override val _size: Int by lazy { computeSize() } var key: String by MsgFieldDelegate { "" } - var value: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate(PresenceIndices.value) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } + var value: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate( + PresenceIndices.value + ) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } @kotlinx.rpc.internal.utils.InternalRpcApi companion object } - class MapStringForeignMessageEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + class MapStringForeignMessageEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val value: Int = 0 } @@ -408,7 +465,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapStringNestedEnumEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringNestedEnumEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -419,7 +476,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } - class MapStringForeignEnumEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringForeignEnumEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -431,21 +488,22 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : + kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -458,28 +516,30 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.pro companion object } -class ForeignMessageInternal: com.google.protobuf_test_messages.editions.proto3.ForeignMessage, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class ForeignMessageInternal : com.google.protobuf_test_messages.editions.proto3.ForeignMessage, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } override var c: Int by MsgFieldDelegate { 0 } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.editions.proto3.ForeignMessage): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : + kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.editions.proto3.ForeignMessage): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.ForeignMessage { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.ForeignMessage { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -492,26 +552,28 @@ class ForeignMessageInternal: com.google.protobuf_test_messages.editions.proto3. companion object } -class NullHypothesisProto3Internal: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class NullHypothesisProto3Internal : com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : + kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3 { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3 { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -524,26 +586,28 @@ class NullHypothesisProto3Internal: com.google.protobuf_test_messages.editions.p companion object } -class EnumOnlyProto3Internal: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class EnumOnlyProto3Internal : com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : + kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3 { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3 { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -556,1029 +620,1117 @@ class EnumOnlyProto3Internal: com.google.protobuf_test_messages.editions.proto3. companion object } -operator fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 { +operator fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 { val msg = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.editions.proto3.ForeignMessage.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.ForeignMessage { +operator fun com.google.protobuf_test_messages.editions.proto3.ForeignMessage.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.ForeignMessage { val msg = com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3 { +operator fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3 { val msg = com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3 { +operator fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3 { val msg = com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage { - val msg = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal().apply(body) +operator fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage { + val msg = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { optionalNestedMessage.asInternal().checkRequiredFields() } - if (presenceMask[1]) { + if (presenceMask[1]) { optionalForeignMessage.asInternal().checkRequiredFields() } - if (presenceMask[2]) { + if (presenceMask[2]) { recursiveMessage.asInternal().checkRequiredFields() } - if (presenceMask[3]) { + if (presenceMask[3]) { optionalBoolWrapper.asInternal().checkRequiredFields() } - if (presenceMask[4]) { + if (presenceMask[4]) { optionalInt32Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[5]) { + if (presenceMask[5]) { optionalInt64Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[6]) { + if (presenceMask[6]) { optionalUint32Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[7]) { + if (presenceMask[7]) { optionalUint64Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[8]) { + if (presenceMask[8]) { optionalFloatWrapper.asInternal().checkRequiredFields() } - if (presenceMask[9]) { + if (presenceMask[9]) { optionalDoubleWrapper.asInternal().checkRequiredFields() } - if (presenceMask[10]) { + if (presenceMask[10]) { optionalStringWrapper.asInternal().checkRequiredFields() } - if (presenceMask[11]) { + if (presenceMask[11]) { optionalBytesWrapper.asInternal().checkRequiredFields() } - if (presenceMask[12]) { + if (presenceMask[12]) { optionalDuration.asInternal().checkRequiredFields() } - if (presenceMask[13]) { + if (presenceMask[13]) { optionalTimestamp.asInternal().checkRequiredFields() } - if (presenceMask[14]) { + if (presenceMask[14]) { optionalFieldMask.asInternal().checkRequiredFields() } - if (presenceMask[15]) { + if (presenceMask[15]) { optionalStruct.asInternal().checkRequiredFields() } - if (presenceMask[16]) { + if (presenceMask[16]) { optionalAny.asInternal().checkRequiredFields() } - if (presenceMask[17]) { + if (presenceMask[17]) { optionalValue.asInternal().checkRequiredFields() } - oneofField?.also { - when { - it is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { + oneofField?.also { + when { + it is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { it.value.asInternal().checkRequiredFields() } } } - repeatedNestedMessage.forEach { + repeatedNestedMessage.forEach { it.asInternal().checkRequiredFields() } - repeatedForeignMessage.forEach { + repeatedForeignMessage.forEach { it.asInternal().checkRequiredFields() } - repeatedBoolWrapper.forEach { + repeatedBoolWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedInt32Wrapper.forEach { + repeatedInt32Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedInt64Wrapper.forEach { + repeatedInt64Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedUint32Wrapper.forEach { + repeatedUint32Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedUint64Wrapper.forEach { + repeatedUint64Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedFloatWrapper.forEach { + repeatedFloatWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedDoubleWrapper.forEach { + repeatedDoubleWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedStringWrapper.forEach { + repeatedStringWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedBytesWrapper.forEach { + repeatedBytesWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedDuration.forEach { + repeatedDuration.forEach { it.asInternal().checkRequiredFields() } - repeatedTimestamp.forEach { + repeatedTimestamp.forEach { it.asInternal().checkRequiredFields() } - repeatedFieldmask.forEach { + repeatedFieldmask.forEach { it.asInternal().checkRequiredFields() } - repeatedStruct.forEach { + repeatedStruct.forEach { it.asInternal().checkRequiredFields() } - repeatedAny.forEach { + repeatedAny.forEach { it.asInternal().checkRequiredFields() } - repeatedValue.forEach { + repeatedValue.forEach { it.asInternal().checkRequiredFields() } - repeatedListValue.forEach { + repeatedListValue.forEach { it.asInternal().checkRequiredFields() } - mapStringNestedMessage.values.forEach { + mapStringNestedMessage.values.forEach { it.asInternal().checkRequiredFields() } - mapStringForeignMessage.values.forEach { + mapStringForeignMessage.values.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (optionalInt32 != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (optionalInt32 != 0) { encoder.writeInt32(fieldNr = 1, value = optionalInt32) } - if (optionalInt64 != 0L) { + if (optionalInt64 != 0L) { encoder.writeInt64(fieldNr = 2, value = optionalInt64) } - if (optionalUint32 != 0u) { + if (optionalUint32 != 0u) { encoder.writeUInt32(fieldNr = 3, value = optionalUint32) } - if (optionalUint64 != 0uL) { + if (optionalUint64 != 0uL) { encoder.writeUInt64(fieldNr = 4, value = optionalUint64) } - if (optionalSint32 != 0) { + if (optionalSint32 != 0) { encoder.writeSInt32(fieldNr = 5, value = optionalSint32) } - if (optionalSint64 != 0L) { + if (optionalSint64 != 0L) { encoder.writeSInt64(fieldNr = 6, value = optionalSint64) } - if (optionalFixed32 != 0u) { + if (optionalFixed32 != 0u) { encoder.writeFixed32(fieldNr = 7, value = optionalFixed32) } - if (optionalFixed64 != 0uL) { + if (optionalFixed64 != 0uL) { encoder.writeFixed64(fieldNr = 8, value = optionalFixed64) } - if (optionalSfixed32 != 0) { + if (optionalSfixed32 != 0) { encoder.writeSFixed32(fieldNr = 9, value = optionalSfixed32) } - if (optionalSfixed64 != 0L) { + if (optionalSfixed64 != 0L) { encoder.writeSFixed64(fieldNr = 10, value = optionalSfixed64) } - if (optionalFloat != 0.0f) { + if (optionalFloat != 0.0f) { encoder.writeFloat(fieldNr = 11, value = optionalFloat) } - if (optionalDouble != 0.0) { + if (optionalDouble != 0.0) { encoder.writeDouble(fieldNr = 12, value = optionalDouble) } - if (optionalBool != false) { + if (optionalBool != false) { encoder.writeBool(fieldNr = 13, value = optionalBool) } - if (optionalString.isNotEmpty()) { + if (optionalString.isNotEmpty()) { encoder.writeString(fieldNr = 14, value = optionalString) } - if (optionalBytes.isNotEmpty()) { + if (optionalBytes.isNotEmpty()) { encoder.writeBytes(fieldNr = 15, value = optionalBytes) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 18, value = optionalNestedMessage.asInternal()) { encodeWith(it) } } - if (presenceMask[1]) { + if (presenceMask[1]) { encoder.writeMessage(fieldNr = 19, value = optionalForeignMessage.asInternal()) { encodeWith(it) } } - if (optionalNestedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { + if (optionalNestedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { encoder.writeEnum(fieldNr = 21, value = optionalNestedEnum.number) } - if (optionalForeignEnum != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { + if (optionalForeignEnum != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { encoder.writeEnum(fieldNr = 22, value = optionalForeignEnum.number) } - if (optionalAliasedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { + if (optionalAliasedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { encoder.writeEnum(fieldNr = 23, value = optionalAliasedEnum.number) } - if (optionalStringPiece.isNotEmpty()) { + if (optionalStringPiece.isNotEmpty()) { encoder.writeString(fieldNr = 24, value = optionalStringPiece) } - if (optionalCord.isNotEmpty()) { + if (optionalCord.isNotEmpty()) { encoder.writeString(fieldNr = 25, value = optionalCord) } - if (presenceMask[2]) { + if (presenceMask[2]) { encoder.writeMessage(fieldNr = 27, value = recursiveMessage.asInternal()) { encodeWith(it) } } - if (repeatedInt32.isNotEmpty()) { - encoder.writePackedInt32(fieldNr = 31, value = repeatedInt32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32)) + if (repeatedInt32.isNotEmpty()) { + encoder.writePackedInt32( + fieldNr = 31, + value = repeatedInt32, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32) + ) } - if (repeatedInt64.isNotEmpty()) { - encoder.writePackedInt64(fieldNr = 32, value = repeatedInt64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64)) + if (repeatedInt64.isNotEmpty()) { + encoder.writePackedInt64( + fieldNr = 32, + value = repeatedInt64, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64) + ) } - if (repeatedUint32.isNotEmpty()) { - encoder.writePackedUInt32(fieldNr = 33, value = repeatedUint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32)) + if (repeatedUint32.isNotEmpty()) { + encoder.writePackedUInt32( + fieldNr = 33, + value = repeatedUint32, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32) + ) } - if (repeatedUint64.isNotEmpty()) { - encoder.writePackedUInt64(fieldNr = 34, value = repeatedUint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64)) + if (repeatedUint64.isNotEmpty()) { + encoder.writePackedUInt64( + fieldNr = 34, + value = repeatedUint64, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64) + ) } - if (repeatedSint32.isNotEmpty()) { - encoder.writePackedSInt32(fieldNr = 35, value = repeatedSint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32)) + if (repeatedSint32.isNotEmpty()) { + encoder.writePackedSInt32( + fieldNr = 35, + value = repeatedSint32, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32) + ) } - if (repeatedSint64.isNotEmpty()) { - encoder.writePackedSInt64(fieldNr = 36, value = repeatedSint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64)) + if (repeatedSint64.isNotEmpty()) { + encoder.writePackedSInt64( + fieldNr = 36, + value = repeatedSint64, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64) + ) } - if (repeatedFixed32.isNotEmpty()) { + if (repeatedFixed32.isNotEmpty()) { encoder.writePackedFixed32(fieldNr = 37, value = repeatedFixed32) } - if (repeatedFixed64.isNotEmpty()) { + if (repeatedFixed64.isNotEmpty()) { encoder.writePackedFixed64(fieldNr = 38, value = repeatedFixed64) } - if (repeatedSfixed32.isNotEmpty()) { + if (repeatedSfixed32.isNotEmpty()) { encoder.writePackedSFixed32(fieldNr = 39, value = repeatedSfixed32) } - if (repeatedSfixed64.isNotEmpty()) { + if (repeatedSfixed64.isNotEmpty()) { encoder.writePackedSFixed64(fieldNr = 40, value = repeatedSfixed64) } - if (repeatedFloat.isNotEmpty()) { + if (repeatedFloat.isNotEmpty()) { encoder.writePackedFloat(fieldNr = 41, value = repeatedFloat) } - if (repeatedDouble.isNotEmpty()) { + if (repeatedDouble.isNotEmpty()) { encoder.writePackedDouble(fieldNr = 42, value = repeatedDouble) } - if (repeatedBool.isNotEmpty()) { - encoder.writePackedBool(fieldNr = 43, value = repeatedBool, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool)) + if (repeatedBool.isNotEmpty()) { + encoder.writePackedBool( + fieldNr = 43, + value = repeatedBool, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool) + ) } - if (repeatedString.isNotEmpty()) { - repeatedString.forEach { + if (repeatedString.isNotEmpty()) { + repeatedString.forEach { encoder.writeString(44, it) } } - if (repeatedBytes.isNotEmpty()) { - repeatedBytes.forEach { + if (repeatedBytes.isNotEmpty()) { + repeatedBytes.forEach { encoder.writeBytes(45, it) } } - if (repeatedNestedMessage.isNotEmpty()) { - repeatedNestedMessage.forEach { + if (repeatedNestedMessage.isNotEmpty()) { + repeatedNestedMessage.forEach { encoder.writeMessage(fieldNr = 48, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedForeignMessage.isNotEmpty()) { - repeatedForeignMessage.forEach { + if (repeatedForeignMessage.isNotEmpty()) { + repeatedForeignMessage.forEach { encoder.writeMessage(fieldNr = 49, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedNestedEnum.isNotEmpty()) { - encoder.writePackedEnum(fieldNr = 51, value = repeatedNestedEnum.map { it.number }, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number })) + if (repeatedNestedEnum.isNotEmpty()) { + encoder.writePackedEnum( + fieldNr = 51, + value = repeatedNestedEnum.map { it.number }, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number }) + ) } - if (repeatedForeignEnum.isNotEmpty()) { - encoder.writePackedEnum(fieldNr = 52, value = repeatedForeignEnum.map { it.number }, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number })) + if (repeatedForeignEnum.isNotEmpty()) { + encoder.writePackedEnum( + fieldNr = 52, + value = repeatedForeignEnum.map { it.number }, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number }) + ) } - if (repeatedStringPiece.isNotEmpty()) { - repeatedStringPiece.forEach { + if (repeatedStringPiece.isNotEmpty()) { + repeatedStringPiece.forEach { encoder.writeString(54, it) } } - if (repeatedCord.isNotEmpty()) { - repeatedCord.forEach { + if (repeatedCord.isNotEmpty()) { + repeatedCord.forEach { encoder.writeString(55, it) } } - if (packedInt32.isNotEmpty()) { - encoder.writePackedInt32(fieldNr = 75, value = packedInt32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32)) + if (packedInt32.isNotEmpty()) { + encoder.writePackedInt32( + fieldNr = 75, + value = packedInt32, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32) + ) } - if (packedInt64.isNotEmpty()) { - encoder.writePackedInt64(fieldNr = 76, value = packedInt64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64)) + if (packedInt64.isNotEmpty()) { + encoder.writePackedInt64( + fieldNr = 76, + value = packedInt64, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64) + ) } - if (packedUint32.isNotEmpty()) { - encoder.writePackedUInt32(fieldNr = 77, value = packedUint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32)) + if (packedUint32.isNotEmpty()) { + encoder.writePackedUInt32( + fieldNr = 77, + value = packedUint32, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32) + ) } - if (packedUint64.isNotEmpty()) { - encoder.writePackedUInt64(fieldNr = 78, value = packedUint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64)) + if (packedUint64.isNotEmpty()) { + encoder.writePackedUInt64( + fieldNr = 78, + value = packedUint64, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64) + ) } - if (packedSint32.isNotEmpty()) { - encoder.writePackedSInt32(fieldNr = 79, value = packedSint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32)) + if (packedSint32.isNotEmpty()) { + encoder.writePackedSInt32( + fieldNr = 79, + value = packedSint32, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32) + ) } - if (packedSint64.isNotEmpty()) { - encoder.writePackedSInt64(fieldNr = 80, value = packedSint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64)) + if (packedSint64.isNotEmpty()) { + encoder.writePackedSInt64( + fieldNr = 80, + value = packedSint64, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64) + ) } - if (packedFixed32.isNotEmpty()) { + if (packedFixed32.isNotEmpty()) { encoder.writePackedFixed32(fieldNr = 81, value = packedFixed32) } - if (packedFixed64.isNotEmpty()) { + if (packedFixed64.isNotEmpty()) { encoder.writePackedFixed64(fieldNr = 82, value = packedFixed64) } - if (packedSfixed32.isNotEmpty()) { + if (packedSfixed32.isNotEmpty()) { encoder.writePackedSFixed32(fieldNr = 83, value = packedSfixed32) } - if (packedSfixed64.isNotEmpty()) { + if (packedSfixed64.isNotEmpty()) { encoder.writePackedSFixed64(fieldNr = 84, value = packedSfixed64) } - if (packedFloat.isNotEmpty()) { + if (packedFloat.isNotEmpty()) { encoder.writePackedFloat(fieldNr = 85, value = packedFloat) } - if (packedDouble.isNotEmpty()) { + if (packedDouble.isNotEmpty()) { encoder.writePackedDouble(fieldNr = 86, value = packedDouble) } - if (packedBool.isNotEmpty()) { - encoder.writePackedBool(fieldNr = 87, value = packedBool, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool)) + if (packedBool.isNotEmpty()) { + encoder.writePackedBool( + fieldNr = 87, + value = packedBool, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool) + ) } - if (packedNestedEnum.isNotEmpty()) { - encoder.writePackedEnum(fieldNr = 88, value = packedNestedEnum.map { it.number }, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number })) + if (packedNestedEnum.isNotEmpty()) { + encoder.writePackedEnum( + fieldNr = 88, + value = packedNestedEnum.map { it.number }, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number }) + ) } - if (unpackedInt32.isNotEmpty()) { - unpackedInt32.forEach { + if (unpackedInt32.isNotEmpty()) { + unpackedInt32.forEach { encoder.writeInt32(89, it) } } - if (unpackedInt64.isNotEmpty()) { - unpackedInt64.forEach { + if (unpackedInt64.isNotEmpty()) { + unpackedInt64.forEach { encoder.writeInt64(90, it) } } - if (unpackedUint32.isNotEmpty()) { - unpackedUint32.forEach { + if (unpackedUint32.isNotEmpty()) { + unpackedUint32.forEach { encoder.writeUInt32(91, it) } } - if (unpackedUint64.isNotEmpty()) { - unpackedUint64.forEach { + if (unpackedUint64.isNotEmpty()) { + unpackedUint64.forEach { encoder.writeUInt64(92, it) } } - if (unpackedSint32.isNotEmpty()) { - unpackedSint32.forEach { + if (unpackedSint32.isNotEmpty()) { + unpackedSint32.forEach { encoder.writeSInt32(93, it) } } - if (unpackedSint64.isNotEmpty()) { - unpackedSint64.forEach { + if (unpackedSint64.isNotEmpty()) { + unpackedSint64.forEach { encoder.writeSInt64(94, it) } } - if (unpackedFixed32.isNotEmpty()) { - unpackedFixed32.forEach { + if (unpackedFixed32.isNotEmpty()) { + unpackedFixed32.forEach { encoder.writeFixed32(95, it) } } - if (unpackedFixed64.isNotEmpty()) { - unpackedFixed64.forEach { + if (unpackedFixed64.isNotEmpty()) { + unpackedFixed64.forEach { encoder.writeFixed64(96, it) } } - if (unpackedSfixed32.isNotEmpty()) { - unpackedSfixed32.forEach { + if (unpackedSfixed32.isNotEmpty()) { + unpackedSfixed32.forEach { encoder.writeSFixed32(97, it) } } - if (unpackedSfixed64.isNotEmpty()) { - unpackedSfixed64.forEach { + if (unpackedSfixed64.isNotEmpty()) { + unpackedSfixed64.forEach { encoder.writeSFixed64(98, it) } } - if (unpackedFloat.isNotEmpty()) { - unpackedFloat.forEach { + if (unpackedFloat.isNotEmpty()) { + unpackedFloat.forEach { encoder.writeFloat(99, it) } } - if (unpackedDouble.isNotEmpty()) { - unpackedDouble.forEach { + if (unpackedDouble.isNotEmpty()) { + unpackedDouble.forEach { encoder.writeDouble(100, it) } } - if (unpackedBool.isNotEmpty()) { - unpackedBool.forEach { + if (unpackedBool.isNotEmpty()) { + unpackedBool.forEach { encoder.writeBool(101, it) } } - if (unpackedNestedEnum.isNotEmpty()) { - unpackedNestedEnum.forEach { + if (unpackedNestedEnum.isNotEmpty()) { + unpackedNestedEnum.forEach { encoder.writeEnum(102, it.number) } } - if (mapInt32Int32.isNotEmpty()) { + if (mapInt32Int32.isNotEmpty()) { mapInt32Int32.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 56, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 56, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapInt64Int64.isNotEmpty()) { + if (mapInt64Int64.isNotEmpty()) { mapInt64Int64.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 57, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 57, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapUint32Uint32.isNotEmpty()) { + if (mapUint32Uint32.isNotEmpty()) { mapUint32Uint32.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 58, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 58, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapUint64Uint64.isNotEmpty()) { + if (mapUint64Uint64.isNotEmpty()) { mapUint64Uint64.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 59, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 59, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSint32Sint32.isNotEmpty()) { + if (mapSint32Sint32.isNotEmpty()) { mapSint32Sint32.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 60, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 60, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSint64Sint64.isNotEmpty()) { + if (mapSint64Sint64.isNotEmpty()) { mapSint64Sint64.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 61, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 61, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapFixed32Fixed32.isNotEmpty()) { + if (mapFixed32Fixed32.isNotEmpty()) { mapFixed32Fixed32.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 62, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 62, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapFixed64Fixed64.isNotEmpty()) { + if (mapFixed64Fixed64.isNotEmpty()) { mapFixed64Fixed64.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 63, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 63, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSfixed32Sfixed32.isNotEmpty()) { + if (mapSfixed32Sfixed32.isNotEmpty()) { mapSfixed32Sfixed32.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 64, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 64, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSfixed64Sfixed64.isNotEmpty()) { + if (mapSfixed64Sfixed64.isNotEmpty()) { mapSfixed64Sfixed64.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 65, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 65, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapInt32Float.isNotEmpty()) { + if (mapInt32Float.isNotEmpty()) { mapInt32Float.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 66, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 66, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapInt32Double.isNotEmpty()) { + if (mapInt32Double.isNotEmpty()) { mapInt32Double.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 67, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 67, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapBoolBool.isNotEmpty()) { + if (mapBoolBool.isNotEmpty()) { mapBoolBool.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 68, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 68, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringString.isNotEmpty()) { + if (mapStringString.isNotEmpty()) { mapStringString.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 69, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 69, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringBytes.isNotEmpty()) { + if (mapStringBytes.isNotEmpty()) { mapStringBytes.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 70, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 70, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringNestedMessage.isNotEmpty()) { + if (mapStringNestedMessage.isNotEmpty()) { mapStringNestedMessage.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 71, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 71, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringForeignMessage.isNotEmpty()) { + if (mapStringForeignMessage.isNotEmpty()) { mapStringForeignMessage.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 72, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 72, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringNestedEnum.isNotEmpty()) { + if (mapStringNestedEnum.isNotEmpty()) { mapStringNestedEnum.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 73, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 73, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringForeignEnum.isNotEmpty()) { + if (mapStringForeignEnum.isNotEmpty()) { mapStringForeignEnum.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 74, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 74, value = entry.asInternal()) { encodeWith(it) } + } } } - if (presenceMask[3]) { + if (presenceMask[3]) { encoder.writeMessage(fieldNr = 201, value = optionalBoolWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[4]) { + if (presenceMask[4]) { encoder.writeMessage(fieldNr = 202, value = optionalInt32Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[5]) { + if (presenceMask[5]) { encoder.writeMessage(fieldNr = 203, value = optionalInt64Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[6]) { + if (presenceMask[6]) { encoder.writeMessage(fieldNr = 204, value = optionalUint32Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[7]) { + if (presenceMask[7]) { encoder.writeMessage(fieldNr = 205, value = optionalUint64Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[8]) { + if (presenceMask[8]) { encoder.writeMessage(fieldNr = 206, value = optionalFloatWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[9]) { + if (presenceMask[9]) { encoder.writeMessage(fieldNr = 207, value = optionalDoubleWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[10]) { + if (presenceMask[10]) { encoder.writeMessage(fieldNr = 208, value = optionalStringWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[11]) { + if (presenceMask[11]) { encoder.writeMessage(fieldNr = 209, value = optionalBytesWrapper.asInternal()) { encodeWith(it) } } - if (repeatedBoolWrapper.isNotEmpty()) { - repeatedBoolWrapper.forEach { + if (repeatedBoolWrapper.isNotEmpty()) { + repeatedBoolWrapper.forEach { encoder.writeMessage(fieldNr = 211, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedInt32Wrapper.isNotEmpty()) { - repeatedInt32Wrapper.forEach { + if (repeatedInt32Wrapper.isNotEmpty()) { + repeatedInt32Wrapper.forEach { encoder.writeMessage(fieldNr = 212, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedInt64Wrapper.isNotEmpty()) { - repeatedInt64Wrapper.forEach { + if (repeatedInt64Wrapper.isNotEmpty()) { + repeatedInt64Wrapper.forEach { encoder.writeMessage(fieldNr = 213, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedUint32Wrapper.isNotEmpty()) { - repeatedUint32Wrapper.forEach { + if (repeatedUint32Wrapper.isNotEmpty()) { + repeatedUint32Wrapper.forEach { encoder.writeMessage(fieldNr = 214, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedUint64Wrapper.isNotEmpty()) { - repeatedUint64Wrapper.forEach { + if (repeatedUint64Wrapper.isNotEmpty()) { + repeatedUint64Wrapper.forEach { encoder.writeMessage(fieldNr = 215, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedFloatWrapper.isNotEmpty()) { - repeatedFloatWrapper.forEach { + if (repeatedFloatWrapper.isNotEmpty()) { + repeatedFloatWrapper.forEach { encoder.writeMessage(fieldNr = 216, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedDoubleWrapper.isNotEmpty()) { - repeatedDoubleWrapper.forEach { + if (repeatedDoubleWrapper.isNotEmpty()) { + repeatedDoubleWrapper.forEach { encoder.writeMessage(fieldNr = 217, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedStringWrapper.isNotEmpty()) { - repeatedStringWrapper.forEach { + if (repeatedStringWrapper.isNotEmpty()) { + repeatedStringWrapper.forEach { encoder.writeMessage(fieldNr = 218, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedBytesWrapper.isNotEmpty()) { - repeatedBytesWrapper.forEach { + if (repeatedBytesWrapper.isNotEmpty()) { + repeatedBytesWrapper.forEach { encoder.writeMessage(fieldNr = 219, value = it.asInternal()) { encodeWith(it) } } } - if (presenceMask[12]) { + if (presenceMask[12]) { encoder.writeMessage(fieldNr = 301, value = optionalDuration.asInternal()) { encodeWith(it) } } - if (presenceMask[13]) { + if (presenceMask[13]) { encoder.writeMessage(fieldNr = 302, value = optionalTimestamp.asInternal()) { encodeWith(it) } } - if (presenceMask[14]) { + if (presenceMask[14]) { encoder.writeMessage(fieldNr = 303, value = optionalFieldMask.asInternal()) { encodeWith(it) } } - if (presenceMask[15]) { + if (presenceMask[15]) { encoder.writeMessage(fieldNr = 304, value = optionalStruct.asInternal()) { encodeWith(it) } } - if (presenceMask[16]) { + if (presenceMask[16]) { encoder.writeMessage(fieldNr = 305, value = optionalAny.asInternal()) { encodeWith(it) } } - if (presenceMask[17]) { + if (presenceMask[17]) { encoder.writeMessage(fieldNr = 306, value = optionalValue.asInternal()) { encodeWith(it) } } - if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { + if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { encoder.writeEnum(fieldNr = 307, value = optionalNullValue.number) } - if (repeatedDuration.isNotEmpty()) { - repeatedDuration.forEach { + if (repeatedDuration.isNotEmpty()) { + repeatedDuration.forEach { encoder.writeMessage(fieldNr = 311, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedTimestamp.isNotEmpty()) { - repeatedTimestamp.forEach { + if (repeatedTimestamp.isNotEmpty()) { + repeatedTimestamp.forEach { encoder.writeMessage(fieldNr = 312, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedFieldmask.isNotEmpty()) { - repeatedFieldmask.forEach { + if (repeatedFieldmask.isNotEmpty()) { + repeatedFieldmask.forEach { encoder.writeMessage(fieldNr = 313, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedStruct.isNotEmpty()) { - repeatedStruct.forEach { + if (repeatedStruct.isNotEmpty()) { + repeatedStruct.forEach { encoder.writeMessage(fieldNr = 324, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedAny.isNotEmpty()) { - repeatedAny.forEach { + if (repeatedAny.isNotEmpty()) { + repeatedAny.forEach { encoder.writeMessage(fieldNr = 315, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedValue.isNotEmpty()) { - repeatedValue.forEach { + if (repeatedValue.isNotEmpty()) { + repeatedValue.forEach { encoder.writeMessage(fieldNr = 316, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedListValue.isNotEmpty()) { - repeatedListValue.forEach { + if (repeatedListValue.isNotEmpty()) { + repeatedListValue.forEach { encoder.writeMessage(fieldNr = 317, value = it.asInternal()) { encodeWith(it) } } } - if (fieldname1 != 0) { + if (fieldname1 != 0) { encoder.writeInt32(fieldNr = 401, value = fieldname1) } - if (fieldName2 != 0) { + if (fieldName2 != 0) { encoder.writeInt32(fieldNr = 402, value = fieldName2) } - if (FieldName3 != 0) { + if (FieldName3 != 0) { encoder.writeInt32(fieldNr = 403, value = FieldName3) } - if (field_Name4_ != 0) { + if (field_Name4_ != 0) { encoder.writeInt32(fieldNr = 404, value = field_Name4_) } - if (field0name5 != 0) { + if (field0name5 != 0) { encoder.writeInt32(fieldNr = 405, value = field0name5) } - if (field_0Name6 != 0) { + if (field_0Name6 != 0) { encoder.writeInt32(fieldNr = 406, value = field_0Name6) } - if (fieldName7 != 0) { + if (fieldName7 != 0) { encoder.writeInt32(fieldNr = 407, value = fieldName7) } - if (FieldName8 != 0) { + if (FieldName8 != 0) { encoder.writeInt32(fieldNr = 408, value = FieldName8) } - if (field_Name9 != 0) { + if (field_Name9 != 0) { encoder.writeInt32(fieldNr = 409, value = field_Name9) } - if (Field_Name10 != 0) { + if (Field_Name10 != 0) { encoder.writeInt32(fieldNr = 410, value = Field_Name10) } - if (FIELD_NAME11 != 0) { + if (FIELD_NAME11 != 0) { encoder.writeInt32(fieldNr = 411, value = FIELD_NAME11) } - if (FIELDName12 != 0) { + if (FIELDName12 != 0) { encoder.writeInt32(fieldNr = 412, value = FIELDName12) } - if (_FieldName13 != 0) { + if (_FieldName13 != 0) { encoder.writeInt32(fieldNr = 413, value = _FieldName13) } - if (__FieldName14 != 0) { + if (__FieldName14 != 0) { encoder.writeInt32(fieldNr = 414, value = __FieldName14) } - if (field_Name15 != 0) { + if (field_Name15 != 0) { encoder.writeInt32(fieldNr = 415, value = field_Name15) } - if (field__Name16 != 0) { + if (field__Name16 != 0) { encoder.writeInt32(fieldNr = 416, value = field__Name16) } - if (fieldName17__ != 0) { + if (fieldName17__ != 0) { encoder.writeInt32(fieldNr = 417, value = fieldName17__) } - if (FieldName18__ != 0) { + if (FieldName18__ != 0) { encoder.writeInt32(fieldNr = 418, value = FieldName18__) } - oneofField?.also { - when (val value = it) { - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { + oneofField?.also { + when (val value = it) { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { encoder.writeUInt32(fieldNr = 111, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { encoder.writeMessage(fieldNr = 112, value = value.value.asInternal()) { encodeWith(it) } } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofString -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofString -> { encoder.writeString(fieldNr = 113, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { encoder.writeBytes(fieldNr = 114, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBool -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBool -> { encoder.writeBool(fieldNr = 115, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { encoder.writeUInt64(fieldNr = 116, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { encoder.writeFloat(fieldNr = 117, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { encoder.writeDouble(fieldNr = 118, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { encoder.writeEnum(fieldNr = 119, value = value.value.number) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { encoder.writeEnum(fieldNr = 120, value = value.value.number) } } @@ -1586,1730 +1738,2478 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalInt32 = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalInt64 = decoder.readInt64() } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalUint32 = decoder.readUInt32() } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalUint64 = decoder.readUInt64() } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalSint32 = decoder.readSInt32() } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalSint64 = decoder.readSInt64() } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.optionalFixed32 = decoder.readFixed32() } - tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.optionalFixed64 = decoder.readFixed64() } - tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.optionalSfixed32 = decoder.readSFixed32() } - tag.fieldNr == 10 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 10 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.optionalSfixed64 = decoder.readSFixed64() } - tag.fieldNr == 11 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 11 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.optionalFloat = decoder.readFloat() } - tag.fieldNr == 12 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 12 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.optionalDouble = decoder.readDouble() } - tag.fieldNr == 13 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 13 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalBool = decoder.readBool() } - tag.fieldNr == 14 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 14 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalString = decoder.readString() } - tag.fieldNr == 15 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 15 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalBytes = decoder.readBytes() } - tag.fieldNr == 18 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { - msg.optionalNestedMessage = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + tag.fieldNr == 18 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { + msg.optionalNestedMessage = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } - decoder.readMessage(msg.optionalNestedMessage.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) + decoder.readMessage( + msg.optionalNestedMessage.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith + ) } - tag.fieldNr == 19 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[1]) { - msg.optionalForeignMessage = com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() + tag.fieldNr == 19 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[1]) { + msg.optionalForeignMessage = + com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() } - decoder.readMessage(msg.optionalForeignMessage.asInternal(), com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal::decodeWith) + decoder.readMessage( + msg.optionalForeignMessage.asInternal(), + com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal::decodeWith + ) } - tag.fieldNr == 21 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.optionalNestedEnum = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 21 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.optionalNestedEnum = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) } - tag.fieldNr == 22 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.optionalForeignEnum = com.google.protobuf_test_messages.editions.proto3.ForeignEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 22 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.optionalForeignEnum = + com.google.protobuf_test_messages.editions.proto3.ForeignEnum.fromNumber(decoder.readEnum()) } - tag.fieldNr == 23 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.optionalAliasedEnum = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 23 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.optionalAliasedEnum = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.fromNumber(decoder.readEnum()) } - tag.fieldNr == 24 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 24 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalStringPiece = decoder.readString() } - tag.fieldNr == 25 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 25 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalCord = decoder.readString() } - tag.fieldNr == 27 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[2]) { - msg.recursiveMessage = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() + tag.fieldNr == 27 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[2]) { + msg.recursiveMessage = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() } - decoder.readMessage(msg.recursiveMessage.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal::decodeWith) + decoder.readMessage( + msg.recursiveMessage.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal::decodeWith + ) } - tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedInt32 += decoder.readPackedInt32() } - tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt32() (msg.repeatedInt32 as MutableList).add(elem) } - tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedInt64 += decoder.readPackedInt64() } - tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt64() (msg.repeatedInt64 as MutableList).add(elem) } - tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedUint32 += decoder.readPackedUInt32() } - tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt32() (msg.repeatedUint32 as MutableList).add(elem) } - tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedUint64 += decoder.readPackedUInt64() } - tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt64() (msg.repeatedUint64 as MutableList).add(elem) } - tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSint32 += decoder.readPackedSInt32() } - tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt32() (msg.repeatedSint32 as MutableList).add(elem) } - tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSint64 += decoder.readPackedSInt64() } - tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt64() (msg.repeatedSint64 as MutableList).add(elem) } - tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedFixed32 += decoder.readPackedFixed32() } - tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFixed32() (msg.repeatedFixed32 as MutableList).add(elem) } - tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedFixed64 += decoder.readPackedFixed64() } - tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readFixed64() (msg.repeatedFixed64 as MutableList).add(elem) } - tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSfixed32 += decoder.readPackedSFixed32() } - tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readSFixed32() (msg.repeatedSfixed32 as MutableList).add(elem) } - tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSfixed64 += decoder.readPackedSFixed64() } - tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readSFixed64() (msg.repeatedSfixed64 as MutableList).add(elem) } - tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedFloat += decoder.readPackedFloat() } - tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFloat() (msg.repeatedFloat as MutableList).add(elem) } - tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedDouble += decoder.readPackedDouble() } - tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readDouble() (msg.repeatedDouble as MutableList).add(elem) } - tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedBool += decoder.readPackedBool() } - tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readBool() (msg.repeatedBool as MutableList).add(elem) } - tag.fieldNr == 44 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 44 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.repeatedString as MutableList).add(elem) } - tag.fieldNr == 45 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 45 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readBytes() (msg.repeatedBytes as MutableList).add(elem) } - tag.fieldNr == 48 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - val elem = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() - decoder.readMessage(elem.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) + tag.fieldNr == 48 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + val elem = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + decoder.readMessage( + elem.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith + ) (msg.repeatedNestedMessage as MutableList).add(elem) } - tag.fieldNr == 49 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 49 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() - decoder.readMessage(elem.asInternal(), com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal::decodeWith) + decoder.readMessage( + elem.asInternal(), + com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal::decodeWith + ) (msg.repeatedForeignMessage as MutableList).add(elem) } - tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.repeatedNestedEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } + tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.repeatedNestedEnum += decoder.readPackedEnum() + .map { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } } - tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - val elem = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + val elem = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) (msg.repeatedNestedEnum as MutableList).add(elem) } - tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.repeatedForeignEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.fromNumber(it) } + tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.repeatedForeignEnum += decoder.readPackedEnum() + .map { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.fromNumber(it) } } - tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = com.google.protobuf_test_messages.editions.proto3.ForeignEnum.fromNumber(decoder.readEnum()) (msg.repeatedForeignEnum as MutableList).add(elem) } - tag.fieldNr == 54 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 54 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.repeatedStringPiece as MutableList).add(elem) } - tag.fieldNr == 55 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 55 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.repeatedCord as MutableList).add(elem) } - tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedInt32 += decoder.readPackedInt32() } - tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt32() (msg.packedInt32 as MutableList).add(elem) } - tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedInt64 += decoder.readPackedInt64() } - tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt64() (msg.packedInt64 as MutableList).add(elem) } - tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedUint32 += decoder.readPackedUInt32() } - tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt32() (msg.packedUint32 as MutableList).add(elem) } - tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedUint64 += decoder.readPackedUInt64() } - tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt64() (msg.packedUint64 as MutableList).add(elem) } - tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSint32 += decoder.readPackedSInt32() } - tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt32() (msg.packedSint32 as MutableList).add(elem) } - tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSint64 += decoder.readPackedSInt64() } - tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt64() (msg.packedSint64 as MutableList).add(elem) } - tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedFixed32 += decoder.readPackedFixed32() } - tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFixed32() (msg.packedFixed32 as MutableList).add(elem) } - tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedFixed64 += decoder.readPackedFixed64() } - tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readFixed64() (msg.packedFixed64 as MutableList).add(elem) } - tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSfixed32 += decoder.readPackedSFixed32() } - tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readSFixed32() (msg.packedSfixed32 as MutableList).add(elem) } - tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSfixed64 += decoder.readPackedSFixed64() } - tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readSFixed64() (msg.packedSfixed64 as MutableList).add(elem) } - tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedFloat += decoder.readPackedFloat() } - tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFloat() (msg.packedFloat as MutableList).add(elem) } - tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedDouble += decoder.readPackedDouble() } - tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readDouble() (msg.packedDouble as MutableList).add(elem) } - tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedBool += decoder.readPackedBool() } - tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readBool() (msg.packedBool as MutableList).add(elem) } - tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.packedNestedEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } + tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.packedNestedEnum += decoder.readPackedEnum() + .map { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } } - tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - val elem = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + val elem = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) (msg.packedNestedEnum as MutableList).add(elem) } - tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedInt32 += decoder.readPackedInt32() } - tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt32() (msg.unpackedInt32 as MutableList).add(elem) } - tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedInt64 += decoder.readPackedInt64() } - tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt64() (msg.unpackedInt64 as MutableList).add(elem) } - tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedUint32 += decoder.readPackedUInt32() } - tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt32() (msg.unpackedUint32 as MutableList).add(elem) } - tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedUint64 += decoder.readPackedUInt64() } - tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt64() (msg.unpackedUint64 as MutableList).add(elem) } - tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSint32 += decoder.readPackedSInt32() } - tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt32() (msg.unpackedSint32 as MutableList).add(elem) } - tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSint64 += decoder.readPackedSInt64() } - tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt64() (msg.unpackedSint64 as MutableList).add(elem) } - tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedFixed32 += decoder.readPackedFixed32() } - tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFixed32() (msg.unpackedFixed32 as MutableList).add(elem) } - tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedFixed64 += decoder.readPackedFixed64() } - tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readFixed64() (msg.unpackedFixed64 as MutableList).add(elem) } - tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSfixed32 += decoder.readPackedSFixed32() } - tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readSFixed32() (msg.unpackedSfixed32 as MutableList).add(elem) } - tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSfixed64 += decoder.readPackedSFixed64() } - tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readSFixed64() (msg.unpackedSfixed64 as MutableList).add(elem) } - tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedFloat += decoder.readPackedFloat() } - tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFloat() (msg.unpackedFloat as MutableList).add(elem) } - tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedDouble += decoder.readPackedDouble() } - tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readDouble() (msg.unpackedDouble as MutableList).add(elem) } - tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedBool += decoder.readPackedBool() } - tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readBool() (msg.unpackedBool as MutableList).add(elem) } - tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.unpackedNestedEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } + tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.unpackedNestedEnum += decoder.readPackedEnum() + .map { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } } - tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - val elem = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + val elem = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) (msg.unpackedNestedEnum as MutableList).add(elem) } - tag.fieldNr == 56 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal::decodeWith) + tag.fieldNr == 56 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal::decodeWith + ) (msg.mapInt32Int32 as MutableMap)[key] = value } } - tag.fieldNr == 57 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal::decodeWith) + tag.fieldNr == 57 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal::decodeWith + ) (msg.mapInt64Int64 as MutableMap)[key] = value } } - tag.fieldNr == 58 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal::decodeWith) + tag.fieldNr == 58 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal::decodeWith + ) (msg.mapUint32Uint32 as MutableMap)[key] = value } } - tag.fieldNr == 59 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal::decodeWith) + tag.fieldNr == 59 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal::decodeWith + ) (msg.mapUint64Uint64 as MutableMap)[key] = value } } - tag.fieldNr == 60 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal::decodeWith) + tag.fieldNr == 60 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal::decodeWith + ) (msg.mapSint32Sint32 as MutableMap)[key] = value } } - tag.fieldNr == 61 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal::decodeWith) + tag.fieldNr == 61 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal::decodeWith + ) (msg.mapSint64Sint64 as MutableMap)[key] = value } } - tag.fieldNr == 62 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal::decodeWith) + tag.fieldNr == 62 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal::decodeWith + ) (msg.mapFixed32Fixed32 as MutableMap)[key] = value } } - tag.fieldNr == 63 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal::decodeWith) + tag.fieldNr == 63 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal::decodeWith + ) (msg.mapFixed64Fixed64 as MutableMap)[key] = value } } - tag.fieldNr == 64 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal::decodeWith) + tag.fieldNr == 64 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal::decodeWith + ) (msg.mapSfixed32Sfixed32 as MutableMap)[key] = value } } - tag.fieldNr == 65 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal::decodeWith) + tag.fieldNr == 65 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal::decodeWith + ) (msg.mapSfixed64Sfixed64 as MutableMap)[key] = value } } - tag.fieldNr == 66 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal::decodeWith) + tag.fieldNr == 66 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal::decodeWith + ) (msg.mapInt32Float as MutableMap)[key] = value } } - tag.fieldNr == 67 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal::decodeWith) + tag.fieldNr == 67 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal::decodeWith + ) (msg.mapInt32Double as MutableMap)[key] = value } } - tag.fieldNr == 68 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal::decodeWith) + tag.fieldNr == 68 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal::decodeWith + ) (msg.mapBoolBool as MutableMap)[key] = value } } - tag.fieldNr == 69 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal::decodeWith) + tag.fieldNr == 69 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal::decodeWith + ) (msg.mapStringString as MutableMap)[key] = value } } - tag.fieldNr == 70 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal::decodeWith) + tag.fieldNr == 70 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal::decodeWith + ) (msg.mapStringBytes as MutableMap)[key] = value } } - tag.fieldNr == 71 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal::decodeWith) + tag.fieldNr == 71 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal::decodeWith + ) (msg.mapStringNestedMessage as MutableMap)[key] = value } } - tag.fieldNr == 72 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal::decodeWith) + tag.fieldNr == 72 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal::decodeWith + ) (msg.mapStringForeignMessage as MutableMap)[key] = value } } - tag.fieldNr == 73 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal::decodeWith) + tag.fieldNr == 73 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal::decodeWith + ) (msg.mapStringNestedEnum as MutableMap)[key] = value } } - tag.fieldNr == 74 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal::decodeWith) + tag.fieldNr == 74 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal::decodeWith + ) (msg.mapStringForeignEnum as MutableMap)[key] = value } } - tag.fieldNr == 201 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[3]) { + tag.fieldNr == 201 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[3]) { msg.optionalBoolWrapper = com.google.protobuf.kotlin.BoolValueInternal() } - decoder.readMessage(msg.optionalBoolWrapper.asInternal(), com.google.protobuf.kotlin.BoolValueInternal::decodeWith) + decoder.readMessage( + msg.optionalBoolWrapper.asInternal(), + com.google.protobuf.kotlin.BoolValueInternal::decodeWith + ) } - tag.fieldNr == 202 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[4]) { + tag.fieldNr == 202 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[4]) { msg.optionalInt32Wrapper = com.google.protobuf.kotlin.Int32ValueInternal() } - decoder.readMessage(msg.optionalInt32Wrapper.asInternal(), com.google.protobuf.kotlin.Int32ValueInternal::decodeWith) + decoder.readMessage( + msg.optionalInt32Wrapper.asInternal(), + com.google.protobuf.kotlin.Int32ValueInternal::decodeWith + ) } - tag.fieldNr == 203 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[5]) { + tag.fieldNr == 203 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[5]) { msg.optionalInt64Wrapper = com.google.protobuf.kotlin.Int64ValueInternal() } - decoder.readMessage(msg.optionalInt64Wrapper.asInternal(), com.google.protobuf.kotlin.Int64ValueInternal::decodeWith) + decoder.readMessage( + msg.optionalInt64Wrapper.asInternal(), + com.google.protobuf.kotlin.Int64ValueInternal::decodeWith + ) } - tag.fieldNr == 204 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[6]) { + tag.fieldNr == 204 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[6]) { msg.optionalUint32Wrapper = com.google.protobuf.kotlin.UInt32ValueInternal() } - decoder.readMessage(msg.optionalUint32Wrapper.asInternal(), com.google.protobuf.kotlin.UInt32ValueInternal::decodeWith) + decoder.readMessage( + msg.optionalUint32Wrapper.asInternal(), + com.google.protobuf.kotlin.UInt32ValueInternal::decodeWith + ) } - tag.fieldNr == 205 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[7]) { + tag.fieldNr == 205 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[7]) { msg.optionalUint64Wrapper = com.google.protobuf.kotlin.UInt64ValueInternal() } - decoder.readMessage(msg.optionalUint64Wrapper.asInternal(), com.google.protobuf.kotlin.UInt64ValueInternal::decodeWith) + decoder.readMessage( + msg.optionalUint64Wrapper.asInternal(), + com.google.protobuf.kotlin.UInt64ValueInternal::decodeWith + ) } - tag.fieldNr == 206 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[8]) { + tag.fieldNr == 206 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[8]) { msg.optionalFloatWrapper = com.google.protobuf.kotlin.FloatValueInternal() } - decoder.readMessage(msg.optionalFloatWrapper.asInternal(), com.google.protobuf.kotlin.FloatValueInternal::decodeWith) + decoder.readMessage( + msg.optionalFloatWrapper.asInternal(), + com.google.protobuf.kotlin.FloatValueInternal::decodeWith + ) } - tag.fieldNr == 207 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[9]) { + tag.fieldNr == 207 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[9]) { msg.optionalDoubleWrapper = com.google.protobuf.kotlin.DoubleValueInternal() } - decoder.readMessage(msg.optionalDoubleWrapper.asInternal(), com.google.protobuf.kotlin.DoubleValueInternal::decodeWith) + decoder.readMessage( + msg.optionalDoubleWrapper.asInternal(), + com.google.protobuf.kotlin.DoubleValueInternal::decodeWith + ) } - tag.fieldNr == 208 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[10]) { + tag.fieldNr == 208 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[10]) { msg.optionalStringWrapper = com.google.protobuf.kotlin.StringValueInternal() } - decoder.readMessage(msg.optionalStringWrapper.asInternal(), com.google.protobuf.kotlin.StringValueInternal::decodeWith) + decoder.readMessage( + msg.optionalStringWrapper.asInternal(), + com.google.protobuf.kotlin.StringValueInternal::decodeWith + ) } - tag.fieldNr == 209 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[11]) { + tag.fieldNr == 209 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[11]) { msg.optionalBytesWrapper = com.google.protobuf.kotlin.BytesValueInternal() } - decoder.readMessage(msg.optionalBytesWrapper.asInternal(), com.google.protobuf.kotlin.BytesValueInternal::decodeWith) + decoder.readMessage( + msg.optionalBytesWrapper.asInternal(), + com.google.protobuf.kotlin.BytesValueInternal::decodeWith + ) } - tag.fieldNr == 211 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 211 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.BoolValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.BoolValueInternal::decodeWith) (msg.repeatedBoolWrapper as MutableList).add(elem) } - tag.fieldNr == 212 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 212 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.Int32ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.Int32ValueInternal::decodeWith) (msg.repeatedInt32Wrapper as MutableList).add(elem) } - tag.fieldNr == 213 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 213 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.Int64ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.Int64ValueInternal::decodeWith) (msg.repeatedInt64Wrapper as MutableList).add(elem) } - tag.fieldNr == 214 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 214 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.UInt32ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.UInt32ValueInternal::decodeWith) (msg.repeatedUint32Wrapper as MutableList).add(elem) } - tag.fieldNr == 215 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 215 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.UInt64ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.UInt64ValueInternal::decodeWith) (msg.repeatedUint64Wrapper as MutableList).add(elem) } - tag.fieldNr == 216 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 216 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.FloatValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.FloatValueInternal::decodeWith) (msg.repeatedFloatWrapper as MutableList).add(elem) } - tag.fieldNr == 217 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 217 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.DoubleValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.DoubleValueInternal::decodeWith) (msg.repeatedDoubleWrapper as MutableList).add(elem) } - tag.fieldNr == 218 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 218 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.StringValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.StringValueInternal::decodeWith) (msg.repeatedStringWrapper as MutableList).add(elem) } - tag.fieldNr == 219 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 219 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.BytesValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.BytesValueInternal::decodeWith) (msg.repeatedBytesWrapper as MutableList).add(elem) } - tag.fieldNr == 301 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[12]) { + tag.fieldNr == 301 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[12]) { msg.optionalDuration = com.google.protobuf.kotlin.DurationInternal() } - decoder.readMessage(msg.optionalDuration.asInternal(), com.google.protobuf.kotlin.DurationInternal::decodeWith) + decoder.readMessage( + msg.optionalDuration.asInternal(), + com.google.protobuf.kotlin.DurationInternal::decodeWith + ) } - tag.fieldNr == 302 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[13]) { + tag.fieldNr == 302 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[13]) { msg.optionalTimestamp = com.google.protobuf.kotlin.TimestampInternal() } - decoder.readMessage(msg.optionalTimestamp.asInternal(), com.google.protobuf.kotlin.TimestampInternal::decodeWith) + decoder.readMessage( + msg.optionalTimestamp.asInternal(), + com.google.protobuf.kotlin.TimestampInternal::decodeWith + ) } - tag.fieldNr == 303 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[14]) { + tag.fieldNr == 303 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[14]) { msg.optionalFieldMask = com.google.protobuf.kotlin.FieldMaskInternal() } - decoder.readMessage(msg.optionalFieldMask.asInternal(), com.google.protobuf.kotlin.FieldMaskInternal::decodeWith) + decoder.readMessage( + msg.optionalFieldMask.asInternal(), + com.google.protobuf.kotlin.FieldMaskInternal::decodeWith + ) } - tag.fieldNr == 304 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[15]) { + tag.fieldNr == 304 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[15]) { msg.optionalStruct = com.google.protobuf.kotlin.StructInternal() } - decoder.readMessage(msg.optionalStruct.asInternal(), com.google.protobuf.kotlin.StructInternal::decodeWith) + decoder.readMessage( + msg.optionalStruct.asInternal(), + com.google.protobuf.kotlin.StructInternal::decodeWith + ) } - tag.fieldNr == 305 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[16]) { + tag.fieldNr == 305 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[16]) { msg.optionalAny = com.google.protobuf.kotlin.AnyInternal() } decoder.readMessage(msg.optionalAny.asInternal(), com.google.protobuf.kotlin.AnyInternal::decodeWith) } - tag.fieldNr == 306 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[17]) { + tag.fieldNr == 306 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[17]) { msg.optionalValue = com.google.protobuf.kotlin.ValueInternal() } - decoder.readMessage(msg.optionalValue.asInternal(), com.google.protobuf.kotlin.ValueInternal::decodeWith) + decoder.readMessage( + msg.optionalValue.asInternal(), + com.google.protobuf.kotlin.ValueInternal::decodeWith + ) } - tag.fieldNr == 307 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 307 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalNullValue = com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum()) } - tag.fieldNr == 311 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 311 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.DurationInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.DurationInternal::decodeWith) (msg.repeatedDuration as MutableList).add(elem) } - tag.fieldNr == 312 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 312 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.TimestampInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.TimestampInternal::decodeWith) (msg.repeatedTimestamp as MutableList).add(elem) } - tag.fieldNr == 313 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 313 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.FieldMaskInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.FieldMaskInternal::decodeWith) (msg.repeatedFieldmask as MutableList).add(elem) } - tag.fieldNr == 324 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 324 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.StructInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.StructInternal::decodeWith) (msg.repeatedStruct as MutableList).add(elem) } - tag.fieldNr == 315 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 315 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.AnyInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.AnyInternal::decodeWith) (msg.repeatedAny as MutableList).add(elem) } - tag.fieldNr == 316 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 316 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.ValueInternal::decodeWith) (msg.repeatedValue as MutableList).add(elem) } - tag.fieldNr == 317 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 317 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.ListValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.ListValueInternal::decodeWith) (msg.repeatedListValue as MutableList).add(elem) } - tag.fieldNr == 401 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 401 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldname1 = decoder.readInt32() } - tag.fieldNr == 402 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 402 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldName2 = decoder.readInt32() } - tag.fieldNr == 403 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 403 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FieldName3 = decoder.readInt32() } - tag.fieldNr == 404 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 404 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_Name4_ = decoder.readInt32() } - tag.fieldNr == 405 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 405 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field0name5 = decoder.readInt32() } - tag.fieldNr == 406 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 406 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_0Name6 = decoder.readInt32() } - tag.fieldNr == 407 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 407 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldName7 = decoder.readInt32() } - tag.fieldNr == 408 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 408 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FieldName8 = decoder.readInt32() } - tag.fieldNr == 409 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 409 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_Name9 = decoder.readInt32() } - tag.fieldNr == 410 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 410 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.Field_Name10 = decoder.readInt32() } - tag.fieldNr == 411 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 411 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FIELD_NAME11 = decoder.readInt32() } - tag.fieldNr == 412 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 412 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FIELDName12 = decoder.readInt32() } - tag.fieldNr == 413 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 413 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg._FieldName13 = decoder.readInt32() } - tag.fieldNr == 414 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 414 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.__FieldName14 = decoder.readInt32() } - tag.fieldNr == 415 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 415 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_Name15 = decoder.readInt32() } - tag.fieldNr == 416 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 416 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field__Name16 = decoder.readInt32() } - tag.fieldNr == 417 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 417 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldName17__ = decoder.readInt32() } - tag.fieldNr == 418 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 418 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FieldName18__ = decoder.readInt32() } - tag.fieldNr == 111 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint32(decoder.readUInt32()) + tag.fieldNr == 111 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint32(decoder.readUInt32()) } - tag.fieldNr == 112 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - val field = (msg.oneofField as? com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage) ?: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal()).also { - msg.oneofField = it - } + tag.fieldNr == 112 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + val field = + (msg.oneofField as? com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage) + ?: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage( + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + ).also { + msg.oneofField = it + } - decoder.readMessage(field.value.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) + decoder.readMessage( + field.value.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith + ) } - tag.fieldNr == 113 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofString(decoder.readString()) + tag.fieldNr == 113 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.oneofField = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofString(decoder.readString()) } - tag.fieldNr == 114 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBytes(decoder.readBytes()) + tag.fieldNr == 114 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.oneofField = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBytes(decoder.readBytes()) } - tag.fieldNr == 115 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBool(decoder.readBool()) + tag.fieldNr == 115 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBool(decoder.readBool()) } - tag.fieldNr == 116 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint64(decoder.readUInt64()) + tag.fieldNr == 116 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint64(decoder.readUInt64()) } - tag.fieldNr == 117 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { - msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofFloat(decoder.readFloat()) + tag.fieldNr == 117 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + msg.oneofField = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofFloat(decoder.readFloat()) } - tag.fieldNr == 118 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { - msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofDouble(decoder.readDouble()) + tag.fieldNr == 118 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + msg.oneofField = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofDouble(decoder.readDouble()) } - tag.fieldNr == 119 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofEnum(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum())) + tag.fieldNr == 119 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofEnum( + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber( + decoder.readEnum() + ) + ) } - tag.fieldNr == 120 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNullValue(com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum())) + tag.fieldNr == 120 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNullValue( + com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum()) + ) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.computeSize(): Int { var __result = 0 - if (optionalInt32 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(optionalInt32)) + if (optionalInt32 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(optionalInt32)) } - if (optionalInt64 != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(optionalInt64)) + if (optionalInt64 != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int64(optionalInt64)) } - if (optionalUint32 != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(optionalUint32)) + if (optionalUint32 != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 3, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(optionalUint32)) } - if (optionalUint64 != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(optionalUint64)) + if (optionalUint64 != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 4, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(optionalUint64)) } - if (optionalSint32 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(optionalSint32)) + if (optionalSint32 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 5, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(optionalSint32)) } - if (optionalSint64 != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(optionalSint64)) + if (optionalSint64 != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 6, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(optionalSint64)) } - if (optionalFixed32 != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(optionalFixed32)) + if (optionalFixed32 != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 7, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(optionalFixed32)) } - if (optionalFixed64 != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(8, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(optionalFixed64)) + if (optionalFixed64 != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 8, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(optionalFixed64)) } - if (optionalSfixed32 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(9, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(optionalSfixed32)) + if (optionalSfixed32 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 9, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(optionalSfixed32)) } - if (optionalSfixed64 != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(10, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(optionalSfixed64)) + if (optionalSfixed64 != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 10, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(optionalSfixed64)) } - if (optionalFloat != 0.0f) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(11, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(optionalFloat)) + if (optionalFloat != 0.0f) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 11, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.float(optionalFloat)) } - if (optionalDouble != 0.0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(12, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(optionalDouble)) + if (optionalDouble != 0.0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 12, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.double(optionalDouble)) } - if (optionalBool != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(13, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(optionalBool)) + if (optionalBool != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 13, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(optionalBool)) } - if (optionalString.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalString).let { kotlinx.rpc.protobuf.internal.WireSize.tag(14, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (optionalString.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalString).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 14, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (optionalBytes.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(optionalBytes).let { kotlinx.rpc.protobuf.internal.WireSize.tag(15, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (optionalBytes.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(optionalBytes).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 15, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[0]) { - __result += optionalNestedMessage.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(18, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += optionalNestedMessage.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 18, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[1]) { - __result += optionalForeignMessage.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(19, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[1]) { + __result += optionalForeignMessage.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 19, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (optionalNestedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(21, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNestedEnum.number)) + if (optionalNestedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 21, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNestedEnum.number)) } - if (optionalForeignEnum != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(22, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalForeignEnum.number)) + if (optionalForeignEnum != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 22, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalForeignEnum.number)) } - if (optionalAliasedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(23, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalAliasedEnum.number)) + if (optionalAliasedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 23, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalAliasedEnum.number)) } - if (optionalStringPiece.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalStringPiece).let { kotlinx.rpc.protobuf.internal.WireSize.tag(24, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (optionalStringPiece.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalStringPiece).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 24, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (optionalCord.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalCord).let { kotlinx.rpc.protobuf.internal.WireSize.tag(25, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (optionalCord.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalCord).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 25, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[2]) { - __result += recursiveMessage.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(27, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[2]) { + __result += recursiveMessage.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 27, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedInt32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(31, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedInt32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 31, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedInt64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(32, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedInt64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 32, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedUint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(33, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedUint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 33, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedUint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(34, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedUint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 34, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedSint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(35, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedSint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 35, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedSint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(36, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedSint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 36, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedFixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(repeatedFixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(37, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedFixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(repeatedFixed32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 37, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedFixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(repeatedFixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(38, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedFixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(repeatedFixed64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 38, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedSfixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(repeatedSfixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(39, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedSfixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(repeatedSfixed32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 39, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedSfixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(repeatedSfixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(40, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedSfixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(repeatedSfixed64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 40, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedFloat.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(repeatedFloat).let { kotlinx.rpc.protobuf.internal.WireSize.tag(41, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedFloat.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(repeatedFloat).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 41, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedDouble.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(repeatedDouble).let { kotlinx.rpc.protobuf.internal.WireSize.tag(42, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedDouble.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(repeatedDouble).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 42, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedBool.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool).let { kotlinx.rpc.protobuf.internal.WireSize.tag(43, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedBool.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 43, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedString.isNotEmpty()) { - __result += repeatedString.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(44, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedString.isNotEmpty()) { + __result += repeatedString.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 44, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedBytes.isNotEmpty()) { - __result += repeatedBytes.sumOf { kotlinx.rpc.protobuf.internal.WireSize.bytes(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(45, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedBytes.isNotEmpty()) { + __result += repeatedBytes.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.bytes(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 45, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedNestedMessage.isNotEmpty()) { - __result += repeatedNestedMessage.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(48, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedNestedMessage.isNotEmpty()) { + __result += repeatedNestedMessage.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 48, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedForeignMessage.isNotEmpty()) { - __result += repeatedForeignMessage.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(49, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedForeignMessage.isNotEmpty()) { + __result += repeatedForeignMessage.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 49, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedNestedEnum.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number }).let { kotlinx.rpc.protobuf.internal.WireSize.tag(51, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedNestedEnum.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number }).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 51, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedForeignEnum.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number }).let { kotlinx.rpc.protobuf.internal.WireSize.tag(52, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedForeignEnum.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number }).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 52, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedStringPiece.isNotEmpty()) { - __result += repeatedStringPiece.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(54, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedStringPiece.isNotEmpty()) { + __result += repeatedStringPiece.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 54, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedCord.isNotEmpty()) { - __result += repeatedCord.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(55, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedCord.isNotEmpty()) { + __result += repeatedCord.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 55, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (packedInt32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(75, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedInt32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 75, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedInt64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(76, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedInt64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 76, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedUint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(77, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedUint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 77, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedUint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(78, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedUint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 78, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedSint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(79, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedSint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 79, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedSint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(80, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedSint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 80, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedFixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(packedFixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(81, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedFixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(packedFixed32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 81, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedFixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(packedFixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(82, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedFixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(packedFixed64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 82, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedSfixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(packedSfixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(83, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedSfixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(packedSfixed32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 83, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedSfixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(packedSfixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(84, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedSfixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(packedSfixed64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 84, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedFloat.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(packedFloat).let { kotlinx.rpc.protobuf.internal.WireSize.tag(85, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedFloat.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(packedFloat).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 85, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedDouble.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(packedDouble).let { kotlinx.rpc.protobuf.internal.WireSize.tag(86, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedDouble.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(packedDouble).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 86, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedBool.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool).let { kotlinx.rpc.protobuf.internal.WireSize.tag(87, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedBool.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 87, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedNestedEnum.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number }).let { kotlinx.rpc.protobuf.internal.WireSize.tag(88, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedNestedEnum.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number }).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 88, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (unpackedInt32.isNotEmpty()) { - __result += unpackedInt32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.int32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(89, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedInt32.isNotEmpty()) { + __result += unpackedInt32.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 89, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedInt64.isNotEmpty()) { - __result += unpackedInt64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.int64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(90, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedInt64.isNotEmpty()) { + __result += unpackedInt64.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.int64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 90, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedUint32.isNotEmpty()) { - __result += unpackedUint32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.uInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(91, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedUint32.isNotEmpty()) { + __result += unpackedUint32.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.uInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 91, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedUint64.isNotEmpty()) { - __result += unpackedUint64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.uInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(92, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedUint64.isNotEmpty()) { + __result += unpackedUint64.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.uInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 92, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedSint32.isNotEmpty()) { - __result += unpackedSint32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(93, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedSint32.isNotEmpty()) { + __result += unpackedSint32.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.sInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 93, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedSint64.isNotEmpty()) { - __result += unpackedSint64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(94, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedSint64.isNotEmpty()) { + __result += unpackedSint64.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.sInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 94, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedFixed32.isNotEmpty()) { - __result += unpackedFixed32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.fixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(95, kotlinx.rpc.protobuf.internal.WireType.FIXED32) } + if (unpackedFixed32.isNotEmpty()) { + __result += unpackedFixed32.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.fixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 95, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + } } - if (unpackedFixed64.isNotEmpty()) { - __result += unpackedFixed64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.fixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(96, kotlinx.rpc.protobuf.internal.WireType.FIXED64) } + if (unpackedFixed64.isNotEmpty()) { + __result += unpackedFixed64.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.fixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 96, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + } } - if (unpackedSfixed32.isNotEmpty()) { - __result += unpackedSfixed32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sFixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(97, kotlinx.rpc.protobuf.internal.WireType.FIXED32) } + if (unpackedSfixed32.isNotEmpty()) { + __result += unpackedSfixed32.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 97, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + } } - if (unpackedSfixed64.isNotEmpty()) { - __result += unpackedSfixed64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sFixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(98, kotlinx.rpc.protobuf.internal.WireType.FIXED64) } + if (unpackedSfixed64.isNotEmpty()) { + __result += unpackedSfixed64.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 98, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + } } - if (unpackedFloat.isNotEmpty()) { - __result += unpackedFloat.sumOf { kotlinx.rpc.protobuf.internal.WireSize.float(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(99, kotlinx.rpc.protobuf.internal.WireType.FIXED32) } + if (unpackedFloat.isNotEmpty()) { + __result += unpackedFloat.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.float(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 99, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + } } - if (unpackedDouble.isNotEmpty()) { - __result += unpackedDouble.sumOf { kotlinx.rpc.protobuf.internal.WireSize.double(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(100, kotlinx.rpc.protobuf.internal.WireType.FIXED64) } + if (unpackedDouble.isNotEmpty()) { + __result += unpackedDouble.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.double(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 100, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + } } - if (unpackedBool.isNotEmpty()) { - __result += unpackedBool.sumOf { kotlinx.rpc.protobuf.internal.WireSize.bool(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(101, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedBool.isNotEmpty()) { + __result += unpackedBool.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.bool(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 101, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedNestedEnum.isNotEmpty()) { - __result += unpackedNestedEnum.sumOf { kotlinx.rpc.protobuf.internal.WireSize.enum(it.number) + kotlinx.rpc.protobuf.internal.WireSize.tag(102, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedNestedEnum.isNotEmpty()) { + __result += unpackedNestedEnum.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.enum(it.number) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 102, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (mapInt32Int32.isNotEmpty()) { + if (mapInt32Int32.isNotEmpty()) { __result += mapInt32Int32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapInt64Int64.isNotEmpty()) { + if (mapInt64Int64.isNotEmpty()) { __result += mapInt64Int64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapUint32Uint32.isNotEmpty()) { + if (mapUint32Uint32.isNotEmpty()) { __result += mapUint32Uint32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapUint64Uint64.isNotEmpty()) { + if (mapUint64Uint64.isNotEmpty()) { __result += mapUint64Uint64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapSint32Sint32.isNotEmpty()) { + if (mapSint32Sint32.isNotEmpty()) { __result += mapSint32Sint32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapSint64Sint64.isNotEmpty()) { + if (mapSint64Sint64.isNotEmpty()) { __result += mapSint64Sint64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapFixed32Fixed32.isNotEmpty()) { + if (mapFixed32Fixed32.isNotEmpty()) { __result += mapFixed32Fixed32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapFixed64Fixed64.isNotEmpty()) { + if (mapFixed64Fixed64.isNotEmpty()) { __result += mapFixed64Fixed64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapSfixed32Sfixed32.isNotEmpty()) { + if (mapSfixed32Sfixed32.isNotEmpty()) { __result += mapSfixed32Sfixed32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapSfixed64Sfixed64.isNotEmpty()) { + if (mapSfixed64Sfixed64.isNotEmpty()) { __result += mapSfixed64Sfixed64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapInt32Float.isNotEmpty()) { + if (mapInt32Float.isNotEmpty()) { __result += mapInt32Float.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapInt32Double.isNotEmpty()) { + if (mapInt32Double.isNotEmpty()) { __result += mapInt32Double.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapBoolBool.isNotEmpty()) { + if (mapBoolBool.isNotEmpty()) { __result += mapBoolBool.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringString.isNotEmpty()) { + if (mapStringString.isNotEmpty()) { __result += mapStringString.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringBytes.isNotEmpty()) { + if (mapStringBytes.isNotEmpty()) { __result += mapStringBytes.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringNestedMessage.isNotEmpty()) { + if (mapStringNestedMessage.isNotEmpty()) { __result += mapStringNestedMessage.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringForeignMessage.isNotEmpty()) { + if (mapStringForeignMessage.isNotEmpty()) { __result += mapStringForeignMessage.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringNestedEnum.isNotEmpty()) { + if (mapStringNestedEnum.isNotEmpty()) { __result += mapStringNestedEnum.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringForeignEnum.isNotEmpty()) { + if (mapStringForeignEnum.isNotEmpty()) { __result += mapStringForeignEnum.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (presenceMask[3]) { - __result += optionalBoolWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(201, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[3]) { + __result += optionalBoolWrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 201, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[4]) { - __result += optionalInt32Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(202, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[4]) { + __result += optionalInt32Wrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 202, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[5]) { - __result += optionalInt64Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(203, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[5]) { + __result += optionalInt64Wrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 203, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[6]) { - __result += optionalUint32Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(204, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[6]) { + __result += optionalUint32Wrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 204, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[7]) { - __result += optionalUint64Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(205, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[7]) { + __result += optionalUint64Wrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 205, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[8]) { - __result += optionalFloatWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(206, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[8]) { + __result += optionalFloatWrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 206, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[9]) { - __result += optionalDoubleWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(207, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[9]) { + __result += optionalDoubleWrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 207, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[10]) { - __result += optionalStringWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(208, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[10]) { + __result += optionalStringWrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 208, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[11]) { - __result += optionalBytesWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(209, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[11]) { + __result += optionalBytesWrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 209, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedBoolWrapper.isNotEmpty()) { - __result += repeatedBoolWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(211, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedBoolWrapper.isNotEmpty()) { + __result += repeatedBoolWrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 211, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedInt32Wrapper.isNotEmpty()) { - __result += repeatedInt32Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(212, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedInt32Wrapper.isNotEmpty()) { + __result += repeatedInt32Wrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 212, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedInt64Wrapper.isNotEmpty()) { - __result += repeatedInt64Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(213, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedInt64Wrapper.isNotEmpty()) { + __result += repeatedInt64Wrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 213, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedUint32Wrapper.isNotEmpty()) { - __result += repeatedUint32Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(214, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedUint32Wrapper.isNotEmpty()) { + __result += repeatedUint32Wrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 214, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedUint64Wrapper.isNotEmpty()) { - __result += repeatedUint64Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(215, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedUint64Wrapper.isNotEmpty()) { + __result += repeatedUint64Wrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 215, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedFloatWrapper.isNotEmpty()) { - __result += repeatedFloatWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(216, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedFloatWrapper.isNotEmpty()) { + __result += repeatedFloatWrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 216, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedDoubleWrapper.isNotEmpty()) { - __result += repeatedDoubleWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(217, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedDoubleWrapper.isNotEmpty()) { + __result += repeatedDoubleWrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 217, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedStringWrapper.isNotEmpty()) { - __result += repeatedStringWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(218, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedStringWrapper.isNotEmpty()) { + __result += repeatedStringWrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 218, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedBytesWrapper.isNotEmpty()) { - __result += repeatedBytesWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(219, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedBytesWrapper.isNotEmpty()) { + __result += repeatedBytesWrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 219, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (presenceMask[12]) { - __result += optionalDuration.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(301, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[12]) { + __result += optionalDuration.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 301, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[13]) { - __result += optionalTimestamp.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(302, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[13]) { + __result += optionalTimestamp.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 302, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[14]) { - __result += optionalFieldMask.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(303, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[14]) { + __result += optionalFieldMask.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 303, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[15]) { - __result += optionalStruct.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(304, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[15]) { + __result += optionalStruct.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 304, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[16]) { - __result += optionalAny.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(305, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[16]) { + __result += optionalAny.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 305, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[17]) { - __result += optionalValue.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(306, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[17]) { + __result += optionalValue.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 306, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(307, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNullValue.number)) + if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 307, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNullValue.number)) } - if (repeatedDuration.isNotEmpty()) { - __result += repeatedDuration.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(311, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedDuration.isNotEmpty()) { + __result += repeatedDuration.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 311, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedTimestamp.isNotEmpty()) { - __result += repeatedTimestamp.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(312, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedTimestamp.isNotEmpty()) { + __result += repeatedTimestamp.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 312, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedFieldmask.isNotEmpty()) { - __result += repeatedFieldmask.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(313, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedFieldmask.isNotEmpty()) { + __result += repeatedFieldmask.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 313, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedStruct.isNotEmpty()) { - __result += repeatedStruct.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(324, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedStruct.isNotEmpty()) { + __result += repeatedStruct.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 324, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedAny.isNotEmpty()) { - __result += repeatedAny.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(315, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedAny.isNotEmpty()) { + __result += repeatedAny.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 315, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedValue.isNotEmpty()) { - __result += repeatedValue.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(316, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedValue.isNotEmpty()) { + __result += repeatedValue.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 316, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedListValue.isNotEmpty()) { - __result += repeatedListValue.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(317, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedListValue.isNotEmpty()) { + __result += repeatedListValue.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 317, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (fieldname1 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(401, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldname1)) + if (fieldname1 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 401, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldname1)) } - if (fieldName2 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(402, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName2)) + if (fieldName2 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 402, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName2)) } - if (FieldName3 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(403, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName3)) + if (FieldName3 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 403, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName3)) } - if (field_Name4_ != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(404, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name4_)) + if (field_Name4_ != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 404, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name4_)) } - if (field0name5 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(405, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field0name5)) + if (field0name5 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 405, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field0name5)) } - if (field_0Name6 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(406, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_0Name6)) + if (field_0Name6 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 406, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_0Name6)) } - if (fieldName7 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(407, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName7)) + if (fieldName7 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 407, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName7)) } - if (FieldName8 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(408, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName8)) + if (FieldName8 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 408, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName8)) } - if (field_Name9 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(409, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name9)) + if (field_Name9 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 409, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name9)) } - if (Field_Name10 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(410, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(Field_Name10)) + if (Field_Name10 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 410, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(Field_Name10)) } - if (FIELD_NAME11 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(411, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELD_NAME11)) + if (FIELD_NAME11 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 411, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELD_NAME11)) } - if (FIELDName12 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(412, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELDName12)) + if (FIELDName12 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 412, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELDName12)) } - if (_FieldName13 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(413, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(_FieldName13)) + if (_FieldName13 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 413, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(_FieldName13)) } - if (__FieldName14 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(414, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(__FieldName14)) + if (__FieldName14 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 414, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(__FieldName14)) } - if (field_Name15 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(415, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name15)) + if (field_Name15 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 415, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name15)) } - if (field__Name16 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(416, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field__Name16)) + if (field__Name16 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 416, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field__Name16)) } - if (fieldName17__ != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(417, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName17__)) + if (fieldName17__ != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 417, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName17__)) } - if (FieldName18__ != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(418, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName18__)) + if (FieldName18__ != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 418, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName18__)) } - oneofField?.also { - when (val value = it) { - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(111, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value.value)) + oneofField?.also { + when (val value = it) { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 111, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value.value)) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { - __result += value.value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(112, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { + __result += value.value.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 112, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofString -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(113, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofString -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 113, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(114, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 114, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBool -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(115, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(value.value)) + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBool -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 115, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(value.value)) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(116, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value.value)) + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 116, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value.value)) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(117, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(value.value)) + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 117, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.float(value.value)) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(118, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(value.value)) + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 118, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.double(value.value)) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(119, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 119, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(120, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 120, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) } } } @@ -3318,1319 +4218,1589 @@ private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal { - return this as? com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal { + return this as? com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (c != 0) { +fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (c != 0) { encoder.writeInt32(fieldNr = 1, value = c) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.c = decoder.readInt32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.computeSize(): Int { var __result = 0 - if (c != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(c)) + if (c != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(c)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.ForeignMessage.asInternal(): com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal { - return this as? com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.editions.proto3.ForeignMessage.asInternal(): com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal { + return this as? com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { +fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { // no fields to encode } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - else -> { + when { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.computeSize(): Int { var __result = 0 return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3.asInternal(): com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal { - return this as? com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3.asInternal(): com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal { + return this as? com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { +fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { // no fields to encode } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - else -> { + when { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.computeSize(): Int { var __result = 0 return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.asInternal(): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal { - return this as? com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.asInternal(): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal { + return this as? com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { corecursive.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (a != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (a != 0) { encoder.writeInt32(fieldNr = 1, value = a) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = corecursive.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.a = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { msg.corecursive = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() } - decoder.readMessage(msg.corecursive.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal::decodeWith) + decoder.readMessage( + msg.corecursive.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal::decodeWith + ) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.computeSize(): Int { var __result = 0 - if (a != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(a)) + if (a != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(a)) } - if (presenceMask[0]) { - __result += corecursive.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += corecursive.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal { - return this as? com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal { + return this as? com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0) { encoder.writeInt32(fieldNr = 1, value = key) } - if (value != 0) { + if (value != 0) { encoder.writeInt32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readInt32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) } - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0L) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0L) { encoder.writeInt64(fieldNr = 1, value = key) } - if (value != 0L) { + if (value != 0L) { encoder.writeInt64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readInt64() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(key)) + if (key != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int64(key)) } - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0u) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0u) { encoder.writeUInt32(fieldNr = 1, value = key) } - if (value != 0u) { + if (value != 0u) { encoder.writeUInt32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readUInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readUInt32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(key)) + if (key != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(key)) } - if (value != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value)) + if (value != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0uL) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0uL) { encoder.writeUInt64(fieldNr = 1, value = key) } - if (value != 0uL) { + if (value != 0uL) { encoder.writeUInt64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readUInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readUInt64() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(key)) + if (key != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(key)) } - if (value != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value)) + if (value != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0) { encoder.writeSInt32(fieldNr = 1, value = key) } - if (value != 0) { + if (value != 0) { encoder.writeSInt32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readSInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readSInt32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(key)) } - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0L) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0L) { encoder.writeSInt64(fieldNr = 1, value = key) } - if (value != 0L) { + if (value != 0L) { encoder.writeSInt64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readSInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readSInt64() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(key)) + if (key != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(key)) } - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0u) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0u) { encoder.writeFixed32(fieldNr = 1, value = key) } - if (value != 0u) { + if (value != 0u) { encoder.writeFixed32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.key = decoder.readFixed32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readFixed32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(key)) + if (key != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(key)) } - if (value != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(value)) + if (value != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0uL) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0uL) { encoder.writeFixed64(fieldNr = 1, value = key) } - if (value != 0uL) { + if (value != 0uL) { encoder.writeFixed64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.key = decoder.readFixed64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readFixed64() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(key)) + if (key != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(key)) } - if (value != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(value)) + if (value != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0) { encoder.writeSFixed32(fieldNr = 1, value = key) } - if (value != 0) { + if (value != 0) { encoder.writeSFixed32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.key = decoder.readSFixed32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readSFixed32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(key)) } - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0L) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0L) { encoder.writeSFixed64(fieldNr = 1, value = key) } - if (value != 0L) { + if (value != 0L) { encoder.writeSFixed64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.key = decoder.readSFixed64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readSFixed64() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(key)) + if (key != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(key)) } - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0) { encoder.writeInt32(fieldNr = 1, value = key) } - if (value != 0.0f) { + if (value != 0.0f) { encoder.writeFloat(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readFloat() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) } - if (value != 0.0f) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(value)) + if (value != 0.0f) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.float(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0) { encoder.writeInt32(fieldNr = 1, value = key) } - if (value != 0.0) { + if (value != 0.0) { encoder.writeDouble(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readDouble() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) } - if (value != 0.0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(value)) + if (value != 0.0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.double(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != false) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != false) { encoder.writeBool(fieldNr = 1, value = key) } - if (value != false) { + if (value != false) { encoder.writeBool(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readBool() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readBool() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.computeSize(): Int { var __result = 0 - if (key != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(key)) + if (key != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(key)) } - if (value != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(value)) + if (value != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value.isNotEmpty()) { + if (value.isNotEmpty()) { encoder.writeString(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readString() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value.isNotEmpty()) { + if (value.isNotEmpty()) { encoder.writeBytes(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readBytes() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { value.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = value.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { - msg.value = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { + msg.value = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } - decoder.readMessage(msg.value.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) + decoder.readMessage( + msg.value.asInternal(), + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith + ) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[0]) { - __result += value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += value.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { value.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = value.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { msg.value = com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() } - decoder.readMessage(msg.value.asInternal(), com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal::decodeWith) + decoder.readMessage( + msg.value.asInternal(), + com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal::decodeWith + ) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[0]) { - __result += value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += value.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { + if (value != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { encoder.writeEnum(fieldNr = 2, value = value.number) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.value = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.value = + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (value != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) + if (value != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { + if (value != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { encoder.writeEnum(fieldNr = 2, value = value.number) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = com.google.protobuf_test_messages.editions.proto3.ForeignEnum.fromNumber(decoder.readEnum()) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (value != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) + if (value != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.ForeignEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.ForeignEnum { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.editions.proto3.ForeignEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.ForeignEnum { + return when (number) { + 0 -> { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO } - 1 -> { + 1 -> { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_BAR } - 2 -> { + 2 -> { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_BAZ } - else -> { + else -> { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum { + return when (number) { + 0 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO } - 1 -> { + 1 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.BAR } - 2 -> { + 2 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.BAZ } - -1 -> { + -1 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.NEG } - else -> { + else -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum { + return when (number) { + 0 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO } - 1 -> { + 1 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_BAR } - 2 -> { + 2 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_BAZ } - else -> { + else -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool { + return when (number) { + 0 -> { com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool.kFalse } - 1 -> { + 1 -> { com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool.kTrue } - else -> { + else -> { com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool.UNRECOGNIZED(number) } } diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt index df9366597..7c01ed3d3 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt @@ -1,13 +1,54 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) + package com.google.protobuf_test_messages.proto3 -import com.google.protobuf.kotlin.* -import kotlinx.rpc.internal.utils.* +import com.google.protobuf.kotlin.asInternal +import com.google.protobuf.kotlin.checkRequiredFields +import com.google.protobuf.kotlin.decodeWith +import com.google.protobuf.kotlin.encodeWith +import com.google.protobuf.kotlin.fromNumber +import kotlinx.rpc.internal.utils.ExperimentalRpcApi import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.* - -class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestAllTypesProto3, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 18) { - private object PresenceIndices { +import kotlinx.rpc.protobuf.internal.MsgFieldDelegate +import kotlinx.rpc.protobuf.internal.bool +import kotlinx.rpc.protobuf.internal.bytes +import kotlinx.rpc.protobuf.internal.double +import kotlinx.rpc.protobuf.internal.enum +import kotlinx.rpc.protobuf.internal.fixed32 +import kotlinx.rpc.protobuf.internal.fixed64 +import kotlinx.rpc.protobuf.internal.float +import kotlinx.rpc.protobuf.internal.int32 +import kotlinx.rpc.protobuf.internal.int64 +import kotlinx.rpc.protobuf.internal.packedBool +import kotlinx.rpc.protobuf.internal.packedDouble +import kotlinx.rpc.protobuf.internal.packedEnum +import kotlinx.rpc.protobuf.internal.packedFixed32 +import kotlinx.rpc.protobuf.internal.packedFixed64 +import kotlinx.rpc.protobuf.internal.packedFloat +import kotlinx.rpc.protobuf.internal.packedInt32 +import kotlinx.rpc.protobuf.internal.packedInt64 +import kotlinx.rpc.protobuf.internal.packedSFixed32 +import kotlinx.rpc.protobuf.internal.packedSFixed64 +import kotlinx.rpc.protobuf.internal.packedSInt32 +import kotlinx.rpc.protobuf.internal.packedSInt64 +import kotlinx.rpc.protobuf.internal.packedUInt32 +import kotlinx.rpc.protobuf.internal.packedUInt64 +import kotlinx.rpc.protobuf.internal.sFixed32 +import kotlinx.rpc.protobuf.internal.sFixed64 +import kotlinx.rpc.protobuf.internal.sInt32 +import kotlinx.rpc.protobuf.internal.sInt64 +import kotlinx.rpc.protobuf.internal.string +import kotlinx.rpc.protobuf.internal.tag +import kotlinx.rpc.protobuf.internal.uInt32 +import kotlinx.rpc.protobuf.internal.uInt64 + +class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.TestAllTypesProto3, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 18) { + private object PresenceIndices { const val optionalNestedMessage: Int = 0 const val optionalForeignMessage: Int = 1 const val recursiveMessage: Int = 2 @@ -46,14 +87,20 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA override var optionalBool: Boolean by MsgFieldDelegate { false } override var optionalString: String by MsgFieldDelegate { "" } override var optionalBytes: ByteArray by MsgFieldDelegate { byteArrayOf() } - override var optionalNestedMessage: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate(PresenceIndices.optionalNestedMessage) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } - override var optionalForeignMessage: com.google.protobuf_test_messages.proto3.ForeignMessage by MsgFieldDelegate(PresenceIndices.optionalForeignMessage) { com.google.protobuf_test_messages.proto3.ForeignMessageInternal() } + override var optionalNestedMessage: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate( + PresenceIndices.optionalNestedMessage + ) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } + override var optionalForeignMessage: com.google.protobuf_test_messages.proto3.ForeignMessage by MsgFieldDelegate( + PresenceIndices.optionalForeignMessage + ) { com.google.protobuf_test_messages.proto3.ForeignMessageInternal() } override var optionalNestedEnum: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum by MsgFieldDelegate { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO } override var optionalForeignEnum: com.google.protobuf_test_messages.proto3.ForeignEnum by MsgFieldDelegate { com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO } override var optionalAliasedEnum: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum by MsgFieldDelegate { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO } override var optionalStringPiece: String by MsgFieldDelegate { "" } override var optionalCord: String by MsgFieldDelegate { "" } - override var recursiveMessage: com.google.protobuf_test_messages.proto3.TestAllTypesProto3 by MsgFieldDelegate(PresenceIndices.recursiveMessage) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } + override var recursiveMessage: com.google.protobuf_test_messages.proto3.TestAllTypesProto3 by MsgFieldDelegate( + PresenceIndices.recursiveMessage + ) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } override var repeatedInt32: List by MsgFieldDelegate { mutableListOf() } override var repeatedInt64: List by MsgFieldDelegate { mutableListOf() } override var repeatedUint32: List by MsgFieldDelegate { mutableListOf() } @@ -174,8 +221,9 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA override var FieldName18__: Int by MsgFieldDelegate { 0 } override var oneofField: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField? = null - class NestedMessageInternal: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + class NestedMessageInternal : com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val corecursive: Int = 0 } @@ -183,25 +231,32 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA override val _size: Int by lazy { computeSize() } override var a: Int by MsgFieldDelegate { 0 } - override var corecursive: com.google.protobuf_test_messages.proto3.TestAllTypesProto3 by MsgFieldDelegate(PresenceIndices.corecursive) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } + override var corecursive: com.google.protobuf_test_messages.proto3.TestAllTypesProto3 by MsgFieldDelegate( + PresenceIndices.corecursive + ) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : + kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { - val msg = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.decodeWith(msg, it) + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + val msg = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.decodeWith( + msg, + it + ) } msg.checkRequiredFields() return msg @@ -213,7 +268,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapInt32Int32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt32Int32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -224,7 +279,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapInt64Int64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt64Int64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -235,7 +290,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapUint32Uint32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapUint32Uint32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -246,7 +301,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapUint64Uint64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapUint64Uint64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -257,7 +312,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapSint32Sint32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSint32Sint32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -268,7 +323,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapSint64Sint64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSint64Sint64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -279,7 +334,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapFixed32Fixed32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapFixed32Fixed32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -290,7 +345,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapFixed64Fixed64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapFixed64Fixed64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -301,7 +356,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapSfixed32Sfixed32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSfixed32Sfixed32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -312,7 +367,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapSfixed64Sfixed64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSfixed64Sfixed64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -323,7 +378,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapInt32FloatEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt32FloatEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -334,7 +389,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapInt32DoubleEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt32DoubleEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -345,7 +400,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapBoolBoolEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapBoolBoolEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -356,7 +411,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapStringStringEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringStringEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -367,7 +422,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapStringBytesEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringBytesEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -378,8 +433,8 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapStringNestedMessageEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + class MapStringNestedMessageEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val value: Int = 0 } @@ -387,14 +442,16 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA override val _size: Int by lazy { computeSize() } var key: String by MsgFieldDelegate { "" } - var value: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate(PresenceIndices.value) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } + var value: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate( + PresenceIndices.value + ) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } @kotlinx.rpc.internal.utils.InternalRpcApi companion object } - class MapStringForeignMessageEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + class MapStringForeignMessageEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val value: Int = 0 } @@ -408,7 +465,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapStringNestedEnumEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringNestedEnumEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -419,7 +476,7 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } - class MapStringForeignEnumEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringForeignEnumEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -431,21 +488,21 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.proto3.TestAllTypesProto3): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.proto3.TestAllTypesProto3): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.TestAllTypesProto3 { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.TestAllTypesProto3 { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -458,28 +515,29 @@ class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestA companion object } -class ForeignMessageInternal: com.google.protobuf_test_messages.proto3.ForeignMessage, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class ForeignMessageInternal : com.google.protobuf_test_messages.proto3.ForeignMessage, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } override var c: Int by MsgFieldDelegate { 0 } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.proto3.ForeignMessage): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.proto3.ForeignMessage): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.ForeignMessage { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.ForeignMessage { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.proto3.ForeignMessageInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.proto3.ForeignMessageInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -492,26 +550,27 @@ class ForeignMessageInternal: com.google.protobuf_test_messages.proto3.ForeignMe companion object } -class NullHypothesisProto3Internal: com.google.protobuf_test_messages.proto3.NullHypothesisProto3, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class NullHypothesisProto3Internal : com.google.protobuf_test_messages.proto3.NullHypothesisProto3, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.proto3.NullHypothesisProto3): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.proto3.NullHypothesisProto3): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.NullHypothesisProto3 { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.NullHypothesisProto3 { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -524,26 +583,27 @@ class NullHypothesisProto3Internal: com.google.protobuf_test_messages.proto3.Nul companion object } -class EnumOnlyProto3Internal: com.google.protobuf_test_messages.proto3.EnumOnlyProto3, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class EnumOnlyProto3Internal : com.google.protobuf_test_messages.proto3.EnumOnlyProto3, + kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.proto3.EnumOnlyProto3): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.proto3.EnumOnlyProto3): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.EnumOnlyProto3 { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.EnumOnlyProto3 { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -556,1029 +616,1103 @@ class EnumOnlyProto3Internal: com.google.protobuf_test_messages.proto3.EnumOnlyP companion object } -operator fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.Companion.invoke(body: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.() -> Unit): com.google.protobuf_test_messages.proto3.TestAllTypesProto3 { +operator fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.Companion.invoke(body: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.() -> Unit): com.google.protobuf_test_messages.proto3.TestAllTypesProto3 { val msg = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.proto3.ForeignMessage.Companion.invoke(body: com.google.protobuf_test_messages.proto3.ForeignMessageInternal.() -> Unit): com.google.protobuf_test_messages.proto3.ForeignMessage { +operator fun com.google.protobuf_test_messages.proto3.ForeignMessage.Companion.invoke(body: com.google.protobuf_test_messages.proto3.ForeignMessageInternal.() -> Unit): com.google.protobuf_test_messages.proto3.ForeignMessage { val msg = com.google.protobuf_test_messages.proto3.ForeignMessageInternal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3.Companion.invoke(body: com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.() -> Unit): com.google.protobuf_test_messages.proto3.NullHypothesisProto3 { +operator fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3.Companion.invoke(body: com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.() -> Unit): com.google.protobuf_test_messages.proto3.NullHypothesisProto3 { val msg = com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Companion.invoke(body: com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.() -> Unit): com.google.protobuf_test_messages.proto3.EnumOnlyProto3 { +operator fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Companion.invoke(body: com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.() -> Unit): com.google.protobuf_test_messages.proto3.EnumOnlyProto3 { val msg = com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage.Companion.invoke(body: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.() -> Unit): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage { +operator fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage.Companion.invoke(body: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.() -> Unit): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage { val msg = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { optionalNestedMessage.asInternal().checkRequiredFields() } - if (presenceMask[1]) { + if (presenceMask[1]) { optionalForeignMessage.asInternal().checkRequiredFields() } - if (presenceMask[2]) { + if (presenceMask[2]) { recursiveMessage.asInternal().checkRequiredFields() } - if (presenceMask[3]) { + if (presenceMask[3]) { optionalBoolWrapper.asInternal().checkRequiredFields() } - if (presenceMask[4]) { + if (presenceMask[4]) { optionalInt32Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[5]) { + if (presenceMask[5]) { optionalInt64Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[6]) { + if (presenceMask[6]) { optionalUint32Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[7]) { + if (presenceMask[7]) { optionalUint64Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[8]) { + if (presenceMask[8]) { optionalFloatWrapper.asInternal().checkRequiredFields() } - if (presenceMask[9]) { + if (presenceMask[9]) { optionalDoubleWrapper.asInternal().checkRequiredFields() } - if (presenceMask[10]) { + if (presenceMask[10]) { optionalStringWrapper.asInternal().checkRequiredFields() } - if (presenceMask[11]) { + if (presenceMask[11]) { optionalBytesWrapper.asInternal().checkRequiredFields() } - if (presenceMask[12]) { + if (presenceMask[12]) { optionalDuration.asInternal().checkRequiredFields() } - if (presenceMask[13]) { + if (presenceMask[13]) { optionalTimestamp.asInternal().checkRequiredFields() } - if (presenceMask[14]) { + if (presenceMask[14]) { optionalFieldMask.asInternal().checkRequiredFields() } - if (presenceMask[15]) { + if (presenceMask[15]) { optionalStruct.asInternal().checkRequiredFields() } - if (presenceMask[16]) { + if (presenceMask[16]) { optionalAny.asInternal().checkRequiredFields() } - if (presenceMask[17]) { + if (presenceMask[17]) { optionalValue.asInternal().checkRequiredFields() } - oneofField?.also { - when { - it is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { + oneofField?.also { + when { + it is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { it.value.asInternal().checkRequiredFields() } } } - repeatedNestedMessage.forEach { + repeatedNestedMessage.forEach { it.asInternal().checkRequiredFields() } - repeatedForeignMessage.forEach { + repeatedForeignMessage.forEach { it.asInternal().checkRequiredFields() } - repeatedBoolWrapper.forEach { + repeatedBoolWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedInt32Wrapper.forEach { + repeatedInt32Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedInt64Wrapper.forEach { + repeatedInt64Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedUint32Wrapper.forEach { + repeatedUint32Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedUint64Wrapper.forEach { + repeatedUint64Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedFloatWrapper.forEach { + repeatedFloatWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedDoubleWrapper.forEach { + repeatedDoubleWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedStringWrapper.forEach { + repeatedStringWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedBytesWrapper.forEach { + repeatedBytesWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedDuration.forEach { + repeatedDuration.forEach { it.asInternal().checkRequiredFields() } - repeatedTimestamp.forEach { + repeatedTimestamp.forEach { it.asInternal().checkRequiredFields() } - repeatedFieldmask.forEach { + repeatedFieldmask.forEach { it.asInternal().checkRequiredFields() } - repeatedStruct.forEach { + repeatedStruct.forEach { it.asInternal().checkRequiredFields() } - repeatedAny.forEach { + repeatedAny.forEach { it.asInternal().checkRequiredFields() } - repeatedValue.forEach { + repeatedValue.forEach { it.asInternal().checkRequiredFields() } - repeatedListValue.forEach { + repeatedListValue.forEach { it.asInternal().checkRequiredFields() } - mapStringNestedMessage.values.forEach { + mapStringNestedMessage.values.forEach { it.asInternal().checkRequiredFields() } - mapStringForeignMessage.values.forEach { + mapStringForeignMessage.values.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (optionalInt32 != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (optionalInt32 != 0) { encoder.writeInt32(fieldNr = 1, value = optionalInt32) } - if (optionalInt64 != 0L) { + if (optionalInt64 != 0L) { encoder.writeInt64(fieldNr = 2, value = optionalInt64) } - if (optionalUint32 != 0u) { + if (optionalUint32 != 0u) { encoder.writeUInt32(fieldNr = 3, value = optionalUint32) } - if (optionalUint64 != 0uL) { + if (optionalUint64 != 0uL) { encoder.writeUInt64(fieldNr = 4, value = optionalUint64) } - if (optionalSint32 != 0) { + if (optionalSint32 != 0) { encoder.writeSInt32(fieldNr = 5, value = optionalSint32) } - if (optionalSint64 != 0L) { + if (optionalSint64 != 0L) { encoder.writeSInt64(fieldNr = 6, value = optionalSint64) } - if (optionalFixed32 != 0u) { + if (optionalFixed32 != 0u) { encoder.writeFixed32(fieldNr = 7, value = optionalFixed32) } - if (optionalFixed64 != 0uL) { + if (optionalFixed64 != 0uL) { encoder.writeFixed64(fieldNr = 8, value = optionalFixed64) } - if (optionalSfixed32 != 0) { + if (optionalSfixed32 != 0) { encoder.writeSFixed32(fieldNr = 9, value = optionalSfixed32) } - if (optionalSfixed64 != 0L) { + if (optionalSfixed64 != 0L) { encoder.writeSFixed64(fieldNr = 10, value = optionalSfixed64) } - if (optionalFloat != 0.0f) { + if (optionalFloat != 0.0f) { encoder.writeFloat(fieldNr = 11, value = optionalFloat) } - if (optionalDouble != 0.0) { + if (optionalDouble != 0.0) { encoder.writeDouble(fieldNr = 12, value = optionalDouble) } - if (optionalBool != false) { + if (optionalBool != false) { encoder.writeBool(fieldNr = 13, value = optionalBool) } - if (optionalString.isNotEmpty()) { + if (optionalString.isNotEmpty()) { encoder.writeString(fieldNr = 14, value = optionalString) } - if (optionalBytes.isNotEmpty()) { + if (optionalBytes.isNotEmpty()) { encoder.writeBytes(fieldNr = 15, value = optionalBytes) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 18, value = optionalNestedMessage.asInternal()) { encodeWith(it) } } - if (presenceMask[1]) { + if (presenceMask[1]) { encoder.writeMessage(fieldNr = 19, value = optionalForeignMessage.asInternal()) { encodeWith(it) } } - if (optionalNestedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { + if (optionalNestedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { encoder.writeEnum(fieldNr = 21, value = optionalNestedEnum.number) } - if (optionalForeignEnum != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { + if (optionalForeignEnum != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { encoder.writeEnum(fieldNr = 22, value = optionalForeignEnum.number) } - if (optionalAliasedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { + if (optionalAliasedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { encoder.writeEnum(fieldNr = 23, value = optionalAliasedEnum.number) } - if (optionalStringPiece.isNotEmpty()) { + if (optionalStringPiece.isNotEmpty()) { encoder.writeString(fieldNr = 24, value = optionalStringPiece) } - if (optionalCord.isNotEmpty()) { + if (optionalCord.isNotEmpty()) { encoder.writeString(fieldNr = 25, value = optionalCord) } - if (presenceMask[2]) { + if (presenceMask[2]) { encoder.writeMessage(fieldNr = 27, value = recursiveMessage.asInternal()) { encodeWith(it) } } - if (repeatedInt32.isNotEmpty()) { - encoder.writePackedInt32(fieldNr = 31, value = repeatedInt32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32)) + if (repeatedInt32.isNotEmpty()) { + encoder.writePackedInt32( + fieldNr = 31, + value = repeatedInt32, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32) + ) } - if (repeatedInt64.isNotEmpty()) { - encoder.writePackedInt64(fieldNr = 32, value = repeatedInt64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64)) + if (repeatedInt64.isNotEmpty()) { + encoder.writePackedInt64( + fieldNr = 32, + value = repeatedInt64, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64) + ) } - if (repeatedUint32.isNotEmpty()) { - encoder.writePackedUInt32(fieldNr = 33, value = repeatedUint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32)) + if (repeatedUint32.isNotEmpty()) { + encoder.writePackedUInt32( + fieldNr = 33, + value = repeatedUint32, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32) + ) } - if (repeatedUint64.isNotEmpty()) { - encoder.writePackedUInt64(fieldNr = 34, value = repeatedUint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64)) + if (repeatedUint64.isNotEmpty()) { + encoder.writePackedUInt64( + fieldNr = 34, + value = repeatedUint64, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64) + ) } - if (repeatedSint32.isNotEmpty()) { - encoder.writePackedSInt32(fieldNr = 35, value = repeatedSint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32)) + if (repeatedSint32.isNotEmpty()) { + encoder.writePackedSInt32( + fieldNr = 35, + value = repeatedSint32, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32) + ) } - if (repeatedSint64.isNotEmpty()) { - encoder.writePackedSInt64(fieldNr = 36, value = repeatedSint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64)) + if (repeatedSint64.isNotEmpty()) { + encoder.writePackedSInt64( + fieldNr = 36, + value = repeatedSint64, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64) + ) } - if (repeatedFixed32.isNotEmpty()) { + if (repeatedFixed32.isNotEmpty()) { encoder.writePackedFixed32(fieldNr = 37, value = repeatedFixed32) } - if (repeatedFixed64.isNotEmpty()) { + if (repeatedFixed64.isNotEmpty()) { encoder.writePackedFixed64(fieldNr = 38, value = repeatedFixed64) } - if (repeatedSfixed32.isNotEmpty()) { + if (repeatedSfixed32.isNotEmpty()) { encoder.writePackedSFixed32(fieldNr = 39, value = repeatedSfixed32) } - if (repeatedSfixed64.isNotEmpty()) { + if (repeatedSfixed64.isNotEmpty()) { encoder.writePackedSFixed64(fieldNr = 40, value = repeatedSfixed64) } - if (repeatedFloat.isNotEmpty()) { + if (repeatedFloat.isNotEmpty()) { encoder.writePackedFloat(fieldNr = 41, value = repeatedFloat) } - if (repeatedDouble.isNotEmpty()) { + if (repeatedDouble.isNotEmpty()) { encoder.writePackedDouble(fieldNr = 42, value = repeatedDouble) } - if (repeatedBool.isNotEmpty()) { - encoder.writePackedBool(fieldNr = 43, value = repeatedBool, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool)) + if (repeatedBool.isNotEmpty()) { + encoder.writePackedBool( + fieldNr = 43, + value = repeatedBool, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool) + ) } - if (repeatedString.isNotEmpty()) { - repeatedString.forEach { + if (repeatedString.isNotEmpty()) { + repeatedString.forEach { encoder.writeString(44, it) } } - if (repeatedBytes.isNotEmpty()) { - repeatedBytes.forEach { + if (repeatedBytes.isNotEmpty()) { + repeatedBytes.forEach { encoder.writeBytes(45, it) } } - if (repeatedNestedMessage.isNotEmpty()) { - repeatedNestedMessage.forEach { + if (repeatedNestedMessage.isNotEmpty()) { + repeatedNestedMessage.forEach { encoder.writeMessage(fieldNr = 48, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedForeignMessage.isNotEmpty()) { - repeatedForeignMessage.forEach { + if (repeatedForeignMessage.isNotEmpty()) { + repeatedForeignMessage.forEach { encoder.writeMessage(fieldNr = 49, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedNestedEnum.isNotEmpty()) { - encoder.writePackedEnum(fieldNr = 51, value = repeatedNestedEnum.map { it.number }, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number })) + if (repeatedNestedEnum.isNotEmpty()) { + encoder.writePackedEnum( + fieldNr = 51, + value = repeatedNestedEnum.map { it.number }, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number }) + ) } - if (repeatedForeignEnum.isNotEmpty()) { - encoder.writePackedEnum(fieldNr = 52, value = repeatedForeignEnum.map { it.number }, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number })) + if (repeatedForeignEnum.isNotEmpty()) { + encoder.writePackedEnum( + fieldNr = 52, + value = repeatedForeignEnum.map { it.number }, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number }) + ) } - if (repeatedStringPiece.isNotEmpty()) { - repeatedStringPiece.forEach { + if (repeatedStringPiece.isNotEmpty()) { + repeatedStringPiece.forEach { encoder.writeString(54, it) } } - if (repeatedCord.isNotEmpty()) { - repeatedCord.forEach { + if (repeatedCord.isNotEmpty()) { + repeatedCord.forEach { encoder.writeString(55, it) } } - if (packedInt32.isNotEmpty()) { - encoder.writePackedInt32(fieldNr = 75, value = packedInt32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32)) + if (packedInt32.isNotEmpty()) { + encoder.writePackedInt32( + fieldNr = 75, + value = packedInt32, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32) + ) } - if (packedInt64.isNotEmpty()) { - encoder.writePackedInt64(fieldNr = 76, value = packedInt64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64)) + if (packedInt64.isNotEmpty()) { + encoder.writePackedInt64( + fieldNr = 76, + value = packedInt64, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64) + ) } - if (packedUint32.isNotEmpty()) { - encoder.writePackedUInt32(fieldNr = 77, value = packedUint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32)) + if (packedUint32.isNotEmpty()) { + encoder.writePackedUInt32( + fieldNr = 77, + value = packedUint32, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32) + ) } - if (packedUint64.isNotEmpty()) { - encoder.writePackedUInt64(fieldNr = 78, value = packedUint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64)) + if (packedUint64.isNotEmpty()) { + encoder.writePackedUInt64( + fieldNr = 78, + value = packedUint64, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64) + ) } - if (packedSint32.isNotEmpty()) { - encoder.writePackedSInt32(fieldNr = 79, value = packedSint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32)) + if (packedSint32.isNotEmpty()) { + encoder.writePackedSInt32( + fieldNr = 79, + value = packedSint32, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32) + ) } - if (packedSint64.isNotEmpty()) { - encoder.writePackedSInt64(fieldNr = 80, value = packedSint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64)) + if (packedSint64.isNotEmpty()) { + encoder.writePackedSInt64( + fieldNr = 80, + value = packedSint64, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64) + ) } - if (packedFixed32.isNotEmpty()) { + if (packedFixed32.isNotEmpty()) { encoder.writePackedFixed32(fieldNr = 81, value = packedFixed32) } - if (packedFixed64.isNotEmpty()) { + if (packedFixed64.isNotEmpty()) { encoder.writePackedFixed64(fieldNr = 82, value = packedFixed64) } - if (packedSfixed32.isNotEmpty()) { + if (packedSfixed32.isNotEmpty()) { encoder.writePackedSFixed32(fieldNr = 83, value = packedSfixed32) } - if (packedSfixed64.isNotEmpty()) { + if (packedSfixed64.isNotEmpty()) { encoder.writePackedSFixed64(fieldNr = 84, value = packedSfixed64) } - if (packedFloat.isNotEmpty()) { + if (packedFloat.isNotEmpty()) { encoder.writePackedFloat(fieldNr = 85, value = packedFloat) } - if (packedDouble.isNotEmpty()) { + if (packedDouble.isNotEmpty()) { encoder.writePackedDouble(fieldNr = 86, value = packedDouble) } - if (packedBool.isNotEmpty()) { - encoder.writePackedBool(fieldNr = 87, value = packedBool, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool)) + if (packedBool.isNotEmpty()) { + encoder.writePackedBool( + fieldNr = 87, + value = packedBool, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool) + ) } - if (packedNestedEnum.isNotEmpty()) { - encoder.writePackedEnum(fieldNr = 88, value = packedNestedEnum.map { it.number }, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number })) + if (packedNestedEnum.isNotEmpty()) { + encoder.writePackedEnum( + fieldNr = 88, + value = packedNestedEnum.map { it.number }, + fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number }) + ) } - if (unpackedInt32.isNotEmpty()) { - unpackedInt32.forEach { + if (unpackedInt32.isNotEmpty()) { + unpackedInt32.forEach { encoder.writeInt32(89, it) } } - if (unpackedInt64.isNotEmpty()) { - unpackedInt64.forEach { + if (unpackedInt64.isNotEmpty()) { + unpackedInt64.forEach { encoder.writeInt64(90, it) } } - if (unpackedUint32.isNotEmpty()) { - unpackedUint32.forEach { + if (unpackedUint32.isNotEmpty()) { + unpackedUint32.forEach { encoder.writeUInt32(91, it) } } - if (unpackedUint64.isNotEmpty()) { - unpackedUint64.forEach { + if (unpackedUint64.isNotEmpty()) { + unpackedUint64.forEach { encoder.writeUInt64(92, it) } } - if (unpackedSint32.isNotEmpty()) { - unpackedSint32.forEach { + if (unpackedSint32.isNotEmpty()) { + unpackedSint32.forEach { encoder.writeSInt32(93, it) } } - if (unpackedSint64.isNotEmpty()) { - unpackedSint64.forEach { + if (unpackedSint64.isNotEmpty()) { + unpackedSint64.forEach { encoder.writeSInt64(94, it) } } - if (unpackedFixed32.isNotEmpty()) { - unpackedFixed32.forEach { + if (unpackedFixed32.isNotEmpty()) { + unpackedFixed32.forEach { encoder.writeFixed32(95, it) } } - if (unpackedFixed64.isNotEmpty()) { - unpackedFixed64.forEach { + if (unpackedFixed64.isNotEmpty()) { + unpackedFixed64.forEach { encoder.writeFixed64(96, it) } } - if (unpackedSfixed32.isNotEmpty()) { - unpackedSfixed32.forEach { + if (unpackedSfixed32.isNotEmpty()) { + unpackedSfixed32.forEach { encoder.writeSFixed32(97, it) } } - if (unpackedSfixed64.isNotEmpty()) { - unpackedSfixed64.forEach { + if (unpackedSfixed64.isNotEmpty()) { + unpackedSfixed64.forEach { encoder.writeSFixed64(98, it) } } - if (unpackedFloat.isNotEmpty()) { - unpackedFloat.forEach { + if (unpackedFloat.isNotEmpty()) { + unpackedFloat.forEach { encoder.writeFloat(99, it) } } - if (unpackedDouble.isNotEmpty()) { - unpackedDouble.forEach { + if (unpackedDouble.isNotEmpty()) { + unpackedDouble.forEach { encoder.writeDouble(100, it) } } - if (unpackedBool.isNotEmpty()) { - unpackedBool.forEach { + if (unpackedBool.isNotEmpty()) { + unpackedBool.forEach { encoder.writeBool(101, it) } } - if (unpackedNestedEnum.isNotEmpty()) { - unpackedNestedEnum.forEach { + if (unpackedNestedEnum.isNotEmpty()) { + unpackedNestedEnum.forEach { encoder.writeEnum(102, it.number) } } - if (mapInt32Int32.isNotEmpty()) { + if (mapInt32Int32.isNotEmpty()) { mapInt32Int32.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 56, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 56, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapInt64Int64.isNotEmpty()) { + if (mapInt64Int64.isNotEmpty()) { mapInt64Int64.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 57, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 57, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapUint32Uint32.isNotEmpty()) { + if (mapUint32Uint32.isNotEmpty()) { mapUint32Uint32.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 58, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 58, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapUint64Uint64.isNotEmpty()) { + if (mapUint64Uint64.isNotEmpty()) { mapUint64Uint64.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 59, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 59, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSint32Sint32.isNotEmpty()) { + if (mapSint32Sint32.isNotEmpty()) { mapSint32Sint32.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 60, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 60, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSint64Sint64.isNotEmpty()) { + if (mapSint64Sint64.isNotEmpty()) { mapSint64Sint64.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 61, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 61, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapFixed32Fixed32.isNotEmpty()) { + if (mapFixed32Fixed32.isNotEmpty()) { mapFixed32Fixed32.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 62, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 62, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapFixed64Fixed64.isNotEmpty()) { + if (mapFixed64Fixed64.isNotEmpty()) { mapFixed64Fixed64.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 63, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 63, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSfixed32Sfixed32.isNotEmpty()) { + if (mapSfixed32Sfixed32.isNotEmpty()) { mapSfixed32Sfixed32.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 64, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 64, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSfixed64Sfixed64.isNotEmpty()) { + if (mapSfixed64Sfixed64.isNotEmpty()) { mapSfixed64Sfixed64.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 65, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 65, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapInt32Float.isNotEmpty()) { + if (mapInt32Float.isNotEmpty()) { mapInt32Float.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 66, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 66, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapInt32Double.isNotEmpty()) { + if (mapInt32Double.isNotEmpty()) { mapInt32Double.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 67, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 67, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapBoolBool.isNotEmpty()) { + if (mapBoolBool.isNotEmpty()) { mapBoolBool.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 68, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 68, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringString.isNotEmpty()) { + if (mapStringString.isNotEmpty()) { mapStringString.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 69, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 69, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringBytes.isNotEmpty()) { + if (mapStringBytes.isNotEmpty()) { mapStringBytes.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 70, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 70, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringNestedMessage.isNotEmpty()) { + if (mapStringNestedMessage.isNotEmpty()) { mapStringNestedMessage.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 71, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 71, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringForeignMessage.isNotEmpty()) { + if (mapStringForeignMessage.isNotEmpty()) { mapStringForeignMessage.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 72, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 72, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringNestedEnum.isNotEmpty()) { + if (mapStringNestedEnum.isNotEmpty()) { mapStringNestedEnum.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 73, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 73, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringForeignEnum.isNotEmpty()) { + if (mapStringForeignEnum.isNotEmpty()) { mapStringForeignEnum.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 74, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 74, value = entry.asInternal()) { encodeWith(it) } + } } } - if (presenceMask[3]) { + if (presenceMask[3]) { encoder.writeMessage(fieldNr = 201, value = optionalBoolWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[4]) { + if (presenceMask[4]) { encoder.writeMessage(fieldNr = 202, value = optionalInt32Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[5]) { + if (presenceMask[5]) { encoder.writeMessage(fieldNr = 203, value = optionalInt64Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[6]) { + if (presenceMask[6]) { encoder.writeMessage(fieldNr = 204, value = optionalUint32Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[7]) { + if (presenceMask[7]) { encoder.writeMessage(fieldNr = 205, value = optionalUint64Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[8]) { + if (presenceMask[8]) { encoder.writeMessage(fieldNr = 206, value = optionalFloatWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[9]) { + if (presenceMask[9]) { encoder.writeMessage(fieldNr = 207, value = optionalDoubleWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[10]) { + if (presenceMask[10]) { encoder.writeMessage(fieldNr = 208, value = optionalStringWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[11]) { + if (presenceMask[11]) { encoder.writeMessage(fieldNr = 209, value = optionalBytesWrapper.asInternal()) { encodeWith(it) } } - if (repeatedBoolWrapper.isNotEmpty()) { - repeatedBoolWrapper.forEach { + if (repeatedBoolWrapper.isNotEmpty()) { + repeatedBoolWrapper.forEach { encoder.writeMessage(fieldNr = 211, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedInt32Wrapper.isNotEmpty()) { - repeatedInt32Wrapper.forEach { + if (repeatedInt32Wrapper.isNotEmpty()) { + repeatedInt32Wrapper.forEach { encoder.writeMessage(fieldNr = 212, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedInt64Wrapper.isNotEmpty()) { - repeatedInt64Wrapper.forEach { + if (repeatedInt64Wrapper.isNotEmpty()) { + repeatedInt64Wrapper.forEach { encoder.writeMessage(fieldNr = 213, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedUint32Wrapper.isNotEmpty()) { - repeatedUint32Wrapper.forEach { + if (repeatedUint32Wrapper.isNotEmpty()) { + repeatedUint32Wrapper.forEach { encoder.writeMessage(fieldNr = 214, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedUint64Wrapper.isNotEmpty()) { - repeatedUint64Wrapper.forEach { + if (repeatedUint64Wrapper.isNotEmpty()) { + repeatedUint64Wrapper.forEach { encoder.writeMessage(fieldNr = 215, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedFloatWrapper.isNotEmpty()) { - repeatedFloatWrapper.forEach { + if (repeatedFloatWrapper.isNotEmpty()) { + repeatedFloatWrapper.forEach { encoder.writeMessage(fieldNr = 216, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedDoubleWrapper.isNotEmpty()) { - repeatedDoubleWrapper.forEach { + if (repeatedDoubleWrapper.isNotEmpty()) { + repeatedDoubleWrapper.forEach { encoder.writeMessage(fieldNr = 217, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedStringWrapper.isNotEmpty()) { - repeatedStringWrapper.forEach { + if (repeatedStringWrapper.isNotEmpty()) { + repeatedStringWrapper.forEach { encoder.writeMessage(fieldNr = 218, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedBytesWrapper.isNotEmpty()) { - repeatedBytesWrapper.forEach { + if (repeatedBytesWrapper.isNotEmpty()) { + repeatedBytesWrapper.forEach { encoder.writeMessage(fieldNr = 219, value = it.asInternal()) { encodeWith(it) } } } - if (presenceMask[12]) { + if (presenceMask[12]) { encoder.writeMessage(fieldNr = 301, value = optionalDuration.asInternal()) { encodeWith(it) } } - if (presenceMask[13]) { + if (presenceMask[13]) { encoder.writeMessage(fieldNr = 302, value = optionalTimestamp.asInternal()) { encodeWith(it) } } - if (presenceMask[14]) { + if (presenceMask[14]) { encoder.writeMessage(fieldNr = 303, value = optionalFieldMask.asInternal()) { encodeWith(it) } } - if (presenceMask[15]) { + if (presenceMask[15]) { encoder.writeMessage(fieldNr = 304, value = optionalStruct.asInternal()) { encodeWith(it) } } - if (presenceMask[16]) { + if (presenceMask[16]) { encoder.writeMessage(fieldNr = 305, value = optionalAny.asInternal()) { encodeWith(it) } } - if (presenceMask[17]) { + if (presenceMask[17]) { encoder.writeMessage(fieldNr = 306, value = optionalValue.asInternal()) { encodeWith(it) } } - if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { + if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { encoder.writeEnum(fieldNr = 307, value = optionalNullValue.number) } - if (repeatedDuration.isNotEmpty()) { - repeatedDuration.forEach { + if (repeatedDuration.isNotEmpty()) { + repeatedDuration.forEach { encoder.writeMessage(fieldNr = 311, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedTimestamp.isNotEmpty()) { - repeatedTimestamp.forEach { + if (repeatedTimestamp.isNotEmpty()) { + repeatedTimestamp.forEach { encoder.writeMessage(fieldNr = 312, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedFieldmask.isNotEmpty()) { - repeatedFieldmask.forEach { + if (repeatedFieldmask.isNotEmpty()) { + repeatedFieldmask.forEach { encoder.writeMessage(fieldNr = 313, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedStruct.isNotEmpty()) { - repeatedStruct.forEach { + if (repeatedStruct.isNotEmpty()) { + repeatedStruct.forEach { encoder.writeMessage(fieldNr = 324, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedAny.isNotEmpty()) { - repeatedAny.forEach { + if (repeatedAny.isNotEmpty()) { + repeatedAny.forEach { encoder.writeMessage(fieldNr = 315, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedValue.isNotEmpty()) { - repeatedValue.forEach { + if (repeatedValue.isNotEmpty()) { + repeatedValue.forEach { encoder.writeMessage(fieldNr = 316, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedListValue.isNotEmpty()) { - repeatedListValue.forEach { + if (repeatedListValue.isNotEmpty()) { + repeatedListValue.forEach { encoder.writeMessage(fieldNr = 317, value = it.asInternal()) { encodeWith(it) } } } - if (fieldname1 != 0) { + if (fieldname1 != 0) { encoder.writeInt32(fieldNr = 401, value = fieldname1) } - if (fieldName2 != 0) { + if (fieldName2 != 0) { encoder.writeInt32(fieldNr = 402, value = fieldName2) } - if (FieldName3 != 0) { + if (FieldName3 != 0) { encoder.writeInt32(fieldNr = 403, value = FieldName3) } - if (field_Name4_ != 0) { + if (field_Name4_ != 0) { encoder.writeInt32(fieldNr = 404, value = field_Name4_) } - if (field0name5 != 0) { + if (field0name5 != 0) { encoder.writeInt32(fieldNr = 405, value = field0name5) } - if (field_0Name6 != 0) { + if (field_0Name6 != 0) { encoder.writeInt32(fieldNr = 406, value = field_0Name6) } - if (fieldName7 != 0) { + if (fieldName7 != 0) { encoder.writeInt32(fieldNr = 407, value = fieldName7) } - if (FieldName8 != 0) { + if (FieldName8 != 0) { encoder.writeInt32(fieldNr = 408, value = FieldName8) } - if (field_Name9 != 0) { + if (field_Name9 != 0) { encoder.writeInt32(fieldNr = 409, value = field_Name9) } - if (Field_Name10 != 0) { + if (Field_Name10 != 0) { encoder.writeInt32(fieldNr = 410, value = Field_Name10) } - if (FIELD_NAME11 != 0) { + if (FIELD_NAME11 != 0) { encoder.writeInt32(fieldNr = 411, value = FIELD_NAME11) } - if (FIELDName12 != 0) { + if (FIELDName12 != 0) { encoder.writeInt32(fieldNr = 412, value = FIELDName12) } - if (_FieldName13 != 0) { + if (_FieldName13 != 0) { encoder.writeInt32(fieldNr = 413, value = _FieldName13) } - if (__FieldName14 != 0) { + if (__FieldName14 != 0) { encoder.writeInt32(fieldNr = 414, value = __FieldName14) } - if (field_Name15 != 0) { + if (field_Name15 != 0) { encoder.writeInt32(fieldNr = 415, value = field_Name15) } - if (field__Name16 != 0) { + if (field__Name16 != 0) { encoder.writeInt32(fieldNr = 416, value = field__Name16) } - if (fieldName17__ != 0) { + if (fieldName17__ != 0) { encoder.writeInt32(fieldNr = 417, value = fieldName17__) } - if (FieldName18__ != 0) { + if (FieldName18__ != 0) { encoder.writeInt32(fieldNr = 418, value = FieldName18__) } - oneofField?.also { - when (val value = it) { - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { + oneofField?.also { + when (val value = it) { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { encoder.writeUInt32(fieldNr = 111, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { encoder.writeMessage(fieldNr = 112, value = value.value.asInternal()) { encodeWith(it) } } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofString -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofString -> { encoder.writeString(fieldNr = 113, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { encoder.writeBytes(fieldNr = 114, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBool -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBool -> { encoder.writeBool(fieldNr = 115, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { encoder.writeUInt64(fieldNr = 116, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { encoder.writeFloat(fieldNr = 117, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { encoder.writeDouble(fieldNr = 118, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { encoder.writeEnum(fieldNr = 119, value = value.value.number) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { encoder.writeEnum(fieldNr = 120, value = value.value.number) } } @@ -1586,1730 +1720,2457 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.encodeWi } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalInt32 = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalInt64 = decoder.readInt64() } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalUint32 = decoder.readUInt32() } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalUint64 = decoder.readUInt64() } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalSint32 = decoder.readSInt32() } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalSint64 = decoder.readSInt64() } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.optionalFixed32 = decoder.readFixed32() } - tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.optionalFixed64 = decoder.readFixed64() } - tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.optionalSfixed32 = decoder.readSFixed32() } - tag.fieldNr == 10 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 10 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.optionalSfixed64 = decoder.readSFixed64() } - tag.fieldNr == 11 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 11 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.optionalFloat = decoder.readFloat() } - tag.fieldNr == 12 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 12 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.optionalDouble = decoder.readDouble() } - tag.fieldNr == 13 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 13 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalBool = decoder.readBool() } - tag.fieldNr == 14 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 14 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalString = decoder.readString() } - tag.fieldNr == 15 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 15 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalBytes = decoder.readBytes() } - tag.fieldNr == 18 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { - msg.optionalNestedMessage = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + tag.fieldNr == 18 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { + msg.optionalNestedMessage = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } - decoder.readMessage(msg.optionalNestedMessage.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) + decoder.readMessage( + msg.optionalNestedMessage.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith + ) } - tag.fieldNr == 19 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[1]) { + tag.fieldNr == 19 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[1]) { msg.optionalForeignMessage = com.google.protobuf_test_messages.proto3.ForeignMessageInternal() } - decoder.readMessage(msg.optionalForeignMessage.asInternal(), com.google.protobuf_test_messages.proto3.ForeignMessageInternal::decodeWith) + decoder.readMessage( + msg.optionalForeignMessage.asInternal(), + com.google.protobuf_test_messages.proto3.ForeignMessageInternal::decodeWith + ) } - tag.fieldNr == 21 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.optionalNestedEnum = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 21 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.optionalNestedEnum = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) } - tag.fieldNr == 22 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.optionalForeignEnum = com.google.protobuf_test_messages.proto3.ForeignEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 22 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.optionalForeignEnum = + com.google.protobuf_test_messages.proto3.ForeignEnum.fromNumber(decoder.readEnum()) } - tag.fieldNr == 23 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.optionalAliasedEnum = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 23 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.optionalAliasedEnum = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.fromNumber(decoder.readEnum()) } - tag.fieldNr == 24 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 24 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalStringPiece = decoder.readString() } - tag.fieldNr == 25 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 25 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalCord = decoder.readString() } - tag.fieldNr == 27 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[2]) { + tag.fieldNr == 27 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[2]) { msg.recursiveMessage = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } - decoder.readMessage(msg.recursiveMessage.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal::decodeWith) + decoder.readMessage( + msg.recursiveMessage.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal::decodeWith + ) } - tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedInt32 += decoder.readPackedInt32() } - tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt32() (msg.repeatedInt32 as MutableList).add(elem) } - tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedInt64 += decoder.readPackedInt64() } - tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt64() (msg.repeatedInt64 as MutableList).add(elem) } - tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedUint32 += decoder.readPackedUInt32() } - tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt32() (msg.repeatedUint32 as MutableList).add(elem) } - tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedUint64 += decoder.readPackedUInt64() } - tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt64() (msg.repeatedUint64 as MutableList).add(elem) } - tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSint32 += decoder.readPackedSInt32() } - tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt32() (msg.repeatedSint32 as MutableList).add(elem) } - tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSint64 += decoder.readPackedSInt64() } - tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt64() (msg.repeatedSint64 as MutableList).add(elem) } - tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedFixed32 += decoder.readPackedFixed32() } - tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFixed32() (msg.repeatedFixed32 as MutableList).add(elem) } - tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedFixed64 += decoder.readPackedFixed64() } - tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readFixed64() (msg.repeatedFixed64 as MutableList).add(elem) } - tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSfixed32 += decoder.readPackedSFixed32() } - tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readSFixed32() (msg.repeatedSfixed32 as MutableList).add(elem) } - tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSfixed64 += decoder.readPackedSFixed64() } - tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readSFixed64() (msg.repeatedSfixed64 as MutableList).add(elem) } - tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedFloat += decoder.readPackedFloat() } - tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFloat() (msg.repeatedFloat as MutableList).add(elem) } - tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedDouble += decoder.readPackedDouble() } - tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readDouble() (msg.repeatedDouble as MutableList).add(elem) } - tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedBool += decoder.readPackedBool() } - tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readBool() (msg.repeatedBool as MutableList).add(elem) } - tag.fieldNr == 44 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 44 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.repeatedString as MutableList).add(elem) } - tag.fieldNr == 45 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 45 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readBytes() (msg.repeatedBytes as MutableList).add(elem) } - tag.fieldNr == 48 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 48 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() - decoder.readMessage(elem.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) + decoder.readMessage( + elem.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith + ) (msg.repeatedNestedMessage as MutableList).add(elem) } - tag.fieldNr == 49 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 49 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf_test_messages.proto3.ForeignMessageInternal() - decoder.readMessage(elem.asInternal(), com.google.protobuf_test_messages.proto3.ForeignMessageInternal::decodeWith) + decoder.readMessage( + elem.asInternal(), + com.google.protobuf_test_messages.proto3.ForeignMessageInternal::decodeWith + ) (msg.repeatedForeignMessage as MutableList).add(elem) } - tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.repeatedNestedEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } + tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.repeatedNestedEnum += decoder.readPackedEnum() + .map { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } } - tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - val elem = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + val elem = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) (msg.repeatedNestedEnum as MutableList).add(elem) } - tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.repeatedForeignEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.proto3.ForeignEnum.fromNumber(it) } + tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.repeatedForeignEnum += decoder.readPackedEnum() + .map { com.google.protobuf_test_messages.proto3.ForeignEnum.fromNumber(it) } } - tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = com.google.protobuf_test_messages.proto3.ForeignEnum.fromNumber(decoder.readEnum()) (msg.repeatedForeignEnum as MutableList).add(elem) } - tag.fieldNr == 54 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 54 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.repeatedStringPiece as MutableList).add(elem) } - tag.fieldNr == 55 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 55 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.repeatedCord as MutableList).add(elem) } - tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedInt32 += decoder.readPackedInt32() } - tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt32() (msg.packedInt32 as MutableList).add(elem) } - tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedInt64 += decoder.readPackedInt64() } - tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt64() (msg.packedInt64 as MutableList).add(elem) } - tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedUint32 += decoder.readPackedUInt32() } - tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt32() (msg.packedUint32 as MutableList).add(elem) } - tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedUint64 += decoder.readPackedUInt64() } - tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt64() (msg.packedUint64 as MutableList).add(elem) } - tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSint32 += decoder.readPackedSInt32() } - tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt32() (msg.packedSint32 as MutableList).add(elem) } - tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSint64 += decoder.readPackedSInt64() } - tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt64() (msg.packedSint64 as MutableList).add(elem) } - tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedFixed32 += decoder.readPackedFixed32() } - tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFixed32() (msg.packedFixed32 as MutableList).add(elem) } - tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedFixed64 += decoder.readPackedFixed64() } - tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readFixed64() (msg.packedFixed64 as MutableList).add(elem) } - tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSfixed32 += decoder.readPackedSFixed32() } - tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readSFixed32() (msg.packedSfixed32 as MutableList).add(elem) } - tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSfixed64 += decoder.readPackedSFixed64() } - tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readSFixed64() (msg.packedSfixed64 as MutableList).add(elem) } - tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedFloat += decoder.readPackedFloat() } - tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFloat() (msg.packedFloat as MutableList).add(elem) } - tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedDouble += decoder.readPackedDouble() } - tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readDouble() (msg.packedDouble as MutableList).add(elem) } - tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedBool += decoder.readPackedBool() } - tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readBool() (msg.packedBool as MutableList).add(elem) } - tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.packedNestedEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } + tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.packedNestedEnum += decoder.readPackedEnum() + .map { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } } - tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - val elem = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + val elem = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) (msg.packedNestedEnum as MutableList).add(elem) } - tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedInt32 += decoder.readPackedInt32() } - tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt32() (msg.unpackedInt32 as MutableList).add(elem) } - tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedInt64 += decoder.readPackedInt64() } - tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt64() (msg.unpackedInt64 as MutableList).add(elem) } - tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedUint32 += decoder.readPackedUInt32() } - tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt32() (msg.unpackedUint32 as MutableList).add(elem) } - tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedUint64 += decoder.readPackedUInt64() } - tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt64() (msg.unpackedUint64 as MutableList).add(elem) } - tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSint32 += decoder.readPackedSInt32() } - tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt32() (msg.unpackedSint32 as MutableList).add(elem) } - tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSint64 += decoder.readPackedSInt64() } - tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt64() (msg.unpackedSint64 as MutableList).add(elem) } - tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedFixed32 += decoder.readPackedFixed32() } - tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFixed32() (msg.unpackedFixed32 as MutableList).add(elem) } - tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedFixed64 += decoder.readPackedFixed64() } - tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readFixed64() (msg.unpackedFixed64 as MutableList).add(elem) } - tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSfixed32 += decoder.readPackedSFixed32() } - tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readSFixed32() (msg.unpackedSfixed32 as MutableList).add(elem) } - tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSfixed64 += decoder.readPackedSFixed64() } - tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readSFixed64() (msg.unpackedSfixed64 as MutableList).add(elem) } - tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedFloat += decoder.readPackedFloat() } - tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFloat() (msg.unpackedFloat as MutableList).add(elem) } - tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedDouble += decoder.readPackedDouble() } - tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readDouble() (msg.unpackedDouble as MutableList).add(elem) } - tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedBool += decoder.readPackedBool() } - tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readBool() (msg.unpackedBool as MutableList).add(elem) } - tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.unpackedNestedEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } + tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.unpackedNestedEnum += decoder.readPackedEnum() + .map { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } } - tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - val elem = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + val elem = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) (msg.unpackedNestedEnum as MutableList).add(elem) } - tag.fieldNr == 56 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal::decodeWith) + tag.fieldNr == 56 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal::decodeWith + ) (msg.mapInt32Int32 as MutableMap)[key] = value } } - tag.fieldNr == 57 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal::decodeWith) + tag.fieldNr == 57 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal::decodeWith + ) (msg.mapInt64Int64 as MutableMap)[key] = value } } - tag.fieldNr == 58 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal::decodeWith) + tag.fieldNr == 58 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal::decodeWith + ) (msg.mapUint32Uint32 as MutableMap)[key] = value } } - tag.fieldNr == 59 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal::decodeWith) + tag.fieldNr == 59 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal::decodeWith + ) (msg.mapUint64Uint64 as MutableMap)[key] = value } } - tag.fieldNr == 60 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal::decodeWith) + tag.fieldNr == 60 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal::decodeWith + ) (msg.mapSint32Sint32 as MutableMap)[key] = value } } - tag.fieldNr == 61 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal::decodeWith) + tag.fieldNr == 61 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal::decodeWith + ) (msg.mapSint64Sint64 as MutableMap)[key] = value } } - tag.fieldNr == 62 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal::decodeWith) + tag.fieldNr == 62 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal::decodeWith + ) (msg.mapFixed32Fixed32 as MutableMap)[key] = value } } - tag.fieldNr == 63 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal::decodeWith) + tag.fieldNr == 63 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal::decodeWith + ) (msg.mapFixed64Fixed64 as MutableMap)[key] = value } } - tag.fieldNr == 64 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal::decodeWith) + tag.fieldNr == 64 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal::decodeWith + ) (msg.mapSfixed32Sfixed32 as MutableMap)[key] = value } } - tag.fieldNr == 65 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal::decodeWith) + tag.fieldNr == 65 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal::decodeWith + ) (msg.mapSfixed64Sfixed64 as MutableMap)[key] = value } } - tag.fieldNr == 66 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal::decodeWith) + tag.fieldNr == 66 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal::decodeWith + ) (msg.mapInt32Float as MutableMap)[key] = value } } - tag.fieldNr == 67 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal::decodeWith) + tag.fieldNr == 67 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal::decodeWith + ) (msg.mapInt32Double as MutableMap)[key] = value } } - tag.fieldNr == 68 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal::decodeWith) + tag.fieldNr == 68 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal::decodeWith + ) (msg.mapBoolBool as MutableMap)[key] = value } } - tag.fieldNr == 69 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal::decodeWith) + tag.fieldNr == 69 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal::decodeWith + ) (msg.mapStringString as MutableMap)[key] = value } } - tag.fieldNr == 70 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal::decodeWith) + tag.fieldNr == 70 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal::decodeWith + ) (msg.mapStringBytes as MutableMap)[key] = value } } - tag.fieldNr == 71 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal::decodeWith) + tag.fieldNr == 71 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal::decodeWith + ) (msg.mapStringNestedMessage as MutableMap)[key] = value } } - tag.fieldNr == 72 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal::decodeWith) + tag.fieldNr == 72 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal::decodeWith + ) (msg.mapStringForeignMessage as MutableMap)[key] = value } } - tag.fieldNr == 73 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal::decodeWith) + tag.fieldNr == 73 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal::decodeWith + ) (msg.mapStringNestedEnum as MutableMap)[key] = value } } - tag.fieldNr == 74 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal()) { - decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal::decodeWith) + tag.fieldNr == 74 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal()) { + decoder.readMessage( + this.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal::decodeWith + ) (msg.mapStringForeignEnum as MutableMap)[key] = value } } - tag.fieldNr == 201 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[3]) { + tag.fieldNr == 201 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[3]) { msg.optionalBoolWrapper = com.google.protobuf.kotlin.BoolValueInternal() } - decoder.readMessage(msg.optionalBoolWrapper.asInternal(), com.google.protobuf.kotlin.BoolValueInternal::decodeWith) + decoder.readMessage( + msg.optionalBoolWrapper.asInternal(), + com.google.protobuf.kotlin.BoolValueInternal::decodeWith + ) } - tag.fieldNr == 202 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[4]) { + tag.fieldNr == 202 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[4]) { msg.optionalInt32Wrapper = com.google.protobuf.kotlin.Int32ValueInternal() } - decoder.readMessage(msg.optionalInt32Wrapper.asInternal(), com.google.protobuf.kotlin.Int32ValueInternal::decodeWith) + decoder.readMessage( + msg.optionalInt32Wrapper.asInternal(), + com.google.protobuf.kotlin.Int32ValueInternal::decodeWith + ) } - tag.fieldNr == 203 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[5]) { + tag.fieldNr == 203 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[5]) { msg.optionalInt64Wrapper = com.google.protobuf.kotlin.Int64ValueInternal() } - decoder.readMessage(msg.optionalInt64Wrapper.asInternal(), com.google.protobuf.kotlin.Int64ValueInternal::decodeWith) + decoder.readMessage( + msg.optionalInt64Wrapper.asInternal(), + com.google.protobuf.kotlin.Int64ValueInternal::decodeWith + ) } - tag.fieldNr == 204 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[6]) { + tag.fieldNr == 204 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[6]) { msg.optionalUint32Wrapper = com.google.protobuf.kotlin.UInt32ValueInternal() } - decoder.readMessage(msg.optionalUint32Wrapper.asInternal(), com.google.protobuf.kotlin.UInt32ValueInternal::decodeWith) + decoder.readMessage( + msg.optionalUint32Wrapper.asInternal(), + com.google.protobuf.kotlin.UInt32ValueInternal::decodeWith + ) } - tag.fieldNr == 205 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[7]) { + tag.fieldNr == 205 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[7]) { msg.optionalUint64Wrapper = com.google.protobuf.kotlin.UInt64ValueInternal() } - decoder.readMessage(msg.optionalUint64Wrapper.asInternal(), com.google.protobuf.kotlin.UInt64ValueInternal::decodeWith) + decoder.readMessage( + msg.optionalUint64Wrapper.asInternal(), + com.google.protobuf.kotlin.UInt64ValueInternal::decodeWith + ) } - tag.fieldNr == 206 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[8]) { + tag.fieldNr == 206 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[8]) { msg.optionalFloatWrapper = com.google.protobuf.kotlin.FloatValueInternal() } - decoder.readMessage(msg.optionalFloatWrapper.asInternal(), com.google.protobuf.kotlin.FloatValueInternal::decodeWith) + decoder.readMessage( + msg.optionalFloatWrapper.asInternal(), + com.google.protobuf.kotlin.FloatValueInternal::decodeWith + ) } - tag.fieldNr == 207 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[9]) { + tag.fieldNr == 207 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[9]) { msg.optionalDoubleWrapper = com.google.protobuf.kotlin.DoubleValueInternal() } - decoder.readMessage(msg.optionalDoubleWrapper.asInternal(), com.google.protobuf.kotlin.DoubleValueInternal::decodeWith) + decoder.readMessage( + msg.optionalDoubleWrapper.asInternal(), + com.google.protobuf.kotlin.DoubleValueInternal::decodeWith + ) } - tag.fieldNr == 208 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[10]) { + tag.fieldNr == 208 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[10]) { msg.optionalStringWrapper = com.google.protobuf.kotlin.StringValueInternal() } - decoder.readMessage(msg.optionalStringWrapper.asInternal(), com.google.protobuf.kotlin.StringValueInternal::decodeWith) + decoder.readMessage( + msg.optionalStringWrapper.asInternal(), + com.google.protobuf.kotlin.StringValueInternal::decodeWith + ) } - tag.fieldNr == 209 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[11]) { + tag.fieldNr == 209 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[11]) { msg.optionalBytesWrapper = com.google.protobuf.kotlin.BytesValueInternal() } - decoder.readMessage(msg.optionalBytesWrapper.asInternal(), com.google.protobuf.kotlin.BytesValueInternal::decodeWith) + decoder.readMessage( + msg.optionalBytesWrapper.asInternal(), + com.google.protobuf.kotlin.BytesValueInternal::decodeWith + ) } - tag.fieldNr == 211 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 211 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.BoolValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.BoolValueInternal::decodeWith) (msg.repeatedBoolWrapper as MutableList).add(elem) } - tag.fieldNr == 212 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 212 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.Int32ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.Int32ValueInternal::decodeWith) (msg.repeatedInt32Wrapper as MutableList).add(elem) } - tag.fieldNr == 213 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 213 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.Int64ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.Int64ValueInternal::decodeWith) (msg.repeatedInt64Wrapper as MutableList).add(elem) } - tag.fieldNr == 214 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 214 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.UInt32ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.UInt32ValueInternal::decodeWith) (msg.repeatedUint32Wrapper as MutableList).add(elem) } - tag.fieldNr == 215 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 215 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.UInt64ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.UInt64ValueInternal::decodeWith) (msg.repeatedUint64Wrapper as MutableList).add(elem) } - tag.fieldNr == 216 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 216 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.FloatValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.FloatValueInternal::decodeWith) (msg.repeatedFloatWrapper as MutableList).add(elem) } - tag.fieldNr == 217 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 217 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.DoubleValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.DoubleValueInternal::decodeWith) (msg.repeatedDoubleWrapper as MutableList).add(elem) } - tag.fieldNr == 218 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 218 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.StringValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.StringValueInternal::decodeWith) (msg.repeatedStringWrapper as MutableList).add(elem) } - tag.fieldNr == 219 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 219 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.BytesValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.BytesValueInternal::decodeWith) (msg.repeatedBytesWrapper as MutableList).add(elem) } - tag.fieldNr == 301 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[12]) { + tag.fieldNr == 301 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[12]) { msg.optionalDuration = com.google.protobuf.kotlin.DurationInternal() } - decoder.readMessage(msg.optionalDuration.asInternal(), com.google.protobuf.kotlin.DurationInternal::decodeWith) + decoder.readMessage( + msg.optionalDuration.asInternal(), + com.google.protobuf.kotlin.DurationInternal::decodeWith + ) } - tag.fieldNr == 302 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[13]) { + tag.fieldNr == 302 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[13]) { msg.optionalTimestamp = com.google.protobuf.kotlin.TimestampInternal() } - decoder.readMessage(msg.optionalTimestamp.asInternal(), com.google.protobuf.kotlin.TimestampInternal::decodeWith) + decoder.readMessage( + msg.optionalTimestamp.asInternal(), + com.google.protobuf.kotlin.TimestampInternal::decodeWith + ) } - tag.fieldNr == 303 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[14]) { + tag.fieldNr == 303 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[14]) { msg.optionalFieldMask = com.google.protobuf.kotlin.FieldMaskInternal() } - decoder.readMessage(msg.optionalFieldMask.asInternal(), com.google.protobuf.kotlin.FieldMaskInternal::decodeWith) + decoder.readMessage( + msg.optionalFieldMask.asInternal(), + com.google.protobuf.kotlin.FieldMaskInternal::decodeWith + ) } - tag.fieldNr == 304 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[15]) { + tag.fieldNr == 304 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[15]) { msg.optionalStruct = com.google.protobuf.kotlin.StructInternal() } - decoder.readMessage(msg.optionalStruct.asInternal(), com.google.protobuf.kotlin.StructInternal::decodeWith) + decoder.readMessage( + msg.optionalStruct.asInternal(), + com.google.protobuf.kotlin.StructInternal::decodeWith + ) } - tag.fieldNr == 305 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[16]) { + tag.fieldNr == 305 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[16]) { msg.optionalAny = com.google.protobuf.kotlin.AnyInternal() } decoder.readMessage(msg.optionalAny.asInternal(), com.google.protobuf.kotlin.AnyInternal::decodeWith) } - tag.fieldNr == 306 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[17]) { + tag.fieldNr == 306 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[17]) { msg.optionalValue = com.google.protobuf.kotlin.ValueInternal() } - decoder.readMessage(msg.optionalValue.asInternal(), com.google.protobuf.kotlin.ValueInternal::decodeWith) + decoder.readMessage( + msg.optionalValue.asInternal(), + com.google.protobuf.kotlin.ValueInternal::decodeWith + ) } - tag.fieldNr == 307 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 307 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalNullValue = com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum()) } - tag.fieldNr == 311 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 311 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.DurationInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.DurationInternal::decodeWith) (msg.repeatedDuration as MutableList).add(elem) } - tag.fieldNr == 312 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 312 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.TimestampInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.TimestampInternal::decodeWith) (msg.repeatedTimestamp as MutableList).add(elem) } - tag.fieldNr == 313 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 313 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.FieldMaskInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.FieldMaskInternal::decodeWith) (msg.repeatedFieldmask as MutableList).add(elem) } - tag.fieldNr == 324 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 324 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.StructInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.StructInternal::decodeWith) (msg.repeatedStruct as MutableList).add(elem) } - tag.fieldNr == 315 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 315 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.AnyInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.AnyInternal::decodeWith) (msg.repeatedAny as MutableList).add(elem) } - tag.fieldNr == 316 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 316 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.ValueInternal::decodeWith) (msg.repeatedValue as MutableList).add(elem) } - tag.fieldNr == 317 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 317 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.ListValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.ListValueInternal::decodeWith) (msg.repeatedListValue as MutableList).add(elem) } - tag.fieldNr == 401 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 401 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldname1 = decoder.readInt32() } - tag.fieldNr == 402 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 402 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldName2 = decoder.readInt32() } - tag.fieldNr == 403 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 403 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FieldName3 = decoder.readInt32() } - tag.fieldNr == 404 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 404 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_Name4_ = decoder.readInt32() } - tag.fieldNr == 405 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 405 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field0name5 = decoder.readInt32() } - tag.fieldNr == 406 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 406 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_0Name6 = decoder.readInt32() } - tag.fieldNr == 407 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 407 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldName7 = decoder.readInt32() } - tag.fieldNr == 408 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 408 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FieldName8 = decoder.readInt32() } - tag.fieldNr == 409 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 409 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_Name9 = decoder.readInt32() } - tag.fieldNr == 410 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 410 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.Field_Name10 = decoder.readInt32() } - tag.fieldNr == 411 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 411 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FIELD_NAME11 = decoder.readInt32() } - tag.fieldNr == 412 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 412 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FIELDName12 = decoder.readInt32() } - tag.fieldNr == 413 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 413 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg._FieldName13 = decoder.readInt32() } - tag.fieldNr == 414 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 414 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.__FieldName14 = decoder.readInt32() } - tag.fieldNr == 415 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 415 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_Name15 = decoder.readInt32() } - tag.fieldNr == 416 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 416 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field__Name16 = decoder.readInt32() } - tag.fieldNr == 417 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 417 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldName17__ = decoder.readInt32() } - tag.fieldNr == 418 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 418 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FieldName18__ = decoder.readInt32() } - tag.fieldNr == 111 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint32(decoder.readUInt32()) + tag.fieldNr == 111 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint32(decoder.readUInt32()) } - tag.fieldNr == 112 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - val field = (msg.oneofField as? com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage) ?: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal()).also { - msg.oneofField = it - } + tag.fieldNr == 112 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + val field = + (msg.oneofField as? com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage) + ?: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal()) + .also { + msg.oneofField = it + } - decoder.readMessage(field.value.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) + decoder.readMessage( + field.value.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith + ) } - tag.fieldNr == 113 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofString(decoder.readString()) + tag.fieldNr == 113 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.oneofField = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofString(decoder.readString()) } - tag.fieldNr == 114 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBytes(decoder.readBytes()) + tag.fieldNr == 114 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.oneofField = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBytes(decoder.readBytes()) } - tag.fieldNr == 115 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBool(decoder.readBool()) + tag.fieldNr == 115 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBool(decoder.readBool()) } - tag.fieldNr == 116 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint64(decoder.readUInt64()) + tag.fieldNr == 116 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint64(decoder.readUInt64()) } - tag.fieldNr == 117 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { - msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofFloat(decoder.readFloat()) + tag.fieldNr == 117 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + msg.oneofField = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofFloat(decoder.readFloat()) } - tag.fieldNr == 118 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { - msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofDouble(decoder.readDouble()) + tag.fieldNr == 118 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + msg.oneofField = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofDouble(decoder.readDouble()) } - tag.fieldNr == 119 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofEnum(com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum())) + tag.fieldNr == 119 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofEnum( + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + ) } - tag.fieldNr == 120 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNullValue(com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum())) + tag.fieldNr == 120 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNullValue( + com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum()) + ) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.computeSize(): Int { var __result = 0 - if (optionalInt32 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(optionalInt32)) + if (optionalInt32 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(optionalInt32)) } - if (optionalInt64 != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(optionalInt64)) + if (optionalInt64 != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int64(optionalInt64)) } - if (optionalUint32 != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(optionalUint32)) + if (optionalUint32 != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 3, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(optionalUint32)) } - if (optionalUint64 != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(optionalUint64)) + if (optionalUint64 != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 4, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(optionalUint64)) } - if (optionalSint32 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(optionalSint32)) + if (optionalSint32 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 5, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(optionalSint32)) } - if (optionalSint64 != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(optionalSint64)) + if (optionalSint64 != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 6, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(optionalSint64)) } - if (optionalFixed32 != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(optionalFixed32)) + if (optionalFixed32 != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 7, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(optionalFixed32)) } - if (optionalFixed64 != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(8, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(optionalFixed64)) + if (optionalFixed64 != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 8, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(optionalFixed64)) } - if (optionalSfixed32 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(9, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(optionalSfixed32)) + if (optionalSfixed32 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 9, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(optionalSfixed32)) } - if (optionalSfixed64 != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(10, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(optionalSfixed64)) + if (optionalSfixed64 != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 10, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(optionalSfixed64)) } - if (optionalFloat != 0.0f) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(11, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(optionalFloat)) + if (optionalFloat != 0.0f) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 11, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.float(optionalFloat)) } - if (optionalDouble != 0.0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(12, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(optionalDouble)) + if (optionalDouble != 0.0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 12, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.double(optionalDouble)) } - if (optionalBool != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(13, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(optionalBool)) + if (optionalBool != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 13, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(optionalBool)) } - if (optionalString.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalString).let { kotlinx.rpc.protobuf.internal.WireSize.tag(14, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (optionalString.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalString).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 14, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (optionalBytes.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(optionalBytes).let { kotlinx.rpc.protobuf.internal.WireSize.tag(15, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (optionalBytes.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(optionalBytes).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 15, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[0]) { - __result += optionalNestedMessage.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(18, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += optionalNestedMessage.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 18, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[1]) { - __result += optionalForeignMessage.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(19, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[1]) { + __result += optionalForeignMessage.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 19, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (optionalNestedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(21, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNestedEnum.number)) + if (optionalNestedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 21, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNestedEnum.number)) } - if (optionalForeignEnum != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(22, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalForeignEnum.number)) + if (optionalForeignEnum != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 22, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalForeignEnum.number)) } - if (optionalAliasedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(23, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalAliasedEnum.number)) + if (optionalAliasedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 23, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalAliasedEnum.number)) } - if (optionalStringPiece.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalStringPiece).let { kotlinx.rpc.protobuf.internal.WireSize.tag(24, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (optionalStringPiece.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalStringPiece).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 24, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (optionalCord.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalCord).let { kotlinx.rpc.protobuf.internal.WireSize.tag(25, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (optionalCord.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalCord).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 25, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[2]) { - __result += recursiveMessage.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(27, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[2]) { + __result += recursiveMessage.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 27, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedInt32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(31, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedInt32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 31, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedInt64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(32, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedInt64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 32, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedUint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(33, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedUint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 33, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedUint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(34, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedUint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 34, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedSint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(35, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedSint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 35, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedSint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(36, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedSint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 36, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedFixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(repeatedFixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(37, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedFixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(repeatedFixed32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 37, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedFixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(repeatedFixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(38, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedFixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(repeatedFixed64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 38, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedSfixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(repeatedSfixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(39, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedSfixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(repeatedSfixed32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 39, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedSfixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(repeatedSfixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(40, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedSfixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(repeatedSfixed64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 40, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedFloat.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(repeatedFloat).let { kotlinx.rpc.protobuf.internal.WireSize.tag(41, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedFloat.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(repeatedFloat).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 41, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedDouble.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(repeatedDouble).let { kotlinx.rpc.protobuf.internal.WireSize.tag(42, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedDouble.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(repeatedDouble).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 42, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedBool.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool).let { kotlinx.rpc.protobuf.internal.WireSize.tag(43, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedBool.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 43, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedString.isNotEmpty()) { - __result += repeatedString.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(44, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedString.isNotEmpty()) { + __result += repeatedString.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 44, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedBytes.isNotEmpty()) { - __result += repeatedBytes.sumOf { kotlinx.rpc.protobuf.internal.WireSize.bytes(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(45, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedBytes.isNotEmpty()) { + __result += repeatedBytes.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.bytes(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 45, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedNestedMessage.isNotEmpty()) { - __result += repeatedNestedMessage.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(48, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedNestedMessage.isNotEmpty()) { + __result += repeatedNestedMessage.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 48, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedForeignMessage.isNotEmpty()) { - __result += repeatedForeignMessage.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(49, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedForeignMessage.isNotEmpty()) { + __result += repeatedForeignMessage.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 49, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedNestedEnum.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number }).let { kotlinx.rpc.protobuf.internal.WireSize.tag(51, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedNestedEnum.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number }).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 51, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedForeignEnum.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number }).let { kotlinx.rpc.protobuf.internal.WireSize.tag(52, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (repeatedForeignEnum.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number }).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 52, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedStringPiece.isNotEmpty()) { - __result += repeatedStringPiece.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(54, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedStringPiece.isNotEmpty()) { + __result += repeatedStringPiece.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 54, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedCord.isNotEmpty()) { - __result += repeatedCord.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(55, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedCord.isNotEmpty()) { + __result += repeatedCord.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 55, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (packedInt32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(75, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedInt32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 75, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedInt64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(76, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedInt64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 76, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedUint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(77, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedUint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 77, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedUint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(78, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedUint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 78, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedSint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(79, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedSint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 79, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedSint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(80, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedSint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 80, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedFixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(packedFixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(81, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedFixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(packedFixed32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 81, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedFixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(packedFixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(82, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedFixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(packedFixed64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 82, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedSfixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(packedSfixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(83, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedSfixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(packedSfixed32).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 83, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedSfixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(packedSfixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(84, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedSfixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(packedSfixed64).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 84, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedFloat.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(packedFloat).let { kotlinx.rpc.protobuf.internal.WireSize.tag(85, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedFloat.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(packedFloat).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 85, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedDouble.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(packedDouble).let { kotlinx.rpc.protobuf.internal.WireSize.tag(86, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedDouble.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(packedDouble).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 86, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedBool.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool).let { kotlinx.rpc.protobuf.internal.WireSize.tag(87, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedBool.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 87, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (packedNestedEnum.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number }).let { kotlinx.rpc.protobuf.internal.WireSize.tag(88, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (packedNestedEnum.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number }).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 88, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (unpackedInt32.isNotEmpty()) { - __result += unpackedInt32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.int32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(89, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedInt32.isNotEmpty()) { + __result += unpackedInt32.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 89, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedInt64.isNotEmpty()) { - __result += unpackedInt64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.int64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(90, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedInt64.isNotEmpty()) { + __result += unpackedInt64.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.int64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 90, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedUint32.isNotEmpty()) { - __result += unpackedUint32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.uInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(91, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedUint32.isNotEmpty()) { + __result += unpackedUint32.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.uInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 91, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedUint64.isNotEmpty()) { - __result += unpackedUint64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.uInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(92, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedUint64.isNotEmpty()) { + __result += unpackedUint64.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.uInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 92, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedSint32.isNotEmpty()) { - __result += unpackedSint32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(93, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedSint32.isNotEmpty()) { + __result += unpackedSint32.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.sInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 93, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedSint64.isNotEmpty()) { - __result += unpackedSint64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(94, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedSint64.isNotEmpty()) { + __result += unpackedSint64.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.sInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 94, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedFixed32.isNotEmpty()) { - __result += unpackedFixed32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.fixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(95, kotlinx.rpc.protobuf.internal.WireType.FIXED32) } + if (unpackedFixed32.isNotEmpty()) { + __result += unpackedFixed32.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.fixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 95, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + } } - if (unpackedFixed64.isNotEmpty()) { - __result += unpackedFixed64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.fixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(96, kotlinx.rpc.protobuf.internal.WireType.FIXED64) } + if (unpackedFixed64.isNotEmpty()) { + __result += unpackedFixed64.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.fixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 96, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + } } - if (unpackedSfixed32.isNotEmpty()) { - __result += unpackedSfixed32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sFixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(97, kotlinx.rpc.protobuf.internal.WireType.FIXED32) } + if (unpackedSfixed32.isNotEmpty()) { + __result += unpackedSfixed32.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 97, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + } } - if (unpackedSfixed64.isNotEmpty()) { - __result += unpackedSfixed64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sFixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(98, kotlinx.rpc.protobuf.internal.WireType.FIXED64) } + if (unpackedSfixed64.isNotEmpty()) { + __result += unpackedSfixed64.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 98, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + } } - if (unpackedFloat.isNotEmpty()) { - __result += unpackedFloat.sumOf { kotlinx.rpc.protobuf.internal.WireSize.float(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(99, kotlinx.rpc.protobuf.internal.WireType.FIXED32) } + if (unpackedFloat.isNotEmpty()) { + __result += unpackedFloat.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.float(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 99, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + } } - if (unpackedDouble.isNotEmpty()) { - __result += unpackedDouble.sumOf { kotlinx.rpc.protobuf.internal.WireSize.double(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(100, kotlinx.rpc.protobuf.internal.WireType.FIXED64) } + if (unpackedDouble.isNotEmpty()) { + __result += unpackedDouble.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.double(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 100, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + } } - if (unpackedBool.isNotEmpty()) { - __result += unpackedBool.sumOf { kotlinx.rpc.protobuf.internal.WireSize.bool(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(101, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedBool.isNotEmpty()) { + __result += unpackedBool.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.bool(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 101, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (unpackedNestedEnum.isNotEmpty()) { - __result += unpackedNestedEnum.sumOf { kotlinx.rpc.protobuf.internal.WireSize.enum(it.number) + kotlinx.rpc.protobuf.internal.WireSize.tag(102, kotlinx.rpc.protobuf.internal.WireType.VARINT) } + if (unpackedNestedEnum.isNotEmpty()) { + __result += unpackedNestedEnum.sumOf { + kotlinx.rpc.protobuf.internal.WireSize.enum(it.number) + kotlinx.rpc.protobuf.internal.WireSize.tag( + 102, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + } } - if (mapInt32Int32.isNotEmpty()) { + if (mapInt32Int32.isNotEmpty()) { __result += mapInt32Int32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapInt64Int64.isNotEmpty()) { + if (mapInt64Int64.isNotEmpty()) { __result += mapInt64Int64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapUint32Uint32.isNotEmpty()) { + if (mapUint32Uint32.isNotEmpty()) { __result += mapUint32Uint32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapUint64Uint64.isNotEmpty()) { + if (mapUint64Uint64.isNotEmpty()) { __result += mapUint64Uint64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapSint32Sint32.isNotEmpty()) { + if (mapSint32Sint32.isNotEmpty()) { __result += mapSint32Sint32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapSint64Sint64.isNotEmpty()) { + if (mapSint64Sint64.isNotEmpty()) { __result += mapSint64Sint64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapFixed32Fixed32.isNotEmpty()) { + if (mapFixed32Fixed32.isNotEmpty()) { __result += mapFixed32Fixed32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapFixed64Fixed64.isNotEmpty()) { + if (mapFixed64Fixed64.isNotEmpty()) { __result += mapFixed64Fixed64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapSfixed32Sfixed32.isNotEmpty()) { + if (mapSfixed32Sfixed32.isNotEmpty()) { __result += mapSfixed32Sfixed32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapSfixed64Sfixed64.isNotEmpty()) { + if (mapSfixed64Sfixed64.isNotEmpty()) { __result += mapSfixed64Sfixed64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapInt32Float.isNotEmpty()) { + if (mapInt32Float.isNotEmpty()) { __result += mapInt32Float.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapInt32Double.isNotEmpty()) { + if (mapInt32Double.isNotEmpty()) { __result += mapInt32Double.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapBoolBool.isNotEmpty()) { + if (mapBoolBool.isNotEmpty()) { __result += mapBoolBool.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapStringString.isNotEmpty()) { + if (mapStringString.isNotEmpty()) { __result += mapStringString.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapStringBytes.isNotEmpty()) { + if (mapStringBytes.isNotEmpty()) { __result += mapStringBytes.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapStringNestedMessage.isNotEmpty()) { + if (mapStringNestedMessage.isNotEmpty()) { __result += mapStringNestedMessage.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringForeignMessage.isNotEmpty()) { + if (mapStringForeignMessage.isNotEmpty()) { __result += mapStringForeignMessage.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringNestedEnum.isNotEmpty()) { + if (mapStringNestedEnum.isNotEmpty()) { __result += mapStringNestedEnum.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringForeignEnum.isNotEmpty()) { + if (mapStringForeignEnum.isNotEmpty()) { __result += mapStringForeignEnum.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal().apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal() + .apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (presenceMask[3]) { - __result += optionalBoolWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(201, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[3]) { + __result += optionalBoolWrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 201, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[4]) { - __result += optionalInt32Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(202, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[4]) { + __result += optionalInt32Wrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 202, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[5]) { - __result += optionalInt64Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(203, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[5]) { + __result += optionalInt64Wrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 203, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[6]) { - __result += optionalUint32Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(204, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[6]) { + __result += optionalUint32Wrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 204, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[7]) { - __result += optionalUint64Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(205, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[7]) { + __result += optionalUint64Wrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 205, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[8]) { - __result += optionalFloatWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(206, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[8]) { + __result += optionalFloatWrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 206, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[9]) { - __result += optionalDoubleWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(207, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[9]) { + __result += optionalDoubleWrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 207, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[10]) { - __result += optionalStringWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(208, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[10]) { + __result += optionalStringWrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 208, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[11]) { - __result += optionalBytesWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(209, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[11]) { + __result += optionalBytesWrapper.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 209, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (repeatedBoolWrapper.isNotEmpty()) { - __result += repeatedBoolWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(211, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedBoolWrapper.isNotEmpty()) { + __result += repeatedBoolWrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 211, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedInt32Wrapper.isNotEmpty()) { - __result += repeatedInt32Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(212, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedInt32Wrapper.isNotEmpty()) { + __result += repeatedInt32Wrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 212, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedInt64Wrapper.isNotEmpty()) { - __result += repeatedInt64Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(213, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedInt64Wrapper.isNotEmpty()) { + __result += repeatedInt64Wrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 213, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedUint32Wrapper.isNotEmpty()) { - __result += repeatedUint32Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(214, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedUint32Wrapper.isNotEmpty()) { + __result += repeatedUint32Wrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 214, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedUint64Wrapper.isNotEmpty()) { - __result += repeatedUint64Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(215, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedUint64Wrapper.isNotEmpty()) { + __result += repeatedUint64Wrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 215, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedFloatWrapper.isNotEmpty()) { - __result += repeatedFloatWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(216, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedFloatWrapper.isNotEmpty()) { + __result += repeatedFloatWrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 216, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedDoubleWrapper.isNotEmpty()) { - __result += repeatedDoubleWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(217, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedDoubleWrapper.isNotEmpty()) { + __result += repeatedDoubleWrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 217, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedStringWrapper.isNotEmpty()) { - __result += repeatedStringWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(218, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedStringWrapper.isNotEmpty()) { + __result += repeatedStringWrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 218, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedBytesWrapper.isNotEmpty()) { - __result += repeatedBytesWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(219, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedBytesWrapper.isNotEmpty()) { + __result += repeatedBytesWrapper.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 219, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (presenceMask[12]) { - __result += optionalDuration.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(301, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[12]) { + __result += optionalDuration.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 301, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[13]) { - __result += optionalTimestamp.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(302, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[13]) { + __result += optionalTimestamp.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 302, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[14]) { - __result += optionalFieldMask.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(303, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[14]) { + __result += optionalFieldMask.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 303, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[15]) { - __result += optionalStruct.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(304, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[15]) { + __result += optionalStruct.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 304, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[16]) { - __result += optionalAny.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(305, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[16]) { + __result += optionalAny.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 305, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[17]) { - __result += optionalValue.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(306, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[17]) { + __result += optionalValue.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 306, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(307, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNullValue.number)) + if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 307, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNullValue.number)) } - if (repeatedDuration.isNotEmpty()) { - __result += repeatedDuration.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(311, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedDuration.isNotEmpty()) { + __result += repeatedDuration.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 311, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedTimestamp.isNotEmpty()) { - __result += repeatedTimestamp.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(312, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedTimestamp.isNotEmpty()) { + __result += repeatedTimestamp.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 312, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedFieldmask.isNotEmpty()) { - __result += repeatedFieldmask.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(313, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedFieldmask.isNotEmpty()) { + __result += repeatedFieldmask.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 313, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedStruct.isNotEmpty()) { - __result += repeatedStruct.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(324, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedStruct.isNotEmpty()) { + __result += repeatedStruct.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 324, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedAny.isNotEmpty()) { - __result += repeatedAny.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(315, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedAny.isNotEmpty()) { + __result += repeatedAny.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 315, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedValue.isNotEmpty()) { - __result += repeatedValue.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(316, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedValue.isNotEmpty()) { + __result += repeatedValue.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 316, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (repeatedListValue.isNotEmpty()) { - __result += repeatedListValue.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(317, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } + if (repeatedListValue.isNotEmpty()) { + __result += repeatedListValue.sumOf { + it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( + 317, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + } } - if (fieldname1 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(401, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldname1)) + if (fieldname1 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 401, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldname1)) } - if (fieldName2 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(402, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName2)) + if (fieldName2 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 402, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName2)) } - if (FieldName3 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(403, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName3)) + if (FieldName3 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 403, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName3)) } - if (field_Name4_ != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(404, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name4_)) + if (field_Name4_ != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 404, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name4_)) } - if (field0name5 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(405, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field0name5)) + if (field0name5 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 405, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field0name5)) } - if (field_0Name6 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(406, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_0Name6)) + if (field_0Name6 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 406, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_0Name6)) } - if (fieldName7 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(407, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName7)) + if (fieldName7 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 407, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName7)) } - if (FieldName8 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(408, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName8)) + if (FieldName8 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 408, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName8)) } - if (field_Name9 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(409, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name9)) + if (field_Name9 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 409, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name9)) } - if (Field_Name10 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(410, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(Field_Name10)) + if (Field_Name10 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 410, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(Field_Name10)) } - if (FIELD_NAME11 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(411, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELD_NAME11)) + if (FIELD_NAME11 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 411, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELD_NAME11)) } - if (FIELDName12 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(412, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELDName12)) + if (FIELDName12 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 412, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELDName12)) } - if (_FieldName13 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(413, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(_FieldName13)) + if (_FieldName13 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 413, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(_FieldName13)) } - if (__FieldName14 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(414, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(__FieldName14)) + if (__FieldName14 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 414, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(__FieldName14)) } - if (field_Name15 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(415, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name15)) + if (field_Name15 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 415, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name15)) } - if (field__Name16 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(416, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field__Name16)) + if (field__Name16 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 416, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field__Name16)) } - if (fieldName17__ != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(417, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName17__)) + if (fieldName17__ != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 417, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName17__)) } - if (FieldName18__ != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(418, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName18__)) + if (FieldName18__ != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 418, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName18__)) } - oneofField?.also { - when (val value = it) { - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(111, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value.value)) + oneofField?.also { + when (val value = it) { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 111, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value.value)) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { - __result += value.value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(112, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { + __result += value.value.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 112, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofString -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(113, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofString -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 113, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(114, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 114, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBool -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(115, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(value.value)) + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBool -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 115, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(value.value)) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(116, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value.value)) + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 116, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value.value)) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(117, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(value.value)) + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 117, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.float(value.value)) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(118, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(value.value)) + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 118, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.double(value.value)) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(119, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 119, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(120, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 120, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) } } } @@ -3318,1319 +4179,1565 @@ private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal. } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal { - return this as? com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal { + return this as? com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (c != 0) { +fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (c != 0) { encoder.writeInt32(fieldNr = 1, value = c) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.ForeignMessageInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.ForeignMessageInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.c = decoder.readInt32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.computeSize(): Int { var __result = 0 - if (c != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(c)) + if (c != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(c)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.ForeignMessage.asInternal(): com.google.protobuf_test_messages.proto3.ForeignMessageInternal { - return this as? com.google.protobuf_test_messages.proto3.ForeignMessageInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.proto3.ForeignMessage.asInternal(): com.google.protobuf_test_messages.proto3.ForeignMessageInternal { + return this as? com.google.protobuf_test_messages.proto3.ForeignMessageInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { +fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { // no fields to encode } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - else -> { + when { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.computeSize(): Int { var __result = 0 return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3.asInternal(): com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal { - return this as? com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3.asInternal(): com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal { + return this as? com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { +fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { // no fields to encode } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - else -> { + when { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.computeSize(): Int { var __result = 0 return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3.asInternal(): com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal { - return this as? com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3.asInternal(): com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal { + return this as? com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { corecursive.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (a != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (a != 0) { encoder.writeInt32(fieldNr = 1, value = a) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = corecursive.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.a = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { msg.corecursive = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } - decoder.readMessage(msg.corecursive.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal::decodeWith) + decoder.readMessage( + msg.corecursive.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal::decodeWith + ) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.computeSize(): Int { var __result = 0 - if (a != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(a)) + if (a != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(a)) } - if (presenceMask[0]) { - __result += corecursive.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += corecursive.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal { - return this as? com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal { + return this as? com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal + ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeInt32(fieldNr = 1, value = key) } - if (value != 0) { + if (value != 0) { encoder.writeInt32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readInt32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) } - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0L) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0L) { encoder.writeInt64(fieldNr = 1, value = key) } - if (value != 0L) { + if (value != 0L) { encoder.writeInt64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readInt64() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(key)) + if (key != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int64(key)) } - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0u) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0u) { encoder.writeUInt32(fieldNr = 1, value = key) } - if (value != 0u) { + if (value != 0u) { encoder.writeUInt32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readUInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readUInt32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(key)) + if (key != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(key)) } - if (value != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value)) + if (value != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0uL) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0uL) { encoder.writeUInt64(fieldNr = 1, value = key) } - if (value != 0uL) { + if (value != 0uL) { encoder.writeUInt64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readUInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readUInt64() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(key)) + if (key != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(key)) } - if (value != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value)) + if (value != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeSInt32(fieldNr = 1, value = key) } - if (value != 0) { + if (value != 0) { encoder.writeSInt32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readSInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readSInt32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(key)) } - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0L) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0L) { encoder.writeSInt64(fieldNr = 1, value = key) } - if (value != 0L) { + if (value != 0L) { encoder.writeSInt64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readSInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readSInt64() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(key)) + if (key != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(key)) } - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0u) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0u) { encoder.writeFixed32(fieldNr = 1, value = key) } - if (value != 0u) { + if (value != 0u) { encoder.writeFixed32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.key = decoder.readFixed32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readFixed32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(key)) + if (key != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(key)) } - if (value != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(value)) + if (value != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0uL) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0uL) { encoder.writeFixed64(fieldNr = 1, value = key) } - if (value != 0uL) { + if (value != 0uL) { encoder.writeFixed64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.key = decoder.readFixed64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readFixed64() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(key)) + if (key != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(key)) } - if (value != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(value)) + if (value != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0) { encoder.writeSFixed32(fieldNr = 1, value = key) } - if (value != 0) { + if (value != 0) { encoder.writeSFixed32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.key = decoder.readSFixed32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readSFixed32() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(key)) } - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0L) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key != 0L) { encoder.writeSFixed64(fieldNr = 1, value = key) } - if (value != 0L) { + if (value != 0L) { encoder.writeSFixed64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.key = decoder.readSFixed64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readSFixed64() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(key)) + if (key != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(key)) } - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeInt32(fieldNr = 1, value = key) } - if (value != 0.0f) { + if (value != 0.0f) { encoder.writeFloat(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readFloat() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) } - if (value != 0.0f) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(value)) + if (value != 0.0f) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.FIXED32 + ) + kotlinx.rpc.protobuf.internal.WireSize.float(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeInt32(fieldNr = 1, value = key) } - if (value != 0.0) { + if (value != 0.0) { encoder.writeDouble(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readDouble() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) } - if (value != 0.0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(value)) + if (value != 0.0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.FIXED64 + ) + kotlinx.rpc.protobuf.internal.WireSize.double(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != false) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != false) { encoder.writeBool(fieldNr = 1, value = key) } - if (value != false) { + if (value != false) { encoder.writeBool(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readBool() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readBool() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.computeSize(): Int { var __result = 0 - if (key != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(key)) + if (key != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(key)) } - if (value != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(value)) + if (value != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.bool(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value.isNotEmpty()) { + if (value.isNotEmpty()) { encoder.writeString(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readString() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value.isNotEmpty()) { + if (value.isNotEmpty()) { encoder.writeBytes(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readBytes() } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { value.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = value.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { - msg.value = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { + msg.value = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } - decoder.readMessage(msg.value.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) + decoder.readMessage( + msg.value.asInternal(), + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith + ) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[0]) { - __result += value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += value.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { value.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = value.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + if (!msg.presenceMask[0]) { msg.value = com.google.protobuf_test_messages.proto3.ForeignMessageInternal() } - decoder.readMessage(msg.value.asInternal(), com.google.protobuf_test_messages.proto3.ForeignMessageInternal::decodeWith) + decoder.readMessage( + msg.value.asInternal(), + com.google.protobuf_test_messages.proto3.ForeignMessageInternal::decodeWith + ) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (presenceMask[0]) { - __result += value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (presenceMask[0]) { + __result += value.asInternal()._size.let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { + if (value != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { encoder.writeEnum(fieldNr = 2, value = value.number) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.value = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.value = + com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (value != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) + if (value != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.encodeWith( + encoder: kotlinx.rpc.protobuf.internal.WireEncoder, +) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { + if (value != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { encoder.writeEnum(fieldNr = 2, value = value.number) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.Companion.decodeWith( + msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal, + decoder: kotlinx.rpc.protobuf.internal.WireDecoder, +) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = com.google.protobuf_test_messages.proto3.ForeignEnum.fromNumber(decoder.readEnum()) } - else -> { + else -> { // we are currently just skipping unknown fields (KRPC-191) - decoder.skipValue(tag.wireType) + decoder.skipValue(tag) } } } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { + kotlinx.rpc.protobuf.internal.WireSize.tag( + 1, + kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED + ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it + } } - if (value != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) + if (value != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( + 2, + kotlinx.rpc.protobuf.internal.WireType.VARINT + ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.ForeignEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.ForeignEnum { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.proto3.ForeignEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.ForeignEnum { + return when (number) { + 0 -> { com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO } - 1 -> { + 1 -> { com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_BAR } - 2 -> { + 2 -> { com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_BAZ } - else -> { + else -> { com.google.protobuf_test_messages.proto3.ForeignEnum.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum { + return when (number) { + 0 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO } - 1 -> { + 1 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.BAR } - 2 -> { + 2 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.BAZ } - -1 -> { + -1 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.NEG } - else -> { + else -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum { + return when (number) { + 0 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO } - 1 -> { + 1 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_BAR } - 2 -> { + 2 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_BAZ } - else -> { + else -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool { + return when (number) { + 0 -> { com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool.kFalse } - 1 -> { + 1 -> { com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool.kTrue } - else -> { + else -> { com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool.UNRECOGNIZED(number) } } diff --git a/tests/protobuf-conformance/src/test/kotlin/kotlinx/rpc/protoc/gen/test/ConformanceTest.kt b/tests/protobuf-conformance/src/test/kotlin/kotlinx/rpc/protoc/gen/test/ConformanceTest.kt index e2e21c640..c5b4ae102 100644 --- a/tests/protobuf-conformance/src/test/kotlin/kotlinx/rpc/protoc/gen/test/ConformanceTest.kt +++ b/tests/protobuf-conformance/src/test/kotlin/kotlinx/rpc/protoc/gen/test/ConformanceTest.kt @@ -84,11 +84,11 @@ class ConformanceTest { return (fails.entries.map { (test, message) -> DynamicTest.dynamicTest(test.testDisplayName()) { - fail(message) + fail("FAILED: '${test.testDisplayName()}' with: $message") } } + passed.map { test -> DynamicTest.dynamicTest(test.testDisplayName()) { - println("PASSED") + println("PASSED: '${test.testDisplayName()}'") } }).stream() } From b34449bd0f81eefb542ced5bfeb78d62c523c947 Mon Sep 17 00:00:00 2001 From: Johannes Zottele Date: Tue, 9 Sep 2025 17:36:38 +0200 Subject: [PATCH 2/7] protobuf: Add group lists Signed-off-by: Johannes Zottele --- .../protobuf/kotlin/_rpc_internal/Api.kt | 2 +- .../protobuf/kotlin/_rpc_internal/Struct.kt | 6 +-- .../protobuf/kotlin/_rpc_internal/Type.kt | 6 +-- .../kotlinx/rpc/protobuf/test/ProtosTest.kt | 41 +++++++++++++++-- .../src/commonTest/proto/groups.proto | 10 +++++ .../rpc/protoc/gen/core/model/FieldType.kt | 2 +- .../rpc/protoc/gen/core/model/model.kt | 2 +- .../ModelToProtobufKotlinCommonGenerator.kt | 21 ++++----- .../conformance/_rpc_internal/Conformance.kt | 2 +- .../TestMessagesProto3Editions.kt | 44 +++++++++---------- .../_rpc_internal/TestMessagesProto3.kt | 44 +++++++++---------- 11 files changed, 110 insertions(+), 70 deletions(-) diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt index bf9ff3be5..0cf59d5e1 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt @@ -240,7 +240,7 @@ public fun com.google.protobuf.kotlin.ApiInternal.Companion.decodeWith( msg.version = decoder.readString() } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.sourceContext = com.google.protobuf.kotlin.SourceContextInternal() } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt index 669fb6996..45752bfda 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt @@ -297,7 +297,7 @@ public fun com.google.protobuf.kotlin.ValueInternal.Companion.decodeWith( msg.kind = com.google.protobuf.kotlin.Value.Kind.BoolValue(decoder.readBool()) } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val field = (msg.kind as? com.google.protobuf.kotlin.Value.Kind.StructValue) ?: com.google.protobuf.kotlin.Value.Kind.StructValue(com.google.protobuf.kotlin.StructInternal()) .also { @@ -307,7 +307,7 @@ public fun com.google.protobuf.kotlin.ValueInternal.Companion.decodeWith( decoder.readMessage(field.value.asInternal(), com.google.protobuf.kotlin.StructInternal::decodeWith) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val field = (msg.kind as? com.google.protobuf.kotlin.Value.Kind.ListValue) ?: com.google.protobuf.kotlin.Value.Kind.ListValue(com.google.protobuf.kotlin.ListValueInternal()) .also { @@ -478,7 +478,7 @@ public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.Compani msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.value = com.google.protobuf.kotlin.ValueInternal() } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt index dcc7e3deb..ff31bce5a 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt @@ -337,7 +337,7 @@ public fun com.google.protobuf.kotlin.TypeInternal.Companion.decodeWith( (msg.options as MutableList).add(elem) } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.sourceContext = com.google.protobuf.kotlin.SourceContextInternal() } @@ -709,7 +709,7 @@ public fun com.google.protobuf.kotlin.EnumInternal.Companion.decodeWith( (msg.options as MutableList).add(elem) } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.sourceContext = com.google.protobuf.kotlin.SourceContextInternal() } @@ -921,7 +921,7 @@ public fun com.google.protobuf.kotlin.OptionInternal.Companion.decodeWith( msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.value = com.google.protobuf.kotlin.AnyInternal() } diff --git a/protobuf/protobuf-core/src/commonTest/kotlin/kotlinx/rpc/protobuf/test/ProtosTest.kt b/protobuf/protobuf-core/src/commonTest/kotlin/kotlinx/rpc/protobuf/test/ProtosTest.kt index 65338c867..a3ad80169 100644 --- a/protobuf/protobuf-core/src/commonTest/kotlin/kotlinx/rpc/protobuf/test/ProtosTest.kt +++ b/protobuf/protobuf-core/src/commonTest/kotlin/kotlinx/rpc/protobuf/test/ProtosTest.kt @@ -9,6 +9,8 @@ import OneOfMsgInternal import OneOfWithRequired import Outer import OuterInternal +import WithGroups +import WithGroupsInternal import asInternal import encodeWith import invoke @@ -18,16 +20,26 @@ import kotlinx.rpc.protobuf.input.stream.asInputStream import kotlinx.rpc.protobuf.input.stream.asSource import kotlinx.rpc.protobuf.internal.ProtobufDecodingException import kotlinx.rpc.protobuf.internal.WireEncoder -import test.nested.* +import test.nested.NestedOuter +import test.nested.NestedOuterInternal +import test.nested.NotInside +import test.nested.NotInsideInternal import test.nested.invoke import test.recursive.Recursive import test.recursive.RecursiveInternal import test.recursive.RecursiveReq import test.recursive.invoke -import test.submsg.* +import test.submsg.Other +import test.submsg.OtherInternal +import test.submsg.ReferenceInternal +import test.submsg.encodeWith import test.submsg.invoke -import kotlin.collections.iterator -import kotlin.test.* +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertFailsWith +import kotlin.test.assertIs +import kotlin.test.assertNull +import kotlin.test.assertTrue class ProtosTest { @@ -411,4 +423,25 @@ class ProtosTest { } } + @Test + fun testGroup() { + val msg = WithGroups { + firstgroup = WithGroups.FirstGroup { + value = 23u + } + secondgroup = listOf( + WithGroups.SecondGroup { + value = "First Item" + }, WithGroups.SecondGroup { + value = "Second Item" + } + ) + } + + val decoded = encodeDecode(msg, WithGroupsInternal.CODEC) + assertEquals(msg.firstgroup.value, decoded.firstgroup.value) + for ((i, group) in msg.secondgroup.withIndex()) { + assertEquals(group.value, decoded.secondgroup[i].value) + } + } } diff --git a/protobuf/protobuf-core/src/commonTest/proto/groups.proto b/protobuf/protobuf-core/src/commonTest/proto/groups.proto index bd11ac055..b725b1b9c 100644 --- a/protobuf/protobuf-core/src/commonTest/proto/groups.proto +++ b/protobuf/protobuf-core/src/commonTest/proto/groups.proto @@ -2,4 +2,14 @@ message WithGroups { required group FirstGroup = 1 { required fixed32 value = 2; } + + repeated group SecondGroup = 2 { + required string value = 2; + } + + // oneof test { + // group TestGroup = 3 { + // required fixed32 value = 2; + // } + // } } \ No newline at end of file diff --git a/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/FieldType.kt b/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/FieldType.kt index 2b9baf8cc..541a959d2 100644 --- a/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/FieldType.kt +++ b/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/FieldType.kt @@ -40,7 +40,7 @@ sealed interface FieldType { data class Message(val dec: Lazy) : FieldType { override val defaultValue: String? = null - override val wireType: WireType = WireType.LENGTH_DELIMITED + override val wireType: WireType by lazy { if (dec.value.isGroup) WireType.START_GROUP else WireType.LENGTH_DELIMITED } } data class OneOf(val dec: OneOfDeclaration) : FieldType { diff --git a/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/model.kt b/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/model.kt index 7167ed869..56c688f0f 100644 --- a/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/model.kt +++ b/protoc-gen/common/src/main/kotlin/kotlinx/rpc/protoc/gen/core/model/model.kt @@ -87,7 +87,7 @@ data class FieldDeclaration( // this cannot be the number, as only fields with hasPresence == true are part of the presenceMask val presenceIdx: Int? = null, ) { - val packedFixedSize = type.wireType == WireType.FIXED64 || type.wireType == WireType.FIXED32 + val packedFixedSize by lazy { type.wireType == WireType.FIXED64 || type.wireType == WireType.FIXED32 } val isPartOfOneof: Boolean = dec.realContainingOneof != null diff --git a/protoc-gen/protobuf/src/main/kotlin/kotlinx/rpc/protoc/gen/ModelToProtobufKotlinCommonGenerator.kt b/protoc-gen/protobuf/src/main/kotlin/kotlinx/rpc/protoc/gen/ModelToProtobufKotlinCommonGenerator.kt index c439174bf..810c19931 100644 --- a/protoc-gen/protobuf/src/main/kotlin/kotlinx/rpc/protoc/gen/ModelToProtobufKotlinCommonGenerator.kt +++ b/protoc-gen/protobuf/src/main/kotlin/kotlinx/rpc/protoc/gen/ModelToProtobufKotlinCommonGenerator.kt @@ -312,15 +312,16 @@ class ModelToProtobufKotlinCommonGenerator( returnType = "Unit", ) { whileBlock("true") { - code("val tag = decoder.readTag() ?: break // EOF, we read the whole message") - if (declaration.isGroup) { + code("val tag = decoder.readTag() ?: throw ProtobufDecodingException(\"Missing END_GROUP tag for field: \${startGroup.fieldNr}.\")") ifBranch(condition = "tag.wireType == $PB_PKG.WireType.END_GROUP", ifBlock = { ifBranch(condition = "tag.fieldNr != startGroup.fieldNr", ifBlock = { - code("throw ProtobufDecodingException(\"Wrong end group tag. Expected \${startGroup.fieldNr}, got \${tag.fieldNr}.\")") + code("throw ProtobufDecodingException(\"Wrong END_GROUP tag. Expected \${startGroup.fieldNr}, got \${tag.fieldNr}.\")") }) code("return") }) + } else { + code("val tag = decoder.readTag() ?: break // EOF, we read the whole message") } whenBlock { @@ -399,13 +400,8 @@ class ModelToProtobufKotlinCommonGenerator( is FieldType.Message -> { val msg = fieldType.dec.value - val condition = if (msg.isUserFacing) { - "tag.fieldNr == ${field.number} && tag.wireType == $PB_PKG.WireType.START_GROUP" - } else { - "tag.fieldNr == ${field.number} && tag.wireType == $PB_PKG.WireType.LENGTH_DELIMITED" - } - whenCase(condition) { + whenCase("tag.fieldNr == ${field.number} && tag.wireType == $PB_PKG.WireType.${fieldType.wireType.name}") { if (field.presenceIdx != null) { // check if the current sub message object was already set, if not, set a new one // to set the field's presence tracker to true @@ -563,7 +559,8 @@ class ModelToProtobufKotlinCommonGenerator( valueVar } - encFunc = type.value.decodeEncodeFuncName() + val innerType = type.value + encFunc = innerType.decodeEncodeFuncName() when { isPacked && packedWithFixedSize -> code("encoder.writePacked${encFunc!!}(fieldNr = $number, value = $packedValueVar)") @@ -575,8 +572,8 @@ class ModelToProtobufKotlinCommonGenerator( })" ) - type.value is FieldType.Message -> scope("$valueVar.forEach") { - code("encoder.writeMessage(fieldNr = ${number}, value = it.asInternal()) { encodeWith(it) }") + innerType is FieldType.Message -> scope("$valueVar.forEach") { + generateEncodeFieldValue("it", innerType, number, isPacked = false, packedWithFixedSize = false) } else -> { diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt index 650eab0ba..927f9e090 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt @@ -450,7 +450,7 @@ fun com.google.protobuf.conformance.ConformanceRequestInternal.Companion.decodeW msg.testCategory = com.google.protobuf.conformance.TestCategory.fromNumber(decoder.readEnum()) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.jspbEncodingOptions = com.google.protobuf.conformance.JspbEncodingConfigInternal() } diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt index 165a477b3..b422e6fff 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt @@ -1805,7 +1805,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal msg.optionalBytes = decoder.readBytes() } - tag.fieldNr == 18 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 18 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.optionalNestedMessage = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() @@ -1817,7 +1817,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ) } - tag.fieldNr == 19 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 19 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[1]) { msg.optionalForeignMessage = com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() @@ -1852,7 +1852,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal msg.optionalCord = decoder.readString() } - tag.fieldNr == 27 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 27 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[2]) { msg.recursiveMessage = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() @@ -2487,7 +2487,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } - tag.fieldNr == 201 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 201 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[3]) { msg.optionalBoolWrapper = com.google.protobuf.kotlin.BoolValueInternal() } @@ -2498,7 +2498,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ) } - tag.fieldNr == 202 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 202 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[4]) { msg.optionalInt32Wrapper = com.google.protobuf.kotlin.Int32ValueInternal() } @@ -2509,7 +2509,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ) } - tag.fieldNr == 203 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 203 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[5]) { msg.optionalInt64Wrapper = com.google.protobuf.kotlin.Int64ValueInternal() } @@ -2520,7 +2520,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ) } - tag.fieldNr == 204 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 204 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[6]) { msg.optionalUint32Wrapper = com.google.protobuf.kotlin.UInt32ValueInternal() } @@ -2531,7 +2531,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ) } - tag.fieldNr == 205 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 205 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[7]) { msg.optionalUint64Wrapper = com.google.protobuf.kotlin.UInt64ValueInternal() } @@ -2542,7 +2542,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ) } - tag.fieldNr == 206 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 206 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[8]) { msg.optionalFloatWrapper = com.google.protobuf.kotlin.FloatValueInternal() } @@ -2553,7 +2553,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ) } - tag.fieldNr == 207 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 207 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[9]) { msg.optionalDoubleWrapper = com.google.protobuf.kotlin.DoubleValueInternal() } @@ -2564,7 +2564,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ) } - tag.fieldNr == 208 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 208 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[10]) { msg.optionalStringWrapper = com.google.protobuf.kotlin.StringValueInternal() } @@ -2575,7 +2575,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ) } - tag.fieldNr == 209 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 209 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[11]) { msg.optionalBytesWrapper = com.google.protobuf.kotlin.BytesValueInternal() } @@ -2640,7 +2640,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal (msg.repeatedBytesWrapper as MutableList).add(elem) } - tag.fieldNr == 301 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 301 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[12]) { msg.optionalDuration = com.google.protobuf.kotlin.DurationInternal() } @@ -2651,7 +2651,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ) } - tag.fieldNr == 302 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 302 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[13]) { msg.optionalTimestamp = com.google.protobuf.kotlin.TimestampInternal() } @@ -2662,7 +2662,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ) } - tag.fieldNr == 303 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 303 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[14]) { msg.optionalFieldMask = com.google.protobuf.kotlin.FieldMaskInternal() } @@ -2673,7 +2673,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ) } - tag.fieldNr == 304 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 304 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[15]) { msg.optionalStruct = com.google.protobuf.kotlin.StructInternal() } @@ -2684,7 +2684,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ) } - tag.fieldNr == 305 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 305 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[16]) { msg.optionalAny = com.google.protobuf.kotlin.AnyInternal() } @@ -2692,7 +2692,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal decoder.readMessage(msg.optionalAny.asInternal(), com.google.protobuf.kotlin.AnyInternal::decodeWith) } - tag.fieldNr == 306 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 306 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[17]) { msg.optionalValue = com.google.protobuf.kotlin.ValueInternal() } @@ -2826,7 +2826,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint32(decoder.readUInt32()) } - tag.fieldNr == 112 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 112 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val field = (msg.oneofField as? com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage) ?: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage( @@ -4380,7 +4380,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal msg.a = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.corecursive = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() } @@ -5457,7 +5457,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.value = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() @@ -5538,7 +5538,7 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.value = com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() } diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt index 7c01ed3d3..ef8718432 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt @@ -1787,7 +1787,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio msg.optionalBytes = decoder.readBytes() } - tag.fieldNr == 18 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 18 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.optionalNestedMessage = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() @@ -1799,7 +1799,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio ) } - tag.fieldNr == 19 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 19 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[1]) { msg.optionalForeignMessage = com.google.protobuf_test_messages.proto3.ForeignMessageInternal() } @@ -1833,7 +1833,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio msg.optionalCord = decoder.readString() } - tag.fieldNr == 27 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 27 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[2]) { msg.recursiveMessage = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } @@ -2466,7 +2466,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio } } - tag.fieldNr == 201 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 201 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[3]) { msg.optionalBoolWrapper = com.google.protobuf.kotlin.BoolValueInternal() } @@ -2477,7 +2477,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio ) } - tag.fieldNr == 202 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 202 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[4]) { msg.optionalInt32Wrapper = com.google.protobuf.kotlin.Int32ValueInternal() } @@ -2488,7 +2488,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio ) } - tag.fieldNr == 203 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 203 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[5]) { msg.optionalInt64Wrapper = com.google.protobuf.kotlin.Int64ValueInternal() } @@ -2499,7 +2499,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio ) } - tag.fieldNr == 204 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 204 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[6]) { msg.optionalUint32Wrapper = com.google.protobuf.kotlin.UInt32ValueInternal() } @@ -2510,7 +2510,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio ) } - tag.fieldNr == 205 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 205 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[7]) { msg.optionalUint64Wrapper = com.google.protobuf.kotlin.UInt64ValueInternal() } @@ -2521,7 +2521,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio ) } - tag.fieldNr == 206 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 206 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[8]) { msg.optionalFloatWrapper = com.google.protobuf.kotlin.FloatValueInternal() } @@ -2532,7 +2532,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio ) } - tag.fieldNr == 207 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 207 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[9]) { msg.optionalDoubleWrapper = com.google.protobuf.kotlin.DoubleValueInternal() } @@ -2543,7 +2543,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio ) } - tag.fieldNr == 208 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 208 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[10]) { msg.optionalStringWrapper = com.google.protobuf.kotlin.StringValueInternal() } @@ -2554,7 +2554,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio ) } - tag.fieldNr == 209 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 209 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[11]) { msg.optionalBytesWrapper = com.google.protobuf.kotlin.BytesValueInternal() } @@ -2619,7 +2619,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio (msg.repeatedBytesWrapper as MutableList).add(elem) } - tag.fieldNr == 301 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 301 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[12]) { msg.optionalDuration = com.google.protobuf.kotlin.DurationInternal() } @@ -2630,7 +2630,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio ) } - tag.fieldNr == 302 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 302 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[13]) { msg.optionalTimestamp = com.google.protobuf.kotlin.TimestampInternal() } @@ -2641,7 +2641,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio ) } - tag.fieldNr == 303 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 303 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[14]) { msg.optionalFieldMask = com.google.protobuf.kotlin.FieldMaskInternal() } @@ -2652,7 +2652,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio ) } - tag.fieldNr == 304 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 304 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[15]) { msg.optionalStruct = com.google.protobuf.kotlin.StructInternal() } @@ -2663,7 +2663,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio ) } - tag.fieldNr == 305 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 305 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[16]) { msg.optionalAny = com.google.protobuf.kotlin.AnyInternal() } @@ -2671,7 +2671,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio decoder.readMessage(msg.optionalAny.asInternal(), com.google.protobuf.kotlin.AnyInternal::decodeWith) } - tag.fieldNr == 306 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 306 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[17]) { msg.optionalValue = com.google.protobuf.kotlin.ValueInternal() } @@ -2805,7 +2805,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint32(decoder.readUInt32()) } - tag.fieldNr == 112 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 112 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val field = (msg.oneofField as? com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage) ?: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal()) @@ -4339,7 +4339,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMe msg.a = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.corecursive = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } @@ -5394,7 +5394,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.value = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() @@ -5475,7 +5475,7 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.START_GROUP -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { if (!msg.presenceMask[0]) { msg.value = com.google.protobuf_test_messages.proto3.ForeignMessageInternal() } From a74ed3df4a44bc9207044bee18d2ea76a7abc139 Mon Sep 17 00:00:00 2001 From: Johannes Zottele Date: Wed, 10 Sep 2025 09:48:19 +0200 Subject: [PATCH 3/7] protobuf: Fix unexpected END_GROUP Signed-off-by: Johannes Zottele --- .../protobuf/kotlin/_rpc_internal/Any.kt | 4 + .../protobuf/kotlin/_rpc_internal/Api.kt | 12 +++ .../protobuf/kotlin/_rpc_internal/Duration.kt | 4 + .../protobuf/kotlin/_rpc_internal/Empty.kt | 4 + .../kotlin/_rpc_internal/FieldMask.kt | 4 + .../kotlin/_rpc_internal/SourceContext.kt | 4 + .../protobuf/kotlin/_rpc_internal/Struct.kt | 16 ++++ .../kotlin/_rpc_internal/Timestamp.kt | 4 + .../protobuf/kotlin/_rpc_internal/Type.kt | 20 ++++ .../protobuf/kotlin/_rpc_internal/Wrappers.kt | 36 +++++++ .../ModelToProtobufKotlinCommonGenerator.kt | 6 ++ .../conformance/_rpc_internal/Conformance.kt | 20 ++++ .../TestMessagesProto3Editions.kt | 96 +++++++++++++++++++ .../_rpc_internal/TestMessagesProto3.kt | 96 +++++++++++++++++++ 14 files changed, 326 insertions(+) diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt index 685b8a28c..cc72649be 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt @@ -89,6 +89,10 @@ public fun com.google.protobuf.kotlin.AnyInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt index 0cf59d5e1..4fbbe9308 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt @@ -262,6 +262,10 @@ public fun com.google.protobuf.kotlin.ApiInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -421,6 +425,10 @@ public fun com.google.protobuf.kotlin.MethodInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -529,6 +537,10 @@ public fun com.google.protobuf.kotlin.MixinInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt index 11b6778a9..2a0b116fe 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt @@ -88,6 +88,10 @@ public fun com.google.protobuf.kotlin.DurationInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt index 5d99a7628..a9385df15 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt @@ -67,6 +67,10 @@ public fun com.google.protobuf.kotlin.EmptyInternal.Companion.decodeWith( val tag = decoder.readTag() ?: break // EOF, we read the whole message when { else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt index 1e5197b6b..4cb14186b 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt @@ -81,6 +81,10 @@ public fun com.google.protobuf.kotlin.FieldMaskInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt index cecfa79fa..fd1eadf3e 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt @@ -79,6 +79,10 @@ public fun com.google.protobuf.kotlin.SourceContextInternal.Companion.decodeWith } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt index 45752bfda..4cd324c2c 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt @@ -196,6 +196,10 @@ public fun com.google.protobuf.kotlin.StructInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -318,6 +322,10 @@ public fun com.google.protobuf.kotlin.ValueInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -420,6 +428,10 @@ public fun com.google.protobuf.kotlin.ListValueInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -487,6 +499,10 @@ public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.Compani } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt index 94c7ce7a3..baec52a35 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt @@ -88,6 +88,10 @@ public fun com.google.protobuf.kotlin.TimestampInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt index ff31bce5a..609c00e07 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt @@ -357,6 +357,10 @@ public fun com.google.protobuf.kotlin.TypeInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -540,6 +544,10 @@ public fun com.google.protobuf.kotlin.FieldInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -729,6 +737,10 @@ public fun com.google.protobuf.kotlin.EnumInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -847,6 +859,10 @@ public fun com.google.protobuf.kotlin.EnumValueInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -930,6 +946,10 @@ public fun com.google.protobuf.kotlin.OptionInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt index ac3c212dc..7b58d155f 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt @@ -414,6 +414,10 @@ public fun com.google.protobuf.kotlin.DoubleValueInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -464,6 +468,10 @@ public fun com.google.protobuf.kotlin.FloatValueInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -514,6 +522,10 @@ public fun com.google.protobuf.kotlin.Int64ValueInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -564,6 +576,10 @@ public fun com.google.protobuf.kotlin.UInt64ValueInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -614,6 +630,10 @@ public fun com.google.protobuf.kotlin.Int32ValueInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -664,6 +684,10 @@ public fun com.google.protobuf.kotlin.UInt32ValueInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -714,6 +738,10 @@ public fun com.google.protobuf.kotlin.BoolValueInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -764,6 +792,10 @@ public fun com.google.protobuf.kotlin.StringValueInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -816,6 +848,10 @@ public fun com.google.protobuf.kotlin.BytesValueInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } diff --git a/protoc-gen/protobuf/src/main/kotlin/kotlinx/rpc/protoc/gen/ModelToProtobufKotlinCommonGenerator.kt b/protoc-gen/protobuf/src/main/kotlin/kotlinx/rpc/protoc/gen/ModelToProtobufKotlinCommonGenerator.kt index 810c19931..85920d03b 100644 --- a/protoc-gen/protobuf/src/main/kotlin/kotlinx/rpc/protoc/gen/ModelToProtobufKotlinCommonGenerator.kt +++ b/protoc-gen/protobuf/src/main/kotlin/kotlinx/rpc/protoc/gen/ModelToProtobufKotlinCommonGenerator.kt @@ -327,6 +327,12 @@ class ModelToProtobufKotlinCommonGenerator( whenBlock { declaration.actualFields.forEach { field -> readMatchCase(field) } whenCase("else") { + if (!declaration.isGroup) { + // fail if we come across an END_GROUP in a normal message + ifBranch(condition = "tag.wireType == $PB_PKG.WireType.END_GROUP", ifBlock = { + code("throw $PB_PKG.ProtobufDecodingException(\"Unexpected END_GROUP tag.\")") + }) + } code("// we are currently just skipping unknown fields (KRPC-191)") code("decoder.skipValue(tag)") } diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt index 927f9e090..a681ec39e 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt @@ -275,6 +275,10 @@ fun com.google.protobuf.conformance.TestStatusInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -352,6 +356,10 @@ fun com.google.protobuf.conformance.FailureSetInternal.Companion.decodeWith( } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -486,6 +494,10 @@ fun com.google.protobuf.conformance.ConformanceRequestInternal.Companion.decodeW } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -683,6 +695,10 @@ fun com.google.protobuf.conformance.ConformanceResponseInternal.Companion.decode } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -811,6 +827,10 @@ fun com.google.protobuf.conformance.JspbEncodingConfigInternal.Companion.decodeW } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt index b422e6fff..c54959ca8 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt @@ -2888,6 +2888,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4248,6 +4252,10 @@ fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.Com } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4292,6 +4300,10 @@ fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Intern val tag = decoder.readTag() ?: break // EOF, we read the whole message when { else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4329,6 +4341,10 @@ fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.Com val tag = decoder.readTag() ?: break // EOF, we read the whole message when { else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4392,6 +4408,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4461,6 +4481,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4527,6 +4551,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4593,6 +4621,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4659,6 +4691,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4725,6 +4761,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4791,6 +4831,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4857,6 +4901,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4923,6 +4971,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4989,6 +5041,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5055,6 +5111,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5121,6 +5181,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5187,6 +5251,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5253,6 +5321,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5319,6 +5391,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5389,6 +5465,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5470,6 +5550,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5550,6 +5634,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5621,6 +5709,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5689,6 +5781,10 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt index ef8718432..4b3001d22 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt @@ -2862,6 +2862,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4209,6 +4213,10 @@ fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.Companion.de } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4253,6 +4261,10 @@ fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.Compan val tag = decoder.readTag() ?: break // EOF, we read the whole message when { else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4290,6 +4302,10 @@ fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.Companion.de val tag = decoder.readTag() ?: break // EOF, we read the whole message when { else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4351,6 +4367,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMe } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4418,6 +4438,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32 } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4482,6 +4506,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64 } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4546,6 +4574,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint3 } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4610,6 +4642,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint6 } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4674,6 +4710,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint3 } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4738,6 +4778,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint6 } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4804,6 +4848,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4870,6 +4918,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -4936,6 +4988,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixe } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5002,6 +5058,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixe } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5066,6 +5126,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32 } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5130,6 +5194,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32 } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5194,6 +5262,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolB } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5258,6 +5330,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5326,6 +5402,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5407,6 +5487,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5487,6 +5571,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5558,6 +5646,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } @@ -5626,6 +5718,10 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin } else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") + } + // we are currently just skipping unknown fields (KRPC-191) decoder.skipValue(tag) } From c4c0e591cafce09de3e055f0710b689ef7c783bf Mon Sep 17 00:00:00 2001 From: Johannes Zottele Date: Wed, 10 Sep 2025 10:00:58 +0200 Subject: [PATCH 4/7] protobuf: Add oneof groups test Signed-off-by: Johannes Zottele --- .../kotlin/kotlinx/rpc/protobuf/test/ProtosTest.kt | 13 +++++++++++-- .../protobuf-core/src/commonTest/proto/groups.proto | 13 ++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/protobuf/protobuf-core/src/commonTest/kotlin/kotlinx/rpc/protobuf/test/ProtosTest.kt b/protobuf/protobuf-core/src/commonTest/kotlin/kotlinx/rpc/protobuf/test/ProtosTest.kt index a3ad80169..0bb591c0b 100644 --- a/protobuf/protobuf-core/src/commonTest/kotlin/kotlinx/rpc/protobuf/test/ProtosTest.kt +++ b/protobuf/protobuf-core/src/commonTest/kotlin/kotlinx/rpc/protobuf/test/ProtosTest.kt @@ -9,8 +9,6 @@ import OneOfMsgInternal import OneOfWithRequired import Outer import OuterInternal -import WithGroups -import WithGroupsInternal import asInternal import encodeWith import invoke @@ -20,6 +18,9 @@ import kotlinx.rpc.protobuf.input.stream.asInputStream import kotlinx.rpc.protobuf.input.stream.asSource import kotlinx.rpc.protobuf.internal.ProtobufDecodingException import kotlinx.rpc.protobuf.internal.WireEncoder +import test.groups.WithGroups +import test.groups.WithGroupsInternal +import test.groups.invoke import test.nested.NestedOuter import test.nested.NestedOuterInternal import test.nested.NotInside @@ -436,6 +437,9 @@ class ProtosTest { value = "Second Item" } ) + oneOfWithGroup = WithGroups.OneOfWithGroup.Testgroup(WithGroups.TestGroup { + value = 42u + }) } val decoded = encodeDecode(msg, WithGroupsInternal.CODEC) @@ -443,5 +447,10 @@ class ProtosTest { for ((i, group) in msg.secondgroup.withIndex()) { assertEquals(group.value, decoded.secondgroup[i].value) } + assertTrue(decoded.oneOfWithGroup is WithGroups.OneOfWithGroup.Testgroup) + assertEquals( + (msg.oneOfWithGroup as WithGroups.OneOfWithGroup.Testgroup).value.value, + (decoded.oneOfWithGroup as WithGroups.OneOfWithGroup.Testgroup).value.value + ) } } diff --git a/protobuf/protobuf-core/src/commonTest/proto/groups.proto b/protobuf/protobuf-core/src/commonTest/proto/groups.proto index b725b1b9c..d092f40cc 100644 --- a/protobuf/protobuf-core/src/commonTest/proto/groups.proto +++ b/protobuf/protobuf-core/src/commonTest/proto/groups.proto @@ -1,3 +1,5 @@ +package test.groups; + message WithGroups { required group FirstGroup = 1 { required fixed32 value = 2; @@ -7,9 +9,10 @@ message WithGroups { required string value = 2; } - // oneof test { - // group TestGroup = 3 { - // required fixed32 value = 2; - // } - // } + oneof oneOfWithGroup { + int32 anInt32 = 4; + group TestGroup = 3 { + required fixed32 value = 2; + } + } } \ No newline at end of file From 9e2da9b95fbfe1d616b80d96bff2941d07397ee5 Mon Sep 17 00:00:00 2001 From: Johannes Zottele Date: Wed, 10 Sep 2025 10:03:27 +0200 Subject: [PATCH 5/7] protobuf: Fix name in ConformanceTest.kt Signed-off-by: Johannes Zottele --- .../kotlin/kotlinx/rpc/protoc/gen/test/ConformanceTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/protobuf-conformance/src/test/kotlin/kotlinx/rpc/protoc/gen/test/ConformanceTest.kt b/tests/protobuf-conformance/src/test/kotlin/kotlinx/rpc/protoc/gen/test/ConformanceTest.kt index c5b4ae102..14dce3c77 100644 --- a/tests/protobuf-conformance/src/test/kotlin/kotlinx/rpc/protoc/gen/test/ConformanceTest.kt +++ b/tests/protobuf-conformance/src/test/kotlin/kotlinx/rpc/protoc/gen/test/ConformanceTest.kt @@ -84,11 +84,11 @@ class ConformanceTest { return (fails.entries.map { (test, message) -> DynamicTest.dynamicTest(test.testDisplayName()) { - fail("FAILED: '${test.testDisplayName()}' with: $message") + fail("FAILED: '${test}' with: $message") } } + passed.map { test -> DynamicTest.dynamicTest(test.testDisplayName()) { - println("PASSED: '${test.testDisplayName()}'") + println("PASSED: '${test}'") } }).stream() } From 969b1bc62b0c174c742bac3ab394815e918a03ff Mon Sep 17 00:00:00 2001 From: Johannes Zottele Date: Wed, 10 Sep 2025 14:51:19 +0200 Subject: [PATCH 6/7] pb: Revert autolint changes Signed-off-by: Johannes Zottele --- .../protobuf/kotlin/_rpc_internal/Any.kt | 78 +- .../protobuf/kotlin/_rpc_internal/Api.kt | 362 +- .../protobuf/kotlin/_rpc_internal/Duration.kt | 71 +- .../protobuf/kotlin/_rpc_internal/Empty.kt | 45 +- .../kotlin/_rpc_internal/FieldMask.kt | 63 +- .../kotlin/_rpc_internal/SourceContext.kt | 62 +- .../protobuf/kotlin/_rpc_internal/Struct.kt | 359 +- .../kotlin/_rpc_internal/Timestamp.kt | 71 +- .../protobuf/kotlin/_rpc_internal/Type.kt | 689 +-- .../protobuf/kotlin/_rpc_internal/Wrappers.kt | 489 +- .../conformance/_rpc_internal/Conformance.kt | 611 +-- .../TestMessagesProto3Editions.kt | 4268 ++++++----------- .../_rpc_internal/TestMessagesProto3.kt | 4041 ++++++---------- 13 files changed, 4143 insertions(+), 7066 deletions(-) diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt index cc72649be..d32f57974 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt @@ -3,19 +3,13 @@ */ @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) - package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.ExperimentalRpcApi +import kotlinx.rpc.internal.utils.* import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.MsgFieldDelegate -import kotlinx.rpc.protobuf.internal.bytes -import kotlinx.rpc.protobuf.internal.int32 -import kotlinx.rpc.protobuf.internal.string -import kotlinx.rpc.protobuf.internal.tag - -public class AnyInternal : com.google.protobuf.kotlin.Any, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +import kotlinx.rpc.protobuf.internal.* + +public class AnyInternal: com.google.protobuf.kotlin.Any, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -23,21 +17,21 @@ public class AnyInternal : com.google.protobuf.kotlin.Any, public override var value: ByteArray by MsgFieldDelegate { byteArrayOf() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Any): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Any): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Any { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Any { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.AnyInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.AnyInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -50,46 +44,43 @@ public class AnyInternal : com.google.protobuf.kotlin.Any, public companion object } -public operator fun com.google.protobuf.kotlin.Any.Companion.invoke(body: com.google.protobuf.kotlin.AnyInternal.() -> Unit): com.google.protobuf.kotlin.Any { +public operator fun com.google.protobuf.kotlin.Any.Companion.invoke(body: com.google.protobuf.kotlin.AnyInternal.() -> Unit): com.google.protobuf.kotlin.Any { val msg = com.google.protobuf.kotlin.AnyInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.AnyInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.AnyInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.AnyInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (typeUrl.isNotEmpty()) { +public fun com.google.protobuf.kotlin.AnyInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (typeUrl.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = typeUrl) } - if (value.isNotEmpty()) { + if (value.isNotEmpty()) { encoder.writeBytes(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.AnyInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.AnyInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.AnyInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.AnyInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.typeUrl = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readBytes() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -100,32 +91,21 @@ public fun com.google.protobuf.kotlin.AnyInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.AnyInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.AnyInternal.computeSize(): Int { var __result = 0 - if (typeUrl.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(typeUrl).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (typeUrl.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(typeUrl).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Any.asInternal(): com.google.protobuf.kotlin.AnyInternal { - return this as? com.google.protobuf.kotlin.AnyInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Any.asInternal(): com.google.protobuf.kotlin.AnyInternal { + return this as? com.google.protobuf.kotlin.AnyInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt index 4fbbe9308..bdbc68018 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt @@ -3,21 +3,14 @@ */ @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) - package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.ExperimentalRpcApi +import kotlinx.rpc.internal.utils.* import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.MsgFieldDelegate -import kotlinx.rpc.protobuf.internal.bool -import kotlinx.rpc.protobuf.internal.enum -import kotlinx.rpc.protobuf.internal.int32 -import kotlinx.rpc.protobuf.internal.string -import kotlinx.rpc.protobuf.internal.tag - -public class ApiInternal : com.google.protobuf.kotlin.Api, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { +import kotlinx.rpc.protobuf.internal.* + +public class ApiInternal: com.google.protobuf.kotlin.Api, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { public const val sourceContext: Int = 0 } @@ -33,21 +26,21 @@ public class ApiInternal : com.google.protobuf.kotlin.Api, public override var syntax: com.google.protobuf.kotlin.Syntax by MsgFieldDelegate { com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2 } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Api): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Api): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Api { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Api { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.ApiInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.ApiInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -60,8 +53,7 @@ public class ApiInternal : com.google.protobuf.kotlin.Api, public companion object } -public class MethodInternal : com.google.protobuf.kotlin.Method, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class MethodInternal: com.google.protobuf.kotlin.Method, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -74,21 +66,21 @@ public class MethodInternal : com.google.protobuf.kotlin.Method, public override var syntax: com.google.protobuf.kotlin.Syntax by MsgFieldDelegate { com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2 } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Method): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Method): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Method { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Method { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.MethodInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.MethodInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -101,8 +93,7 @@ public class MethodInternal : com.google.protobuf.kotlin.Method, public companion object } -public class MixinInternal : com.google.protobuf.kotlin.Mixin, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class MixinInternal: com.google.protobuf.kotlin.Mixin, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -110,21 +101,21 @@ public class MixinInternal : com.google.protobuf.kotlin.Mixin, public override var root: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Mixin): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Mixin): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Mixin { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Mixin { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.MixinInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.MixinInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -137,132 +128,126 @@ public class MixinInternal : com.google.protobuf.kotlin.Mixin, public companion object } -public operator fun com.google.protobuf.kotlin.Api.Companion.invoke(body: com.google.protobuf.kotlin.ApiInternal.() -> Unit): com.google.protobuf.kotlin.Api { +public operator fun com.google.protobuf.kotlin.Api.Companion.invoke(body: com.google.protobuf.kotlin.ApiInternal.() -> Unit): com.google.protobuf.kotlin.Api { val msg = com.google.protobuf.kotlin.ApiInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Method.Companion.invoke(body: com.google.protobuf.kotlin.MethodInternal.() -> Unit): com.google.protobuf.kotlin.Method { +public operator fun com.google.protobuf.kotlin.Method.Companion.invoke(body: com.google.protobuf.kotlin.MethodInternal.() -> Unit): com.google.protobuf.kotlin.Method { val msg = com.google.protobuf.kotlin.MethodInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Mixin.Companion.invoke(body: com.google.protobuf.kotlin.MixinInternal.() -> Unit): com.google.protobuf.kotlin.Mixin { +public operator fun com.google.protobuf.kotlin.Mixin.Companion.invoke(body: com.google.protobuf.kotlin.MixinInternal.() -> Unit): com.google.protobuf.kotlin.Mixin { val msg = com.google.protobuf.kotlin.MixinInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ApiInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.ApiInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { sourceContext.asInternal().checkRequiredFields() } - methods.forEach { + methods.forEach { it.asInternal().checkRequiredFields() } - options.forEach { + options.forEach { it.asInternal().checkRequiredFields() } - mixins.forEach { + mixins.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ApiInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.ApiInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (methods.isNotEmpty()) { - methods.forEach { + if (methods.isNotEmpty()) { + methods.forEach { encoder.writeMessage(fieldNr = 2, value = it.asInternal()) { encodeWith(it) } } } - if (options.isNotEmpty()) { - options.forEach { + if (options.isNotEmpty()) { + options.forEach { encoder.writeMessage(fieldNr = 3, value = it.asInternal()) { encodeWith(it) } } } - if (version.isNotEmpty()) { + if (version.isNotEmpty()) { encoder.writeString(fieldNr = 4, value = version) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 5, value = sourceContext.asInternal()) { encodeWith(it) } } - if (mixins.isNotEmpty()) { - mixins.forEach { + if (mixins.isNotEmpty()) { + mixins.forEach { encoder.writeMessage(fieldNr = 6, value = it.asInternal()) { encodeWith(it) } } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { encoder.writeEnum(fieldNr = 7, value = syntax.number) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ApiInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.ApiInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.ApiInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.ApiInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.MethodInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.MethodInternal::decodeWith) (msg.methods as MutableList).add(elem) } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.OptionInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.OptionInternal::decodeWith) (msg.options as MutableList).add(elem) } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.version = decoder.readString() } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { msg.sourceContext = com.google.protobuf.kotlin.SourceContextInternal() } - decoder.readMessage( - msg.sourceContext.asInternal(), - com.google.protobuf.kotlin.SourceContextInternal::decodeWith - ) + decoder.readMessage(msg.sourceContext.asInternal(), com.google.protobuf.kotlin.SourceContextInternal::decodeWith) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.MixinInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.MixinInternal::decodeWith) (msg.mixins as MutableList).add(elem) } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.syntax = com.google.protobuf.kotlin.Syntax.fromNumber(decoder.readEnum()) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -273,159 +258,122 @@ public fun com.google.protobuf.kotlin.ApiInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.ApiInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.ApiInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (methods.isNotEmpty()) { - __result += methods.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (methods.isNotEmpty()) { + __result += methods.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (options.isNotEmpty()) { - __result += options.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 3, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (options.isNotEmpty()) { + __result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (version.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(version).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 4, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (version.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(version).let { kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[0]) { - __result += sourceContext.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 5, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += sourceContext.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (mixins.isNotEmpty()) { - __result += mixins.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 6, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (mixins.isNotEmpty()) { + __result += mixins.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 7, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Api.asInternal(): com.google.protobuf.kotlin.ApiInternal { - return this as? com.google.protobuf.kotlin.ApiInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Api.asInternal(): com.google.protobuf.kotlin.ApiInternal { + return this as? com.google.protobuf.kotlin.ApiInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.MethodInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.MethodInternal.checkRequiredFields() { // no required fields to check - options.forEach { + options.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.MethodInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.MethodInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (requestTypeUrl.isNotEmpty()) { + if (requestTypeUrl.isNotEmpty()) { encoder.writeString(fieldNr = 2, value = requestTypeUrl) } - if (requestStreaming != false) { + if (requestStreaming != false) { encoder.writeBool(fieldNr = 3, value = requestStreaming) } - if (responseTypeUrl.isNotEmpty()) { + if (responseTypeUrl.isNotEmpty()) { encoder.writeString(fieldNr = 4, value = responseTypeUrl) } - if (responseStreaming != false) { + if (responseStreaming != false) { encoder.writeBool(fieldNr = 5, value = responseStreaming) } - if (options.isNotEmpty()) { - options.forEach { + if (options.isNotEmpty()) { + options.forEach { encoder.writeMessage(fieldNr = 6, value = it.asInternal()) { encodeWith(it) } } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { encoder.writeEnum(fieldNr = 7, value = syntax.number) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.MethodInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.MethodInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.MethodInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.MethodInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.requestTypeUrl = decoder.readString() } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.requestStreaming = decoder.readBool() } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.responseTypeUrl = decoder.readString() } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.responseStreaming = decoder.readBool() } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.OptionInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.OptionInternal::decodeWith) (msg.options as MutableList).add(elem) } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.syntax = com.google.protobuf.kotlin.Syntax.fromNumber(decoder.readEnum()) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -436,108 +384,75 @@ public fun com.google.protobuf.kotlin.MethodInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.MethodInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.MethodInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (requestTypeUrl.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(requestTypeUrl).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (requestTypeUrl.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(requestTypeUrl).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (requestStreaming != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 3, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(requestStreaming)) + if (requestStreaming != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(requestStreaming)) } - if (responseTypeUrl.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(responseTypeUrl).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 4, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (responseTypeUrl.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(responseTypeUrl).let { kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (responseStreaming != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 5, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(responseStreaming)) + if (responseStreaming != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(responseStreaming)) } - if (options.isNotEmpty()) { - __result += options.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 6, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (options.isNotEmpty()) { + __result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 7, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Method.asInternal(): com.google.protobuf.kotlin.MethodInternal { - return this as? com.google.protobuf.kotlin.MethodInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Method.asInternal(): com.google.protobuf.kotlin.MethodInternal { + return this as? com.google.protobuf.kotlin.MethodInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.MixinInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.MixinInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.MixinInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.MixinInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (root.isNotEmpty()) { + if (root.isNotEmpty()) { encoder.writeString(fieldNr = 2, value = root) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.MixinInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.MixinInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.MixinInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.MixinInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.root = decoder.readString() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -548,32 +463,21 @@ public fun com.google.protobuf.kotlin.MixinInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.MixinInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.MixinInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (root.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(root).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (root.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(root).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Mixin.asInternal(): com.google.protobuf.kotlin.MixinInternal { - return this as? com.google.protobuf.kotlin.MixinInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Mixin.asInternal(): com.google.protobuf.kotlin.MixinInternal { + return this as? com.google.protobuf.kotlin.MixinInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt index 2a0b116fe..4ae2dd14e 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt @@ -3,18 +3,13 @@ */ @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) - package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.ExperimentalRpcApi +import kotlinx.rpc.internal.utils.* import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.MsgFieldDelegate -import kotlinx.rpc.protobuf.internal.int32 -import kotlinx.rpc.protobuf.internal.int64 -import kotlinx.rpc.protobuf.internal.tag +import kotlinx.rpc.protobuf.internal.* -public class DurationInternal : com.google.protobuf.kotlin.Duration, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class DurationInternal: com.google.protobuf.kotlin.Duration, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -22,21 +17,21 @@ public class DurationInternal : com.google.protobuf.kotlin.Duration, public override var nanos: Int by MsgFieldDelegate { 0 } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Duration): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Duration): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Duration { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Duration { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.DurationInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.DurationInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -49,46 +44,43 @@ public class DurationInternal : com.google.protobuf.kotlin.Duration, public companion object } -public operator fun com.google.protobuf.kotlin.Duration.Companion.invoke(body: com.google.protobuf.kotlin.DurationInternal.() -> Unit): com.google.protobuf.kotlin.Duration { +public operator fun com.google.protobuf.kotlin.Duration.Companion.invoke(body: com.google.protobuf.kotlin.DurationInternal.() -> Unit): com.google.protobuf.kotlin.Duration { val msg = com.google.protobuf.kotlin.DurationInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DurationInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.DurationInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DurationInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (seconds != 0L) { +public fun com.google.protobuf.kotlin.DurationInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (seconds != 0L) { encoder.writeInt64(fieldNr = 1, value = seconds) } - if (nanos != 0) { + if (nanos != 0) { encoder.writeInt32(fieldNr = 2, value = nanos) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DurationInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.DurationInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.DurationInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.DurationInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.seconds = decoder.readInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.nanos = decoder.readInt32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -99,28 +91,21 @@ public fun com.google.protobuf.kotlin.DurationInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.DurationInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.DurationInternal.computeSize(): Int { var __result = 0 - if (seconds != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int64(seconds)) + if (seconds != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(seconds)) } - if (nanos != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(nanos)) + if (nanos != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(nanos)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Duration.asInternal(): com.google.protobuf.kotlin.DurationInternal { - return this as? com.google.protobuf.kotlin.DurationInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Duration.asInternal(): com.google.protobuf.kotlin.DurationInternal { + return this as? com.google.protobuf.kotlin.DurationInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt index a9385df15..249a856c7 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt @@ -3,33 +3,32 @@ */ @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) - package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.ExperimentalRpcApi +import kotlinx.rpc.internal.utils.* import kotlinx.rpc.protobuf.input.stream.asInputStream +import kotlinx.rpc.protobuf.internal.* -public class EmptyInternal : com.google.protobuf.kotlin.Empty, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class EmptyInternal: com.google.protobuf.kotlin.Empty, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Empty): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Empty): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Empty { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Empty { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.EmptyInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.EmptyInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -42,32 +41,29 @@ public class EmptyInternal : com.google.protobuf.kotlin.Empty, public companion object } -public operator fun com.google.protobuf.kotlin.Empty.Companion.invoke(body: com.google.protobuf.kotlin.EmptyInternal.() -> Unit): com.google.protobuf.kotlin.Empty { +public operator fun com.google.protobuf.kotlin.Empty.Companion.invoke(body: com.google.protobuf.kotlin.EmptyInternal.() -> Unit): com.google.protobuf.kotlin.Empty { val msg = com.google.protobuf.kotlin.EmptyInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EmptyInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.EmptyInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EmptyInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { +public fun com.google.protobuf.kotlin.EmptyInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { // no fields to encode } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EmptyInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.EmptyInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.EmptyInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.EmptyInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + when { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -78,14 +74,13 @@ public fun com.google.protobuf.kotlin.EmptyInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.EmptyInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.EmptyInternal.computeSize(): Int { var __result = 0 return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Empty.asInternal(): com.google.protobuf.kotlin.EmptyInternal { - return this as? com.google.protobuf.kotlin.EmptyInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Empty.asInternal(): com.google.protobuf.kotlin.EmptyInternal { + return this as? com.google.protobuf.kotlin.EmptyInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt index 4cb14186b..b566f984e 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt @@ -3,38 +3,34 @@ */ @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) - package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.ExperimentalRpcApi +import kotlinx.rpc.internal.utils.* import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.MsgFieldDelegate -import kotlinx.rpc.protobuf.internal.string -import kotlinx.rpc.protobuf.internal.tag +import kotlinx.rpc.protobuf.internal.* -public class FieldMaskInternal : com.google.protobuf.kotlin.FieldMask, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class FieldMaskInternal: com.google.protobuf.kotlin.FieldMask, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var paths: List by MsgFieldDelegate { mutableListOf() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.FieldMask): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.FieldMask): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.FieldMask { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.FieldMask { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.FieldMaskInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.FieldMaskInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -47,41 +43,38 @@ public class FieldMaskInternal : com.google.protobuf.kotlin.FieldMask, public companion object } -public operator fun com.google.protobuf.kotlin.FieldMask.Companion.invoke(body: com.google.protobuf.kotlin.FieldMaskInternal.() -> Unit): com.google.protobuf.kotlin.FieldMask { +public operator fun com.google.protobuf.kotlin.FieldMask.Companion.invoke(body: com.google.protobuf.kotlin.FieldMaskInternal.() -> Unit): com.google.protobuf.kotlin.FieldMask { val msg = com.google.protobuf.kotlin.FieldMaskInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldMaskInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.FieldMaskInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldMaskInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (paths.isNotEmpty()) { - paths.forEach { +public fun com.google.protobuf.kotlin.FieldMaskInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (paths.isNotEmpty()) { + paths.forEach { encoder.writeString(1, it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldMaskInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.FieldMaskInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.FieldMaskInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.FieldMaskInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.paths as MutableList).add(elem) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -92,23 +85,17 @@ public fun com.google.protobuf.kotlin.FieldMaskInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.FieldMaskInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.FieldMaskInternal.computeSize(): Int { var __result = 0 - if (paths.isNotEmpty()) { - __result += paths.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (paths.isNotEmpty()) { + __result += paths.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldMask.asInternal(): com.google.protobuf.kotlin.FieldMaskInternal { - return this as? com.google.protobuf.kotlin.FieldMaskInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.FieldMask.asInternal(): com.google.protobuf.kotlin.FieldMaskInternal { + return this as? com.google.protobuf.kotlin.FieldMaskInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt index fd1eadf3e..6bd658673 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt @@ -3,39 +3,34 @@ */ @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) - package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.ExperimentalRpcApi +import kotlinx.rpc.internal.utils.* import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.MsgFieldDelegate -import kotlinx.rpc.protobuf.internal.int32 -import kotlinx.rpc.protobuf.internal.string -import kotlinx.rpc.protobuf.internal.tag +import kotlinx.rpc.protobuf.internal.* -public class SourceContextInternal : com.google.protobuf.kotlin.SourceContext, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class SourceContextInternal: com.google.protobuf.kotlin.SourceContext, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var fileName: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.SourceContext): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.SourceContext): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.SourceContext { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.SourceContext { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.SourceContextInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.SourceContextInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -48,38 +43,35 @@ public class SourceContextInternal : com.google.protobuf.kotlin.SourceContext, public companion object } -public operator fun com.google.protobuf.kotlin.SourceContext.Companion.invoke(body: com.google.protobuf.kotlin.SourceContextInternal.() -> Unit): com.google.protobuf.kotlin.SourceContext { +public operator fun com.google.protobuf.kotlin.SourceContext.Companion.invoke(body: com.google.protobuf.kotlin.SourceContextInternal.() -> Unit): com.google.protobuf.kotlin.SourceContext { val msg = com.google.protobuf.kotlin.SourceContextInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.SourceContextInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.SourceContextInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.SourceContextInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (fileName.isNotEmpty()) { +public fun com.google.protobuf.kotlin.SourceContextInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (fileName.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = fileName) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.SourceContextInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.SourceContextInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.SourceContextInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.SourceContextInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.fileName = decoder.readString() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -90,23 +82,17 @@ public fun com.google.protobuf.kotlin.SourceContextInternal.Companion.decodeWith } } -private fun com.google.protobuf.kotlin.SourceContextInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.SourceContextInternal.computeSize(): Int { var __result = 0 - if (fileName.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(fileName).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (fileName.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(fileName).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.SourceContext.asInternal(): com.google.protobuf.kotlin.SourceContextInternal { - return this as? com.google.protobuf.kotlin.SourceContextInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.SourceContext.asInternal(): com.google.protobuf.kotlin.SourceContextInternal { + return this as? com.google.protobuf.kotlin.SourceContextInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt index 4cd324c2c..b5a691a17 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt @@ -3,28 +3,20 @@ */ @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) - package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.ExperimentalRpcApi +import kotlinx.rpc.internal.utils.* import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.MsgFieldDelegate -import kotlinx.rpc.protobuf.internal.bool -import kotlinx.rpc.protobuf.internal.double -import kotlinx.rpc.protobuf.internal.enum -import kotlinx.rpc.protobuf.internal.int32 -import kotlinx.rpc.protobuf.internal.string -import kotlinx.rpc.protobuf.internal.tag - -public class StructInternal : com.google.protobuf.kotlin.Struct, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +import kotlinx.rpc.protobuf.internal.* + +public class StructInternal: com.google.protobuf.kotlin.Struct, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var fields: Map by MsgFieldDelegate { mutableMapOf() } - public class FieldsEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + public class FieldsEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { public const val value: Int = 0 } @@ -39,21 +31,21 @@ public class StructInternal : com.google.protobuf.kotlin.Struct, } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Struct): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Struct): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Struct { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Struct { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.StructInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.StructInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -66,29 +58,28 @@ public class StructInternal : com.google.protobuf.kotlin.Struct, public companion object } -public class ValueInternal : com.google.protobuf.kotlin.Value, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class ValueInternal: com.google.protobuf.kotlin.Value, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var kind: com.google.protobuf.kotlin.Value.Kind? = null @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Value): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Value): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Value { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Value { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.ValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.ValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -101,29 +92,28 @@ public class ValueInternal : com.google.protobuf.kotlin.Value, public companion object } -public class ListValueInternal : com.google.protobuf.kotlin.ListValue, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class ListValueInternal: com.google.protobuf.kotlin.ListValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var values: List by MsgFieldDelegate { mutableListOf() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.ListValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.ListValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.ListValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.ListValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.ListValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.ListValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -136,67 +126,61 @@ public class ListValueInternal : com.google.protobuf.kotlin.ListValue, public companion object } -public operator fun com.google.protobuf.kotlin.Struct.Companion.invoke(body: com.google.protobuf.kotlin.StructInternal.() -> Unit): com.google.protobuf.kotlin.Struct { +public operator fun com.google.protobuf.kotlin.Struct.Companion.invoke(body: com.google.protobuf.kotlin.StructInternal.() -> Unit): com.google.protobuf.kotlin.Struct { val msg = com.google.protobuf.kotlin.StructInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Value.Companion.invoke(body: com.google.protobuf.kotlin.ValueInternal.() -> Unit): com.google.protobuf.kotlin.Value { +public operator fun com.google.protobuf.kotlin.Value.Companion.invoke(body: com.google.protobuf.kotlin.ValueInternal.() -> Unit): com.google.protobuf.kotlin.Value { val msg = com.google.protobuf.kotlin.ValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.ListValue.Companion.invoke(body: com.google.protobuf.kotlin.ListValueInternal.() -> Unit): com.google.protobuf.kotlin.ListValue { +public operator fun com.google.protobuf.kotlin.ListValue.Companion.invoke(body: com.google.protobuf.kotlin.ListValueInternal.() -> Unit): com.google.protobuf.kotlin.ListValue { val msg = com.google.protobuf.kotlin.ListValueInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.StructInternal.checkRequiredFields() { // no required fields to check - fields.values.forEach { + fields.values.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (fields.isNotEmpty()) { +public fun com.google.protobuf.kotlin.StructInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (fields.isNotEmpty()) { fields.forEach { kEntry -> - com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal().apply { + com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 1, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 1, value = entry.asInternal()) { encodeWith(it) } + } } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.StructInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.StructInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.StructInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal::decodeWith - ) + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal::decodeWith) (msg.fields as MutableMap)[key] = value } } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -207,15 +191,15 @@ public fun com.google.protobuf.kotlin.StructInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.StructInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.StructInternal.computeSize(): Int { var __result = 0 - if (fields.isNotEmpty()) { + if (fields.isNotEmpty()) { __result += fields.entries.sumOf { kEntry -> - com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal().apply { + com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } @@ -223,21 +207,20 @@ private fun com.google.protobuf.kotlin.StructInternal.computeSize(): Int { } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Struct.asInternal(): com.google.protobuf.kotlin.StructInternal { - return this as? com.google.protobuf.kotlin.StructInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Struct.asInternal(): com.google.protobuf.kotlin.StructInternal { + return this as? com.google.protobuf.kotlin.StructInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.ValueInternal.checkRequiredFields() { // no required fields to check - kind?.also { - when { - it is com.google.protobuf.kotlin.Value.Kind.StructValue -> { + kind?.also { + when { + it is com.google.protobuf.kotlin.Value.Kind.StructValue -> { it.value.asInternal().checkRequiredFields() } - it is com.google.protobuf.kotlin.Value.Kind.ListValue -> { + it is com.google.protobuf.kotlin.Value.Kind.ListValue -> { it.value.asInternal().checkRequiredFields() } } @@ -245,30 +228,30 @@ public fun com.google.protobuf.kotlin.ValueInternal.checkRequiredFields() { } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - kind?.also { - when (val value = it) { - is com.google.protobuf.kotlin.Value.Kind.NullValue -> { +public fun com.google.protobuf.kotlin.ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + kind?.also { + when (val value = it) { + is com.google.protobuf.kotlin.Value.Kind.NullValue -> { encoder.writeEnum(fieldNr = 1, value = value.value.number) } - is com.google.protobuf.kotlin.Value.Kind.NumberValue -> { + is com.google.protobuf.kotlin.Value.Kind.NumberValue -> { encoder.writeDouble(fieldNr = 2, value = value.value) } - is com.google.protobuf.kotlin.Value.Kind.StringValue -> { + is com.google.protobuf.kotlin.Value.Kind.StringValue -> { encoder.writeString(fieldNr = 3, value = value.value) } - is com.google.protobuf.kotlin.Value.Kind.BoolValue -> { + is com.google.protobuf.kotlin.Value.Kind.BoolValue -> { encoder.writeBool(fieldNr = 4, value = value.value) } - is com.google.protobuf.kotlin.Value.Kind.StructValue -> { + is com.google.protobuf.kotlin.Value.Kind.StructValue -> { encoder.writeMessage(fieldNr = 5, value = value.value.asInternal()) { encodeWith(it) } } - is com.google.protobuf.kotlin.Value.Kind.ListValue -> { + is com.google.protobuf.kotlin.Value.Kind.ListValue -> { encoder.writeMessage(fieldNr = 6, value = value.value.asInternal()) { encodeWith(it) } } } @@ -276,53 +259,44 @@ public fun com.google.protobuf.kotlin.ValueInternal.encodeWith(encoder: kotlinx. } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ValueInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.ValueInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.ValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.ValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.kind = com.google.protobuf.kotlin.Value.Kind.NullValue( - com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum()) - ) + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.kind = com.google.protobuf.kotlin.Value.Kind.NullValue(com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum())) } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.kind = com.google.protobuf.kotlin.Value.Kind.NumberValue(decoder.readDouble()) } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.kind = com.google.protobuf.kotlin.Value.Kind.StringValue(decoder.readString()) } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.kind = com.google.protobuf.kotlin.Value.Kind.BoolValue(decoder.readBool()) } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - val field = (msg.kind as? com.google.protobuf.kotlin.Value.Kind.StructValue) - ?: com.google.protobuf.kotlin.Value.Kind.StructValue(com.google.protobuf.kotlin.StructInternal()) - .also { - msg.kind = it - } + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + val field = (msg.kind as? com.google.protobuf.kotlin.Value.Kind.StructValue) ?: com.google.protobuf.kotlin.Value.Kind.StructValue(com.google.protobuf.kotlin.StructInternal()).also { + msg.kind = it + } decoder.readMessage(field.value.asInternal(), com.google.protobuf.kotlin.StructInternal::decodeWith) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - val field = (msg.kind as? com.google.protobuf.kotlin.Value.Kind.ListValue) - ?: com.google.protobuf.kotlin.Value.Kind.ListValue(com.google.protobuf.kotlin.ListValueInternal()) - .also { - msg.kind = it - } + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + val field = (msg.kind as? com.google.protobuf.kotlin.Value.Kind.ListValue) ?: com.google.protobuf.kotlin.Value.Kind.ListValue(com.google.protobuf.kotlin.ListValueInternal()).also { + msg.kind = it + } decoder.readMessage(field.value.asInternal(), com.google.protobuf.kotlin.ListValueInternal::decodeWith) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -333,56 +307,32 @@ public fun com.google.protobuf.kotlin.ValueInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.ValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.ValueInternal.computeSize(): Int { var __result = 0 - kind?.also { - when (val value = it) { - is com.google.protobuf.kotlin.Value.Kind.NullValue -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) - } - - is com.google.protobuf.kotlin.Value.Kind.NumberValue -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.double(value.value)) - } - - is com.google.protobuf.kotlin.Value.Kind.StringValue -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 3, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + kind?.also { + when (val value = it) { + is com.google.protobuf.kotlin.Value.Kind.NullValue -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) } - is com.google.protobuf.kotlin.Value.Kind.BoolValue -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 4, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(value.value)) + is com.google.protobuf.kotlin.Value.Kind.NumberValue -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(value.value)) } - is com.google.protobuf.kotlin.Value.Kind.StructValue -> { - __result += value.value.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 5, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf.kotlin.Value.Kind.StringValue -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf.kotlin.Value.Kind.ListValue -> { - __result += value.value.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 6, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf.kotlin.Value.Kind.BoolValue -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(value.value)) + } + + is com.google.protobuf.kotlin.Value.Kind.StructValue -> { + __result += value.value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } + } + + is com.google.protobuf.kotlin.Value.Kind.ListValue -> { + __result += value.value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } } } @@ -391,44 +341,40 @@ private fun com.google.protobuf.kotlin.ValueInternal.computeSize(): Int { } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Value.asInternal(): com.google.protobuf.kotlin.ValueInternal { - return this as? com.google.protobuf.kotlin.ValueInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Value.asInternal(): com.google.protobuf.kotlin.ValueInternal { + return this as? com.google.protobuf.kotlin.ValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ListValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.ListValueInternal.checkRequiredFields() { // no required fields to check - values.forEach { + values.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ListValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (values.isNotEmpty()) { - values.forEach { +public fun com.google.protobuf.kotlin.ListValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (values.isNotEmpty()) { + values.forEach { encoder.writeMessage(fieldNr = 1, value = it.asInternal()) { encodeWith(it) } } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ListValueInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.ListValueInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.ListValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.ListValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.ValueInternal::decodeWith) (msg.values as MutableList).add(elem) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -439,67 +385,58 @@ public fun com.google.protobuf.kotlin.ListValueInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.ListValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.ListValueInternal.computeSize(): Int { var __result = 0 - if (values.isNotEmpty()) { - __result += values.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (values.isNotEmpty()) { + __result += values.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.ListValue.asInternal(): com.google.protobuf.kotlin.ListValueInternal { - return this as? com.google.protobuf.kotlin.ListValueInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.ListValue.asInternal(): com.google.protobuf.kotlin.ListValueInternal { + return this as? com.google.protobuf.kotlin.ListValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { value.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = value.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { msg.value = com.google.protobuf.kotlin.ValueInternal() } decoder.readMessage(msg.value.asInternal(), com.google.protobuf.kotlin.ValueInternal::decodeWith) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -510,42 +447,32 @@ public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.Compani } } -private fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[0]) { - __result += value.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.asInternal(): com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal { +public fun com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal.asInternal(): com.google.protobuf.kotlin.StructInternal.FieldsEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.NullValue.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.NullValue { - return when (number) { - 0 -> { +public fun com.google.protobuf.kotlin.NullValue.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.NullValue { + return when (number) { + 0 -> { com.google.protobuf.kotlin.NullValue.NULL_VALUE } - else -> { + else -> { com.google.protobuf.kotlin.NullValue.UNRECOGNIZED(number) } } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt index baec52a35..23c2d3f19 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt @@ -3,18 +3,13 @@ */ @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) - package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.ExperimentalRpcApi +import kotlinx.rpc.internal.utils.* import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.MsgFieldDelegate -import kotlinx.rpc.protobuf.internal.int32 -import kotlinx.rpc.protobuf.internal.int64 -import kotlinx.rpc.protobuf.internal.tag +import kotlinx.rpc.protobuf.internal.* -public class TimestampInternal : com.google.protobuf.kotlin.Timestamp, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class TimestampInternal: com.google.protobuf.kotlin.Timestamp, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -22,21 +17,21 @@ public class TimestampInternal : com.google.protobuf.kotlin.Timestamp, public override var nanos: Int by MsgFieldDelegate { 0 } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Timestamp): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Timestamp): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Timestamp { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Timestamp { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.TimestampInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.TimestampInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -49,46 +44,43 @@ public class TimestampInternal : com.google.protobuf.kotlin.Timestamp, public companion object } -public operator fun com.google.protobuf.kotlin.Timestamp.Companion.invoke(body: com.google.protobuf.kotlin.TimestampInternal.() -> Unit): com.google.protobuf.kotlin.Timestamp { +public operator fun com.google.protobuf.kotlin.Timestamp.Companion.invoke(body: com.google.protobuf.kotlin.TimestampInternal.() -> Unit): com.google.protobuf.kotlin.Timestamp { val msg = com.google.protobuf.kotlin.TimestampInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.TimestampInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.TimestampInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.TimestampInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (seconds != 0L) { +public fun com.google.protobuf.kotlin.TimestampInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (seconds != 0L) { encoder.writeInt64(fieldNr = 1, value = seconds) } - if (nanos != 0) { + if (nanos != 0) { encoder.writeInt32(fieldNr = 2, value = nanos) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.TimestampInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.TimestampInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.TimestampInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.TimestampInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.seconds = decoder.readInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.nanos = decoder.readInt32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -99,28 +91,21 @@ public fun com.google.protobuf.kotlin.TimestampInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.TimestampInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.TimestampInternal.computeSize(): Int { var __result = 0 - if (seconds != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int64(seconds)) + if (seconds != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(seconds)) } - if (nanos != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(nanos)) + if (nanos != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(nanos)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Timestamp.asInternal(): com.google.protobuf.kotlin.TimestampInternal { - return this as? com.google.protobuf.kotlin.TimestampInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Timestamp.asInternal(): com.google.protobuf.kotlin.TimestampInternal { + return this as? com.google.protobuf.kotlin.TimestampInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt index 609c00e07..6d78cc0a6 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt @@ -3,21 +3,14 @@ */ @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) - package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.ExperimentalRpcApi +import kotlinx.rpc.internal.utils.* import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.MsgFieldDelegate -import kotlinx.rpc.protobuf.internal.bool -import kotlinx.rpc.protobuf.internal.enum -import kotlinx.rpc.protobuf.internal.int32 -import kotlinx.rpc.protobuf.internal.string -import kotlinx.rpc.protobuf.internal.tag - -public class TypeInternal : com.google.protobuf.kotlin.Type, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { +import kotlinx.rpc.protobuf.internal.* + +public class TypeInternal: com.google.protobuf.kotlin.Type, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { public const val sourceContext: Int = 0 } @@ -33,21 +26,21 @@ public class TypeInternal : com.google.protobuf.kotlin.Type, public override var edition: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Type): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Type): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Type { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Type { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.TypeInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.TypeInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -60,8 +53,7 @@ public class TypeInternal : com.google.protobuf.kotlin.Type, public companion object } -public class FieldInternal : com.google.protobuf.kotlin.Field, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class FieldInternal: com.google.protobuf.kotlin.Field, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -77,21 +69,21 @@ public class FieldInternal : com.google.protobuf.kotlin.Field, public override var defaultValue: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Field): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Field): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Field { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Field { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.FieldInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.FieldInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -104,9 +96,8 @@ public class FieldInternal : com.google.protobuf.kotlin.Field, public companion object } -public class EnumInternal : com.google.protobuf.kotlin.Enum, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { +public class EnumInternal: com.google.protobuf.kotlin.Enum, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { public const val sourceContext: Int = 0 } @@ -121,21 +112,21 @@ public class EnumInternal : com.google.protobuf.kotlin.Enum, public override var edition: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Enum): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Enum): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Enum { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Enum { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.EnumInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.EnumInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -148,8 +139,7 @@ public class EnumInternal : com.google.protobuf.kotlin.Enum, public companion object } -public class EnumValueInternal : com.google.protobuf.kotlin.EnumValue, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class EnumValueInternal: com.google.protobuf.kotlin.EnumValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } @@ -158,21 +148,21 @@ public class EnumValueInternal : com.google.protobuf.kotlin.EnumValue, public override var options: List by MsgFieldDelegate { mutableListOf() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.EnumValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.EnumValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.EnumValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.EnumValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.EnumValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.EnumValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -185,9 +175,8 @@ public class EnumValueInternal : com.google.protobuf.kotlin.EnumValue, public companion object } -public class OptionInternal : com.google.protobuf.kotlin.Option, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { +public class OptionInternal: com.google.protobuf.kotlin.Option, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { public const val value: Int = 0 } @@ -198,21 +187,21 @@ public class OptionInternal : com.google.protobuf.kotlin.Option, public override var value: com.google.protobuf.kotlin.Any by MsgFieldDelegate(PresenceIndices.value) { com.google.protobuf.kotlin.AnyInternal() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Option): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Option): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Option { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Option { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.OptionInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.OptionInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -225,139 +214,133 @@ public class OptionInternal : com.google.protobuf.kotlin.Option, public companion object } -public operator fun com.google.protobuf.kotlin.Type.Companion.invoke(body: com.google.protobuf.kotlin.TypeInternal.() -> Unit): com.google.protobuf.kotlin.Type { +public operator fun com.google.protobuf.kotlin.Type.Companion.invoke(body: com.google.protobuf.kotlin.TypeInternal.() -> Unit): com.google.protobuf.kotlin.Type { val msg = com.google.protobuf.kotlin.TypeInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Field.Companion.invoke(body: com.google.protobuf.kotlin.FieldInternal.() -> Unit): com.google.protobuf.kotlin.Field { +public operator fun com.google.protobuf.kotlin.Field.Companion.invoke(body: com.google.protobuf.kotlin.FieldInternal.() -> Unit): com.google.protobuf.kotlin.Field { val msg = com.google.protobuf.kotlin.FieldInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Enum.Companion.invoke(body: com.google.protobuf.kotlin.EnumInternal.() -> Unit): com.google.protobuf.kotlin.Enum { +public operator fun com.google.protobuf.kotlin.Enum.Companion.invoke(body: com.google.protobuf.kotlin.EnumInternal.() -> Unit): com.google.protobuf.kotlin.Enum { val msg = com.google.protobuf.kotlin.EnumInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.EnumValue.Companion.invoke(body: com.google.protobuf.kotlin.EnumValueInternal.() -> Unit): com.google.protobuf.kotlin.EnumValue { +public operator fun com.google.protobuf.kotlin.EnumValue.Companion.invoke(body: com.google.protobuf.kotlin.EnumValueInternal.() -> Unit): com.google.protobuf.kotlin.EnumValue { val msg = com.google.protobuf.kotlin.EnumValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Option.Companion.invoke(body: com.google.protobuf.kotlin.OptionInternal.() -> Unit): com.google.protobuf.kotlin.Option { +public operator fun com.google.protobuf.kotlin.Option.Companion.invoke(body: com.google.protobuf.kotlin.OptionInternal.() -> Unit): com.google.protobuf.kotlin.Option { val msg = com.google.protobuf.kotlin.OptionInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.TypeInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.TypeInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { sourceContext.asInternal().checkRequiredFields() } - fields.forEach { + fields.forEach { it.asInternal().checkRequiredFields() } - options.forEach { + options.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.TypeInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.TypeInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (fields.isNotEmpty()) { - fields.forEach { + if (fields.isNotEmpty()) { + fields.forEach { encoder.writeMessage(fieldNr = 2, value = it.asInternal()) { encodeWith(it) } } } - if (oneofs.isNotEmpty()) { - oneofs.forEach { + if (oneofs.isNotEmpty()) { + oneofs.forEach { encoder.writeString(3, it) } } - if (options.isNotEmpty()) { - options.forEach { + if (options.isNotEmpty()) { + options.forEach { encoder.writeMessage(fieldNr = 4, value = it.asInternal()) { encodeWith(it) } } } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 5, value = sourceContext.asInternal()) { encodeWith(it) } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { encoder.writeEnum(fieldNr = 6, value = syntax.number) } - if (edition.isNotEmpty()) { + if (edition.isNotEmpty()) { encoder.writeString(fieldNr = 7, value = edition) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.TypeInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.TypeInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.TypeInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.TypeInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.FieldInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.FieldInternal::decodeWith) (msg.fields as MutableList).add(elem) } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.oneofs as MutableList).add(elem) } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.OptionInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.OptionInternal::decodeWith) (msg.options as MutableList).add(elem) } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { msg.sourceContext = com.google.protobuf.kotlin.SourceContextInternal() } - decoder.readMessage( - msg.sourceContext.asInternal(), - com.google.protobuf.kotlin.SourceContextInternal::decodeWith - ) + decoder.readMessage(msg.sourceContext.asInternal(), com.google.protobuf.kotlin.SourceContextInternal::decodeWith) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.syntax = com.google.protobuf.kotlin.Syntax.fromNumber(decoder.readEnum()) } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.edition = decoder.readString() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -368,183 +351,146 @@ public fun com.google.protobuf.kotlin.TypeInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.TypeInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.TypeInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (fields.isNotEmpty()) { - __result += fields.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (fields.isNotEmpty()) { + __result += fields.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (oneofs.isNotEmpty()) { - __result += oneofs.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 3, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (oneofs.isNotEmpty()) { + __result += oneofs.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (options.isNotEmpty()) { - __result += options.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 4, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (options.isNotEmpty()) { + __result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (presenceMask[0]) { - __result += sourceContext.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 5, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += sourceContext.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 6, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) } - if (edition.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(edition).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 7, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (edition.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(edition).let { kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Type.asInternal(): com.google.protobuf.kotlin.TypeInternal { - return this as? com.google.protobuf.kotlin.TypeInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Type.asInternal(): com.google.protobuf.kotlin.TypeInternal { + return this as? com.google.protobuf.kotlin.TypeInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.FieldInternal.checkRequiredFields() { // no required fields to check - options.forEach { + options.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (kind != com.google.protobuf.kotlin.Field.Kind.TYPE_UNKNOWN) { +public fun com.google.protobuf.kotlin.FieldInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (kind != com.google.protobuf.kotlin.Field.Kind.TYPE_UNKNOWN) { encoder.writeEnum(fieldNr = 1, value = kind.number) } - if (cardinality != com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_UNKNOWN) { + if (cardinality != com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_UNKNOWN) { encoder.writeEnum(fieldNr = 2, value = cardinality.number) } - if (number != 0) { + if (number != 0) { encoder.writeInt32(fieldNr = 3, value = number) } - if (name.isNotEmpty()) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 4, value = name) } - if (typeUrl.isNotEmpty()) { + if (typeUrl.isNotEmpty()) { encoder.writeString(fieldNr = 6, value = typeUrl) } - if (oneofIndex != 0) { + if (oneofIndex != 0) { encoder.writeInt32(fieldNr = 7, value = oneofIndex) } - if (packed != false) { + if (packed != false) { encoder.writeBool(fieldNr = 8, value = packed) } - if (options.isNotEmpty()) { - options.forEach { + if (options.isNotEmpty()) { + options.forEach { encoder.writeMessage(fieldNr = 9, value = it.asInternal()) { encodeWith(it) } } } - if (jsonName.isNotEmpty()) { + if (jsonName.isNotEmpty()) { encoder.writeString(fieldNr = 10, value = jsonName) } - if (defaultValue.isNotEmpty()) { + if (defaultValue.isNotEmpty()) { encoder.writeString(fieldNr = 11, value = defaultValue) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FieldInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.FieldInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.FieldInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.FieldInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.kind = com.google.protobuf.kotlin.Field.Kind.fromNumber(decoder.readEnum()) } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.cardinality = com.google.protobuf.kotlin.Field.Cardinality.fromNumber(decoder.readEnum()) } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.number = decoder.readInt32() } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.typeUrl = decoder.readString() } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.oneofIndex = decoder.readInt32() } - tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.packed = decoder.readBool() } - tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.OptionInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.OptionInternal::decodeWith) (msg.options as MutableList).add(elem) } - tag.fieldNr == 10 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 10 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.jsonName = decoder.readString() } - tag.fieldNr == 11 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 11 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.defaultValue = decoder.readString() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -555,189 +501,142 @@ public fun com.google.protobuf.kotlin.FieldInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.FieldInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.FieldInternal.computeSize(): Int { var __result = 0 - if (kind != com.google.protobuf.kotlin.Field.Kind.TYPE_UNKNOWN) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(kind.number)) + if (kind != com.google.protobuf.kotlin.Field.Kind.TYPE_UNKNOWN) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(kind.number)) } - if (cardinality != com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_UNKNOWN) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(cardinality.number)) + if (cardinality != com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_UNKNOWN) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(cardinality.number)) } - if (number != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 3, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(number)) + if (number != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(number)) } - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 4, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (typeUrl.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(typeUrl).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 6, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (typeUrl.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(typeUrl).let { kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (oneofIndex != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 7, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(oneofIndex)) + if (oneofIndex != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(oneofIndex)) } - if (packed != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 8, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(packed)) + if (packed != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(8, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(packed)) } - if (options.isNotEmpty()) { - __result += options.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 9, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (options.isNotEmpty()) { + __result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(9, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (jsonName.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(jsonName).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 10, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (jsonName.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(jsonName).let { kotlinx.rpc.protobuf.internal.WireSize.tag(10, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (defaultValue.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(defaultValue).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 11, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (defaultValue.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(defaultValue).let { kotlinx.rpc.protobuf.internal.WireSize.tag(11, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Field.asInternal(): com.google.protobuf.kotlin.FieldInternal { - return this as? com.google.protobuf.kotlin.FieldInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Field.asInternal(): com.google.protobuf.kotlin.FieldInternal { + return this as? com.google.protobuf.kotlin.FieldInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.EnumInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { sourceContext.asInternal().checkRequiredFields() } - enumvalue.forEach { + enumvalue.forEach { it.asInternal().checkRequiredFields() } - options.forEach { + options.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.EnumInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (enumvalue.isNotEmpty()) { - enumvalue.forEach { + if (enumvalue.isNotEmpty()) { + enumvalue.forEach { encoder.writeMessage(fieldNr = 2, value = it.asInternal()) { encodeWith(it) } } } - if (options.isNotEmpty()) { - options.forEach { + if (options.isNotEmpty()) { + options.forEach { encoder.writeMessage(fieldNr = 3, value = it.asInternal()) { encodeWith(it) } } } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 4, value = sourceContext.asInternal()) { encodeWith(it) } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { encoder.writeEnum(fieldNr = 5, value = syntax.number) } - if (edition.isNotEmpty()) { + if (edition.isNotEmpty()) { encoder.writeString(fieldNr = 6, value = edition) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.EnumInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.EnumInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.EnumInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.EnumValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.EnumValueInternal::decodeWith) (msg.enumvalue as MutableList).add(elem) } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.OptionInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.OptionInternal::decodeWith) (msg.options as MutableList).add(elem) } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { msg.sourceContext = com.google.protobuf.kotlin.SourceContextInternal() } - decoder.readMessage( - msg.sourceContext.asInternal(), - com.google.protobuf.kotlin.SourceContextInternal::decodeWith - ) + decoder.readMessage(msg.sourceContext.asInternal(), com.google.protobuf.kotlin.SourceContextInternal::decodeWith) } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.syntax = com.google.protobuf.kotlin.Syntax.fromNumber(decoder.readEnum()) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.edition = decoder.readString() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -748,118 +647,86 @@ public fun com.google.protobuf.kotlin.EnumInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.EnumInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.EnumInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (enumvalue.isNotEmpty()) { - __result += enumvalue.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (enumvalue.isNotEmpty()) { + __result += enumvalue.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (options.isNotEmpty()) { - __result += options.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 3, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (options.isNotEmpty()) { + __result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (presenceMask[0]) { - __result += sourceContext.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 4, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += sourceContext.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 5, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) + if (syntax != com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(syntax.number)) } - if (edition.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(edition).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 6, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (edition.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(edition).let { kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Enum.asInternal(): com.google.protobuf.kotlin.EnumInternal { - return this as? com.google.protobuf.kotlin.EnumInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Enum.asInternal(): com.google.protobuf.kotlin.EnumInternal { + return this as? com.google.protobuf.kotlin.EnumInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.EnumValueInternal.checkRequiredFields() { // no required fields to check - options.forEach { + options.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.EnumValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (number != 0) { + if (number != 0) { encoder.writeInt32(fieldNr = 2, value = number) } - if (options.isNotEmpty()) { - options.forEach { + if (options.isNotEmpty()) { + options.forEach { encoder.writeMessage(fieldNr = 3, value = it.asInternal()) { encodeWith(it) } } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumValueInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.EnumValueInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.EnumValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.EnumValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.number = decoder.readInt32() } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.OptionInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.OptionInternal::decodeWith) (msg.options as MutableList).add(elem) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -870,83 +737,66 @@ public fun com.google.protobuf.kotlin.EnumValueInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.EnumValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.EnumValueInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (number != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(number)) + if (number != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(number)) } - if (options.isNotEmpty()) { - __result += options.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 3, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (options.isNotEmpty()) { + __result += options.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.EnumValue.asInternal(): com.google.protobuf.kotlin.EnumValueInternal { - return this as? com.google.protobuf.kotlin.EnumValueInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.EnumValue.asInternal(): com.google.protobuf.kotlin.EnumValueInternal { + return this as? com.google.protobuf.kotlin.EnumValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.OptionInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.OptionInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { value.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.OptionInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +public fun com.google.protobuf.kotlin.OptionInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = value.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.OptionInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.OptionInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.OptionInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.OptionInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { msg.value = com.google.protobuf.kotlin.AnyInternal() } decoder.readMessage(msg.value.asInternal(), com.google.protobuf.kotlin.AnyInternal::decodeWith) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -957,161 +807,150 @@ public fun com.google.protobuf.kotlin.OptionInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.OptionInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.OptionInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[0]) { - __result += value.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Option.asInternal(): com.google.protobuf.kotlin.OptionInternal { - return this as? com.google.protobuf.kotlin.OptionInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Option.asInternal(): com.google.protobuf.kotlin.OptionInternal { + return this as? com.google.protobuf.kotlin.OptionInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Syntax.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.Syntax { - return when (number) { - 0 -> { +public fun com.google.protobuf.kotlin.Syntax.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.Syntax { + return when (number) { + 0 -> { com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO2 } - 1 -> { + 1 -> { com.google.protobuf.kotlin.Syntax.SYNTAX_PROTO3 } - 2 -> { + 2 -> { com.google.protobuf.kotlin.Syntax.SYNTAX_EDITIONS } - else -> { + else -> { com.google.protobuf.kotlin.Syntax.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Field.Kind.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.Field.Kind { - return when (number) { - 0 -> { +public fun com.google.protobuf.kotlin.Field.Kind.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.Field.Kind { + return when (number) { + 0 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_UNKNOWN } - 1 -> { + 1 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_DOUBLE } - 2 -> { + 2 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_FLOAT } - 3 -> { + 3 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_INT64 } - 4 -> { + 4 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_UINT64 } - 5 -> { + 5 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_INT32 } - 6 -> { + 6 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_FIXED64 } - 7 -> { + 7 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_FIXED32 } - 8 -> { + 8 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_BOOL } - 9 -> { + 9 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_STRING } - 10 -> { + 10 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_GROUP } - 11 -> { + 11 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_MESSAGE } - 12 -> { + 12 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_BYTES } - 13 -> { + 13 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_UINT32 } - 14 -> { + 14 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_ENUM } - 15 -> { + 15 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_SFIXED32 } - 16 -> { + 16 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_SFIXED64 } - 17 -> { + 17 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_SINT32 } - 18 -> { + 18 -> { com.google.protobuf.kotlin.Field.Kind.TYPE_SINT64 } - else -> { + else -> { com.google.protobuf.kotlin.Field.Kind.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Field.Cardinality.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.Field.Cardinality { - return when (number) { - 0 -> { +public fun com.google.protobuf.kotlin.Field.Cardinality.Companion.fromNumber(number: Int): com.google.protobuf.kotlin.Field.Cardinality { + return when (number) { + 0 -> { com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_UNKNOWN } - 1 -> { + 1 -> { com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_OPTIONAL } - 2 -> { + 2 -> { com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_REQUIRED } - 3 -> { + 3 -> { com.google.protobuf.kotlin.Field.Cardinality.CARDINALITY_REPEATED } - else -> { + else -> { com.google.protobuf.kotlin.Field.Cardinality.UNRECOGNIZED(number) } } diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt index 7b58d155f..ea1f793e0 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt @@ -3,46 +3,34 @@ */ @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) - package com.google.protobuf.kotlin -import kotlinx.rpc.internal.utils.ExperimentalRpcApi +import kotlinx.rpc.internal.utils.* import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.MsgFieldDelegate -import kotlinx.rpc.protobuf.internal.bool -import kotlinx.rpc.protobuf.internal.bytes -import kotlinx.rpc.protobuf.internal.double -import kotlinx.rpc.protobuf.internal.float -import kotlinx.rpc.protobuf.internal.int32 -import kotlinx.rpc.protobuf.internal.int64 -import kotlinx.rpc.protobuf.internal.string -import kotlinx.rpc.protobuf.internal.tag -import kotlinx.rpc.protobuf.internal.uInt32 -import kotlinx.rpc.protobuf.internal.uInt64 - -public class DoubleValueInternal : com.google.protobuf.kotlin.DoubleValue, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +import kotlinx.rpc.protobuf.internal.* + +public class DoubleValueInternal: com.google.protobuf.kotlin.DoubleValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: Double by MsgFieldDelegate { 0.0 } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.DoubleValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.DoubleValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.DoubleValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.DoubleValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.DoubleValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.DoubleValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -55,29 +43,28 @@ public class DoubleValueInternal : com.google.protobuf.kotlin.DoubleValue, public companion object } -public class FloatValueInternal : com.google.protobuf.kotlin.FloatValue, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class FloatValueInternal: com.google.protobuf.kotlin.FloatValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: Float by MsgFieldDelegate { 0.0f } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.FloatValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.FloatValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.FloatValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.FloatValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.FloatValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.FloatValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -90,29 +77,28 @@ public class FloatValueInternal : com.google.protobuf.kotlin.FloatValue, public companion object } -public class Int64ValueInternal : com.google.protobuf.kotlin.Int64Value, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class Int64ValueInternal: com.google.protobuf.kotlin.Int64Value, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: Long by MsgFieldDelegate { 0L } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Int64Value): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Int64Value): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Int64Value { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Int64Value { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.Int64ValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.Int64ValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -125,29 +111,28 @@ public class Int64ValueInternal : com.google.protobuf.kotlin.Int64Value, public companion object } -public class UInt64ValueInternal : com.google.protobuf.kotlin.UInt64Value, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class UInt64ValueInternal: com.google.protobuf.kotlin.UInt64Value, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: ULong by MsgFieldDelegate { 0uL } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.UInt64Value): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.UInt64Value): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.UInt64Value { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.UInt64Value { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.UInt64ValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.UInt64ValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -160,29 +145,28 @@ public class UInt64ValueInternal : com.google.protobuf.kotlin.UInt64Value, public companion object } -public class Int32ValueInternal : com.google.protobuf.kotlin.Int32Value, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class Int32ValueInternal: com.google.protobuf.kotlin.Int32Value, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: Int by MsgFieldDelegate { 0 } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.Int32Value): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.Int32Value): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Int32Value { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.Int32Value { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.Int32ValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.Int32ValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -195,29 +179,28 @@ public class Int32ValueInternal : com.google.protobuf.kotlin.Int32Value, public companion object } -public class UInt32ValueInternal : com.google.protobuf.kotlin.UInt32Value, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class UInt32ValueInternal: com.google.protobuf.kotlin.UInt32Value, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: UInt by MsgFieldDelegate { 0u } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.UInt32Value): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.UInt32Value): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.UInt32Value { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.UInt32Value { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.UInt32ValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.UInt32ValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -230,29 +213,28 @@ public class UInt32ValueInternal : com.google.protobuf.kotlin.UInt32Value, public companion object } -public class BoolValueInternal : com.google.protobuf.kotlin.BoolValue, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class BoolValueInternal: com.google.protobuf.kotlin.BoolValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: Boolean by MsgFieldDelegate { false } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.BoolValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.BoolValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.BoolValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.BoolValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.BoolValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.BoolValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -265,29 +247,28 @@ public class BoolValueInternal : com.google.protobuf.kotlin.BoolValue, public companion object } -public class StringValueInternal : com.google.protobuf.kotlin.StringValue, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class StringValueInternal: com.google.protobuf.kotlin.StringValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.StringValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.StringValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.StringValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.StringValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.StringValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.StringValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -300,29 +281,28 @@ public class StringValueInternal : com.google.protobuf.kotlin.StringValue, public companion object } -public class BytesValueInternal : com.google.protobuf.kotlin.BytesValue, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +public class BytesValueInternal: com.google.protobuf.kotlin.BytesValue, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi public override val _size: Int by lazy { computeSize() } public override var value: ByteArray by MsgFieldDelegate { byteArrayOf() } @kotlinx.rpc.internal.utils.InternalRpcApi - public object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - public override fun encode(value: com.google.protobuf.kotlin.BytesValue): kotlinx.rpc.protobuf.input.stream.InputStream { + public object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + public override fun encode(value: com.google.protobuf.kotlin.BytesValue): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.BytesValue { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + public override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.kotlin.BytesValue { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.kotlin.BytesValueInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.kotlin.BytesValueInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -335,86 +315,83 @@ public class BytesValueInternal : com.google.protobuf.kotlin.BytesValue, public companion object } -public operator fun com.google.protobuf.kotlin.DoubleValue.Companion.invoke(body: com.google.protobuf.kotlin.DoubleValueInternal.() -> Unit): com.google.protobuf.kotlin.DoubleValue { +public operator fun com.google.protobuf.kotlin.DoubleValue.Companion.invoke(body: com.google.protobuf.kotlin.DoubleValueInternal.() -> Unit): com.google.protobuf.kotlin.DoubleValue { val msg = com.google.protobuf.kotlin.DoubleValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.FloatValue.Companion.invoke(body: com.google.protobuf.kotlin.FloatValueInternal.() -> Unit): com.google.protobuf.kotlin.FloatValue { +public operator fun com.google.protobuf.kotlin.FloatValue.Companion.invoke(body: com.google.protobuf.kotlin.FloatValueInternal.() -> Unit): com.google.protobuf.kotlin.FloatValue { val msg = com.google.protobuf.kotlin.FloatValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Int64Value.Companion.invoke(body: com.google.protobuf.kotlin.Int64ValueInternal.() -> Unit): com.google.protobuf.kotlin.Int64Value { +public operator fun com.google.protobuf.kotlin.Int64Value.Companion.invoke(body: com.google.protobuf.kotlin.Int64ValueInternal.() -> Unit): com.google.protobuf.kotlin.Int64Value { val msg = com.google.protobuf.kotlin.Int64ValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.UInt64Value.Companion.invoke(body: com.google.protobuf.kotlin.UInt64ValueInternal.() -> Unit): com.google.protobuf.kotlin.UInt64Value { +public operator fun com.google.protobuf.kotlin.UInt64Value.Companion.invoke(body: com.google.protobuf.kotlin.UInt64ValueInternal.() -> Unit): com.google.protobuf.kotlin.UInt64Value { val msg = com.google.protobuf.kotlin.UInt64ValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.Int32Value.Companion.invoke(body: com.google.protobuf.kotlin.Int32ValueInternal.() -> Unit): com.google.protobuf.kotlin.Int32Value { +public operator fun com.google.protobuf.kotlin.Int32Value.Companion.invoke(body: com.google.protobuf.kotlin.Int32ValueInternal.() -> Unit): com.google.protobuf.kotlin.Int32Value { val msg = com.google.protobuf.kotlin.Int32ValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.UInt32Value.Companion.invoke(body: com.google.protobuf.kotlin.UInt32ValueInternal.() -> Unit): com.google.protobuf.kotlin.UInt32Value { +public operator fun com.google.protobuf.kotlin.UInt32Value.Companion.invoke(body: com.google.protobuf.kotlin.UInt32ValueInternal.() -> Unit): com.google.protobuf.kotlin.UInt32Value { val msg = com.google.protobuf.kotlin.UInt32ValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.BoolValue.Companion.invoke(body: com.google.protobuf.kotlin.BoolValueInternal.() -> Unit): com.google.protobuf.kotlin.BoolValue { +public operator fun com.google.protobuf.kotlin.BoolValue.Companion.invoke(body: com.google.protobuf.kotlin.BoolValueInternal.() -> Unit): com.google.protobuf.kotlin.BoolValue { val msg = com.google.protobuf.kotlin.BoolValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.StringValue.Companion.invoke(body: com.google.protobuf.kotlin.StringValueInternal.() -> Unit): com.google.protobuf.kotlin.StringValue { +public operator fun com.google.protobuf.kotlin.StringValue.Companion.invoke(body: com.google.protobuf.kotlin.StringValueInternal.() -> Unit): com.google.protobuf.kotlin.StringValue { val msg = com.google.protobuf.kotlin.StringValueInternal().apply(body) msg.checkRequiredFields() return msg } -public operator fun com.google.protobuf.kotlin.BytesValue.Companion.invoke(body: com.google.protobuf.kotlin.BytesValueInternal.() -> Unit): com.google.protobuf.kotlin.BytesValue { +public operator fun com.google.protobuf.kotlin.BytesValue.Companion.invoke(body: com.google.protobuf.kotlin.BytesValueInternal.() -> Unit): com.google.protobuf.kotlin.BytesValue { val msg = com.google.protobuf.kotlin.BytesValueInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DoubleValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.DoubleValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DoubleValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != 0.0) { +public fun com.google.protobuf.kotlin.DoubleValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != 0.0) { encoder.writeDouble(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DoubleValueInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.DoubleValueInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.DoubleValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.DoubleValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readDouble() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -425,50 +402,43 @@ public fun com.google.protobuf.kotlin.DoubleValueInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.DoubleValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.DoubleValueInternal.computeSize(): Int { var __result = 0 - if (value != 0.0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.double(value)) + if (value != 0.0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.DoubleValue.asInternal(): com.google.protobuf.kotlin.DoubleValueInternal { - return this as? com.google.protobuf.kotlin.DoubleValueInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.DoubleValue.asInternal(): com.google.protobuf.kotlin.DoubleValueInternal { + return this as? com.google.protobuf.kotlin.DoubleValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FloatValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.FloatValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FloatValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != 0.0f) { +public fun com.google.protobuf.kotlin.FloatValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != 0.0f) { encoder.writeFloat(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FloatValueInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.FloatValueInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.FloatValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.FloatValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readFloat() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -479,50 +449,43 @@ public fun com.google.protobuf.kotlin.FloatValueInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.FloatValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.FloatValueInternal.computeSize(): Int { var __result = 0 - if (value != 0.0f) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.float(value)) + if (value != 0.0f) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.FloatValue.asInternal(): com.google.protobuf.kotlin.FloatValueInternal { - return this as? com.google.protobuf.kotlin.FloatValueInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.FloatValue.asInternal(): com.google.protobuf.kotlin.FloatValueInternal { + return this as? com.google.protobuf.kotlin.FloatValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int64ValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.Int64ValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int64ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != 0L) { +public fun com.google.protobuf.kotlin.Int64ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != 0L) { encoder.writeInt64(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int64ValueInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.Int64ValueInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.Int64ValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.Int64ValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readInt64() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -533,50 +496,43 @@ public fun com.google.protobuf.kotlin.Int64ValueInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.Int64ValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.Int64ValueInternal.computeSize(): Int { var __result = 0 - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int64Value.asInternal(): com.google.protobuf.kotlin.Int64ValueInternal { - return this as? com.google.protobuf.kotlin.Int64ValueInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Int64Value.asInternal(): com.google.protobuf.kotlin.Int64ValueInternal { + return this as? com.google.protobuf.kotlin.Int64ValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt64ValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.UInt64ValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt64ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != 0uL) { +public fun com.google.protobuf.kotlin.UInt64ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != 0uL) { encoder.writeUInt64(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt64ValueInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.UInt64ValueInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.UInt64ValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.UInt64ValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readUInt64() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -587,50 +543,43 @@ public fun com.google.protobuf.kotlin.UInt64ValueInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.UInt64ValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.UInt64ValueInternal.computeSize(): Int { var __result = 0 - if (value != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value)) + if (value != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt64Value.asInternal(): com.google.protobuf.kotlin.UInt64ValueInternal { - return this as? com.google.protobuf.kotlin.UInt64ValueInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.UInt64Value.asInternal(): com.google.protobuf.kotlin.UInt64ValueInternal { + return this as? com.google.protobuf.kotlin.UInt64ValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int32ValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.Int32ValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int32ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != 0) { +public fun com.google.protobuf.kotlin.Int32ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != 0) { encoder.writeInt32(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int32ValueInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.Int32ValueInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.Int32ValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.Int32ValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readInt32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -641,50 +590,43 @@ public fun com.google.protobuf.kotlin.Int32ValueInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.Int32ValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.Int32ValueInternal.computeSize(): Int { var __result = 0 - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.Int32Value.asInternal(): com.google.protobuf.kotlin.Int32ValueInternal { - return this as? com.google.protobuf.kotlin.Int32ValueInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.Int32Value.asInternal(): com.google.protobuf.kotlin.Int32ValueInternal { + return this as? com.google.protobuf.kotlin.Int32ValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt32ValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.UInt32ValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt32ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != 0u) { +public fun com.google.protobuf.kotlin.UInt32ValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != 0u) { encoder.writeUInt32(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt32ValueInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.UInt32ValueInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.UInt32ValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.UInt32ValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readUInt32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -695,50 +637,43 @@ public fun com.google.protobuf.kotlin.UInt32ValueInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.UInt32ValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.UInt32ValueInternal.computeSize(): Int { var __result = 0 - if (value != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value)) + if (value != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.UInt32Value.asInternal(): com.google.protobuf.kotlin.UInt32ValueInternal { - return this as? com.google.protobuf.kotlin.UInt32ValueInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.UInt32Value.asInternal(): com.google.protobuf.kotlin.UInt32ValueInternal { + return this as? com.google.protobuf.kotlin.UInt32ValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BoolValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.BoolValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BoolValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value != false) { +public fun com.google.protobuf.kotlin.BoolValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value != false) { encoder.writeBool(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BoolValueInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.BoolValueInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.BoolValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.BoolValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readBool() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -749,50 +684,43 @@ public fun com.google.protobuf.kotlin.BoolValueInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.BoolValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.BoolValueInternal.computeSize(): Int { var __result = 0 - if (value != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(value)) + if (value != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BoolValue.asInternal(): com.google.protobuf.kotlin.BoolValueInternal { - return this as? com.google.protobuf.kotlin.BoolValueInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.BoolValue.asInternal(): com.google.protobuf.kotlin.BoolValueInternal { + return this as? com.google.protobuf.kotlin.BoolValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StringValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.StringValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StringValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value.isNotEmpty()) { +public fun com.google.protobuf.kotlin.StringValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StringValueInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.StringValueInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.StringValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.StringValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readString() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -803,52 +731,43 @@ public fun com.google.protobuf.kotlin.StringValueInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.StringValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.StringValueInternal.computeSize(): Int { var __result = 0 - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.StringValue.asInternal(): com.google.protobuf.kotlin.StringValueInternal { - return this as? com.google.protobuf.kotlin.StringValueInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.StringValue.asInternal(): com.google.protobuf.kotlin.StringValueInternal { + return this as? com.google.protobuf.kotlin.StringValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BytesValueInternal.checkRequiredFields() { +public fun com.google.protobuf.kotlin.BytesValueInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BytesValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (value.isNotEmpty()) { +public fun com.google.protobuf.kotlin.BytesValueInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (value.isNotEmpty()) { encoder.writeBytes(fieldNr = 1, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BytesValueInternal.Companion.decodeWith( - msg: com.google.protobuf.kotlin.BytesValueInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +public fun com.google.protobuf.kotlin.BytesValueInternal.Companion.decodeWith(msg: com.google.protobuf.kotlin.BytesValueInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readBytes() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -859,23 +778,17 @@ public fun com.google.protobuf.kotlin.BytesValueInternal.Companion.decodeWith( } } -private fun com.google.protobuf.kotlin.BytesValueInternal.computeSize(): Int { +private fun com.google.protobuf.kotlin.BytesValueInternal.computeSize(): Int { var __result = 0 - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -public fun com.google.protobuf.kotlin.BytesValue.asInternal(): com.google.protobuf.kotlin.BytesValueInternal { - return this as? com.google.protobuf.kotlin.BytesValueInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +public fun com.google.protobuf.kotlin.BytesValue.asInternal(): com.google.protobuf.kotlin.BytesValueInternal { + return this as? com.google.protobuf.kotlin.BytesValueInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt index a681ec39e..8c75d8a79 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt @@ -3,21 +3,13 @@ */ @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) - package com.google.protobuf.conformance -import kotlinx.rpc.internal.utils.ExperimentalRpcApi +import kotlinx.rpc.internal.utils.* import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.MsgFieldDelegate -import kotlinx.rpc.protobuf.internal.bool -import kotlinx.rpc.protobuf.internal.bytes -import kotlinx.rpc.protobuf.internal.enum -import kotlinx.rpc.protobuf.internal.int32 -import kotlinx.rpc.protobuf.internal.string -import kotlinx.rpc.protobuf.internal.tag - -class TestStatusInternal : com.google.protobuf.conformance.TestStatus, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +import kotlinx.rpc.protobuf.internal.* + +class TestStatusInternal: com.google.protobuf.conformance.TestStatus, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -26,21 +18,21 @@ class TestStatusInternal : com.google.protobuf.conformance.TestStatus, override var matchedName: String by MsgFieldDelegate { "" } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf.conformance.TestStatus): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf.conformance.TestStatus): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.TestStatus { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.TestStatus { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.conformance.TestStatusInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.conformance.TestStatusInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -53,29 +45,28 @@ class TestStatusInternal : com.google.protobuf.conformance.TestStatus, companion object } -class FailureSetInternal : com.google.protobuf.conformance.FailureSet, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class FailureSetInternal: com.google.protobuf.conformance.FailureSet, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } override var test: List by MsgFieldDelegate { mutableListOf() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf.conformance.FailureSet): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf.conformance.FailureSet): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.FailureSet { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.FailureSet { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.conformance.FailureSetInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.conformance.FailureSetInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -88,9 +79,8 @@ class FailureSetInternal : com.google.protobuf.conformance.FailureSet, companion object } -class ConformanceRequestInternal : com.google.protobuf.conformance.ConformanceRequest, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { +class ConformanceRequestInternal: com.google.protobuf.conformance.ConformanceRequest, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val jspbEncodingOptions: Int = 0 } @@ -100,28 +90,26 @@ class ConformanceRequestInternal : com.google.protobuf.conformance.ConformanceRe override var requestedOutputFormat: com.google.protobuf.conformance.WireFormat by MsgFieldDelegate { com.google.protobuf.conformance.WireFormat.UNSPECIFIED } override var messageType: String by MsgFieldDelegate { "" } override var testCategory: com.google.protobuf.conformance.TestCategory by MsgFieldDelegate { com.google.protobuf.conformance.TestCategory.UNSPECIFIED_TEST } - override var jspbEncodingOptions: com.google.protobuf.conformance.JspbEncodingConfig by MsgFieldDelegate( - PresenceIndices.jspbEncodingOptions - ) { com.google.protobuf.conformance.JspbEncodingConfigInternal() } + override var jspbEncodingOptions: com.google.protobuf.conformance.JspbEncodingConfig by MsgFieldDelegate(PresenceIndices.jspbEncodingOptions) { com.google.protobuf.conformance.JspbEncodingConfigInternal() } override var printUnknownFields: Boolean by MsgFieldDelegate { false } override var payload: com.google.protobuf.conformance.ConformanceRequest.Payload? = null @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf.conformance.ConformanceRequest): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf.conformance.ConformanceRequest): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.ConformanceRequest { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.ConformanceRequest { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.conformance.ConformanceRequestInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.conformance.ConformanceRequestInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -134,29 +122,28 @@ class ConformanceRequestInternal : com.google.protobuf.conformance.ConformanceRe companion object } -class ConformanceResponseInternal : com.google.protobuf.conformance.ConformanceResponse, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class ConformanceResponseInternal: com.google.protobuf.conformance.ConformanceResponse, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } override var result: com.google.protobuf.conformance.ConformanceResponse.Result? = null @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf.conformance.ConformanceResponse): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf.conformance.ConformanceResponse): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.ConformanceResponse { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.ConformanceResponse { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.conformance.ConformanceResponseInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.conformance.ConformanceResponseInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -169,29 +156,28 @@ class ConformanceResponseInternal : com.google.protobuf.conformance.ConformanceR companion object } -class JspbEncodingConfigInternal : com.google.protobuf.conformance.JspbEncodingConfig, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class JspbEncodingConfigInternal: com.google.protobuf.conformance.JspbEncodingConfig, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } override var useJspbArrayAnyFormat: Boolean by MsgFieldDelegate { false } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf.conformance.JspbEncodingConfig): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf.conformance.JspbEncodingConfig): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.JspbEncodingConfig { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf.conformance.JspbEncodingConfig { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf.conformance.JspbEncodingConfigInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf.conformance.JspbEncodingConfigInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -204,78 +190,75 @@ class JspbEncodingConfigInternal : com.google.protobuf.conformance.JspbEncodingC companion object } -operator fun com.google.protobuf.conformance.TestStatus.Companion.invoke(body: com.google.protobuf.conformance.TestStatusInternal.() -> Unit): com.google.protobuf.conformance.TestStatus { +operator fun com.google.protobuf.conformance.TestStatus.Companion.invoke(body: com.google.protobuf.conformance.TestStatusInternal.() -> Unit): com.google.protobuf.conformance.TestStatus { val msg = com.google.protobuf.conformance.TestStatusInternal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf.conformance.FailureSet.Companion.invoke(body: com.google.protobuf.conformance.FailureSetInternal.() -> Unit): com.google.protobuf.conformance.FailureSet { +operator fun com.google.protobuf.conformance.FailureSet.Companion.invoke(body: com.google.protobuf.conformance.FailureSetInternal.() -> Unit): com.google.protobuf.conformance.FailureSet { val msg = com.google.protobuf.conformance.FailureSetInternal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf.conformance.ConformanceRequest.Companion.invoke(body: com.google.protobuf.conformance.ConformanceRequestInternal.() -> Unit): com.google.protobuf.conformance.ConformanceRequest { +operator fun com.google.protobuf.conformance.ConformanceRequest.Companion.invoke(body: com.google.protobuf.conformance.ConformanceRequestInternal.() -> Unit): com.google.protobuf.conformance.ConformanceRequest { val msg = com.google.protobuf.conformance.ConformanceRequestInternal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf.conformance.ConformanceResponse.Companion.invoke(body: com.google.protobuf.conformance.ConformanceResponseInternal.() -> Unit): com.google.protobuf.conformance.ConformanceResponse { +operator fun com.google.protobuf.conformance.ConformanceResponse.Companion.invoke(body: com.google.protobuf.conformance.ConformanceResponseInternal.() -> Unit): com.google.protobuf.conformance.ConformanceResponse { val msg = com.google.protobuf.conformance.ConformanceResponseInternal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf.conformance.JspbEncodingConfig.Companion.invoke(body: com.google.protobuf.conformance.JspbEncodingConfigInternal.() -> Unit): com.google.protobuf.conformance.JspbEncodingConfig { +operator fun com.google.protobuf.conformance.JspbEncodingConfig.Companion.invoke(body: com.google.protobuf.conformance.JspbEncodingConfigInternal.() -> Unit): com.google.protobuf.conformance.JspbEncodingConfig { val msg = com.google.protobuf.conformance.JspbEncodingConfigInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.TestStatusInternal.checkRequiredFields() { +fun com.google.protobuf.conformance.TestStatusInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.TestStatusInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (name.isNotEmpty()) { +fun com.google.protobuf.conformance.TestStatusInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (name.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = name) } - if (failureMessage.isNotEmpty()) { + if (failureMessage.isNotEmpty()) { encoder.writeString(fieldNr = 2, value = failureMessage) } - if (matchedName.isNotEmpty()) { + if (matchedName.isNotEmpty()) { encoder.writeString(fieldNr = 3, value = matchedName) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.TestStatusInternal.Companion.decodeWith( - msg: com.google.protobuf.conformance.TestStatusInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf.conformance.TestStatusInternal.Companion.decodeWith(msg: com.google.protobuf.conformance.TestStatusInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.name = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.failureMessage = decoder.readString() } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.matchedName = decoder.readString() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -286,77 +269,58 @@ fun com.google.protobuf.conformance.TestStatusInternal.Companion.decodeWith( } } -private fun com.google.protobuf.conformance.TestStatusInternal.computeSize(): Int { +private fun com.google.protobuf.conformance.TestStatusInternal.computeSize(): Int { var __result = 0 - if (name.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (name.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(name).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (failureMessage.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(failureMessage).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (failureMessage.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(failureMessage).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (matchedName.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(matchedName).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 3, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (matchedName.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(matchedName).let { kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.TestStatus.asInternal(): com.google.protobuf.conformance.TestStatusInternal { - return this as? com.google.protobuf.conformance.TestStatusInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf.conformance.TestStatus.asInternal(): com.google.protobuf.conformance.TestStatusInternal { + return this as? com.google.protobuf.conformance.TestStatusInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.FailureSetInternal.checkRequiredFields() { +fun com.google.protobuf.conformance.FailureSetInternal.checkRequiredFields() { // no required fields to check - test.forEach { + test.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.FailureSetInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (test.isNotEmpty()) { - test.forEach { +fun com.google.protobuf.conformance.FailureSetInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (test.isNotEmpty()) { + test.forEach { encoder.writeMessage(fieldNr = 2, value = it.asInternal()) { encodeWith(it) } } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.FailureSetInternal.Companion.decodeWith( - msg: com.google.protobuf.conformance.FailureSetInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf.conformance.FailureSetInternal.Companion.decodeWith(msg: com.google.protobuf.conformance.FailureSetInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.conformance.TestStatusInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.conformance.TestStatusInternal::decodeWith) (msg.test as MutableList).add(elem) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -367,71 +331,65 @@ fun com.google.protobuf.conformance.FailureSetInternal.Companion.decodeWith( } } -private fun com.google.protobuf.conformance.FailureSetInternal.computeSize(): Int { +private fun com.google.protobuf.conformance.FailureSetInternal.computeSize(): Int { var __result = 0 - if (test.isNotEmpty()) { - __result += test.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (test.isNotEmpty()) { + __result += test.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.FailureSet.asInternal(): com.google.protobuf.conformance.FailureSetInternal { - return this as? com.google.protobuf.conformance.FailureSetInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf.conformance.FailureSet.asInternal(): com.google.protobuf.conformance.FailureSetInternal { + return this as? com.google.protobuf.conformance.FailureSetInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceRequestInternal.checkRequiredFields() { +fun com.google.protobuf.conformance.ConformanceRequestInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { jspbEncodingOptions.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceRequestInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (requestedOutputFormat != com.google.protobuf.conformance.WireFormat.UNSPECIFIED) { +fun com.google.protobuf.conformance.ConformanceRequestInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (requestedOutputFormat != com.google.protobuf.conformance.WireFormat.UNSPECIFIED) { encoder.writeEnum(fieldNr = 3, value = requestedOutputFormat.number) } - if (messageType.isNotEmpty()) { + if (messageType.isNotEmpty()) { encoder.writeString(fieldNr = 4, value = messageType) } - if (testCategory != com.google.protobuf.conformance.TestCategory.UNSPECIFIED_TEST) { + if (testCategory != com.google.protobuf.conformance.TestCategory.UNSPECIFIED_TEST) { encoder.writeEnum(fieldNr = 5, value = testCategory.number) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 6, value = jspbEncodingOptions.asInternal()) { encodeWith(it) } } - if (printUnknownFields != false) { + if (printUnknownFields != false) { encoder.writeBool(fieldNr = 9, value = printUnknownFields) } - payload?.also { - when (val value = it) { - is com.google.protobuf.conformance.ConformanceRequest.Payload.ProtobufPayload -> { + payload?.also { + when (val value = it) { + is com.google.protobuf.conformance.ConformanceRequest.Payload.ProtobufPayload -> { encoder.writeBytes(fieldNr = 1, value = value.value) } - is com.google.protobuf.conformance.ConformanceRequest.Payload.JsonPayload -> { + is com.google.protobuf.conformance.ConformanceRequest.Payload.JsonPayload -> { encoder.writeString(fieldNr = 2, value = value.value) } - is com.google.protobuf.conformance.ConformanceRequest.Payload.JspbPayload -> { + is com.google.protobuf.conformance.ConformanceRequest.Payload.JspbPayload -> { encoder.writeString(fieldNr = 7, value = value.value) } - is com.google.protobuf.conformance.ConformanceRequest.Payload.TextPayload -> { + is com.google.protobuf.conformance.ConformanceRequest.Payload.TextPayload -> { encoder.writeString(fieldNr = 8, value = value.value) } } @@ -439,62 +397,52 @@ fun com.google.protobuf.conformance.ConformanceRequestInternal.encodeWith(encode } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceRequestInternal.Companion.decodeWith( - msg: com.google.protobuf.conformance.ConformanceRequestInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf.conformance.ConformanceRequestInternal.Companion.decodeWith(msg: com.google.protobuf.conformance.ConformanceRequestInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.requestedOutputFormat = com.google.protobuf.conformance.WireFormat.fromNumber(decoder.readEnum()) } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.messageType = decoder.readString() } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.testCategory = com.google.protobuf.conformance.TestCategory.fromNumber(decoder.readEnum()) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { msg.jspbEncodingOptions = com.google.protobuf.conformance.JspbEncodingConfigInternal() } - decoder.readMessage( - msg.jspbEncodingOptions.asInternal(), - com.google.protobuf.conformance.JspbEncodingConfigInternal::decodeWith - ) + decoder.readMessage(msg.jspbEncodingOptions.asInternal(), com.google.protobuf.conformance.JspbEncodingConfigInternal::decodeWith) } - tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.printUnknownFields = decoder.readBool() } - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.payload = - com.google.protobuf.conformance.ConformanceRequest.Payload.ProtobufPayload(decoder.readBytes()) + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.payload = com.google.protobuf.conformance.ConformanceRequest.Payload.ProtobufPayload(decoder.readBytes()) } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.payload = - com.google.protobuf.conformance.ConformanceRequest.Payload.JsonPayload(decoder.readString()) + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.payload = com.google.protobuf.conformance.ConformanceRequest.Payload.JsonPayload(decoder.readString()) } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.payload = - com.google.protobuf.conformance.ConformanceRequest.Payload.JspbPayload(decoder.readString()) + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.payload = com.google.protobuf.conformance.ConformanceRequest.Payload.JspbPayload(decoder.readString()) } - tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.payload = - com.google.protobuf.conformance.ConformanceRequest.Payload.TextPayload(decoder.readString()) + tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.payload = com.google.protobuf.conformance.ConformanceRequest.Payload.TextPayload(decoder.readString()) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -505,83 +453,44 @@ fun com.google.protobuf.conformance.ConformanceRequestInternal.Companion.decodeW } } -private fun com.google.protobuf.conformance.ConformanceRequestInternal.computeSize(): Int { +private fun com.google.protobuf.conformance.ConformanceRequestInternal.computeSize(): Int { var __result = 0 - if (requestedOutputFormat != com.google.protobuf.conformance.WireFormat.UNSPECIFIED) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 3, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(requestedOutputFormat.number)) + if (requestedOutputFormat != com.google.protobuf.conformance.WireFormat.UNSPECIFIED) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(requestedOutputFormat.number)) } - if (messageType.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(messageType).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 4, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (messageType.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(messageType).let { kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (testCategory != com.google.protobuf.conformance.TestCategory.UNSPECIFIED_TEST) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 5, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(testCategory.number)) + if (testCategory != com.google.protobuf.conformance.TestCategory.UNSPECIFIED_TEST) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(testCategory.number)) } - if (presenceMask[0]) { - __result += jspbEncodingOptions.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 6, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += jspbEncodingOptions.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (printUnknownFields != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 9, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(printUnknownFields)) + if (printUnknownFields != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(9, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(printUnknownFields)) } - payload?.also { - when (val value = it) { - is com.google.protobuf.conformance.ConformanceRequest.Payload.ProtobufPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + payload?.also { + when (val value = it) { + is com.google.protobuf.conformance.ConformanceRequest.Payload.ProtobufPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf.conformance.ConformanceRequest.Payload.JsonPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf.conformance.ConformanceRequest.Payload.JsonPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf.conformance.ConformanceRequest.Payload.JspbPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 7, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf.conformance.ConformanceRequest.Payload.JspbPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf.conformance.ConformanceRequest.Payload.TextPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 8, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf.conformance.ConformanceRequest.Payload.TextPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(8, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } } } @@ -590,53 +499,52 @@ private fun com.google.protobuf.conformance.ConformanceRequestInternal.computeSi } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceRequest.asInternal(): com.google.protobuf.conformance.ConformanceRequestInternal { - return this as? com.google.protobuf.conformance.ConformanceRequestInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf.conformance.ConformanceRequest.asInternal(): com.google.protobuf.conformance.ConformanceRequestInternal { + return this as? com.google.protobuf.conformance.ConformanceRequestInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceResponseInternal.checkRequiredFields() { +fun com.google.protobuf.conformance.ConformanceResponseInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceResponseInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - result?.also { - when (val value = it) { - is com.google.protobuf.conformance.ConformanceResponse.Result.ParseError -> { +fun com.google.protobuf.conformance.ConformanceResponseInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + result?.also { + when (val value = it) { + is com.google.protobuf.conformance.ConformanceResponse.Result.ParseError -> { encoder.writeString(fieldNr = 1, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.SerializeError -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.SerializeError -> { encoder.writeString(fieldNr = 6, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.TimeoutError -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.TimeoutError -> { encoder.writeString(fieldNr = 9, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.RuntimeError -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.RuntimeError -> { encoder.writeString(fieldNr = 2, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.ProtobufPayload -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.ProtobufPayload -> { encoder.writeBytes(fieldNr = 3, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.JsonPayload -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.JsonPayload -> { encoder.writeString(fieldNr = 4, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.Skipped -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.Skipped -> { encoder.writeString(fieldNr = 5, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.JspbPayload -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.JspbPayload -> { encoder.writeString(fieldNr = 7, value = value.value) } - is com.google.protobuf.conformance.ConformanceResponse.Result.TextPayload -> { + is com.google.protobuf.conformance.ConformanceResponse.Result.TextPayload -> { encoder.writeString(fieldNr = 8, value = value.value) } } @@ -644,58 +552,48 @@ fun com.google.protobuf.conformance.ConformanceResponseInternal.encodeWith(encod } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceResponseInternal.Companion.decodeWith( - msg: com.google.protobuf.conformance.ConformanceResponseInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf.conformance.ConformanceResponseInternal.Companion.decodeWith(msg: com.google.protobuf.conformance.ConformanceResponseInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.ParseError(decoder.readString()) } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = - com.google.protobuf.conformance.ConformanceResponse.Result.SerializeError(decoder.readString()) + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.SerializeError(decoder.readString()) } - tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = - com.google.protobuf.conformance.ConformanceResponse.Result.TimeoutError(decoder.readString()) + tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.TimeoutError(decoder.readString()) } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = - com.google.protobuf.conformance.ConformanceResponse.Result.RuntimeError(decoder.readString()) + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.RuntimeError(decoder.readString()) } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = - com.google.protobuf.conformance.ConformanceResponse.Result.ProtobufPayload(decoder.readBytes()) + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.ProtobufPayload(decoder.readBytes()) } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = - com.google.protobuf.conformance.ConformanceResponse.Result.JsonPayload(decoder.readString()) + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.JsonPayload(decoder.readString()) } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.Skipped(decoder.readString()) } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = - com.google.protobuf.conformance.ConformanceResponse.Result.JspbPayload(decoder.readString()) + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.JspbPayload(decoder.readString()) } - tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.result = - com.google.protobuf.conformance.ConformanceResponse.Result.TextPayload(decoder.readString()) + tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.result = com.google.protobuf.conformance.ConformanceResponse.Result.TextPayload(decoder.readString()) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -706,89 +604,44 @@ fun com.google.protobuf.conformance.ConformanceResponseInternal.Companion.decode } } -private fun com.google.protobuf.conformance.ConformanceResponseInternal.computeSize(): Int { +private fun com.google.protobuf.conformance.ConformanceResponseInternal.computeSize(): Int { var __result = 0 - result?.also { - when (val value = it) { - is com.google.protobuf.conformance.ConformanceResponse.Result.ParseError -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + result?.also { + when (val value = it) { + is com.google.protobuf.conformance.ConformanceResponse.Result.ParseError -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf.conformance.ConformanceResponse.Result.SerializeError -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 6, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf.conformance.ConformanceResponse.Result.SerializeError -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf.conformance.ConformanceResponse.Result.TimeoutError -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 9, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf.conformance.ConformanceResponse.Result.TimeoutError -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(9, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf.conformance.ConformanceResponse.Result.RuntimeError -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf.conformance.ConformanceResponse.Result.RuntimeError -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf.conformance.ConformanceResponse.Result.ProtobufPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 3, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf.conformance.ConformanceResponse.Result.ProtobufPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf.conformance.ConformanceResponse.Result.JsonPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 4, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf.conformance.ConformanceResponse.Result.JsonPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf.conformance.ConformanceResponse.Result.Skipped -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 5, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf.conformance.ConformanceResponse.Result.Skipped -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf.conformance.ConformanceResponse.Result.JspbPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 7, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf.conformance.ConformanceResponse.Result.JspbPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf.conformance.ConformanceResponse.Result.TextPayload -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 8, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf.conformance.ConformanceResponse.Result.TextPayload -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(8, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } } } @@ -797,37 +650,33 @@ private fun com.google.protobuf.conformance.ConformanceResponseInternal.computeS } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.ConformanceResponse.asInternal(): com.google.protobuf.conformance.ConformanceResponseInternal { - return this as? com.google.protobuf.conformance.ConformanceResponseInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf.conformance.ConformanceResponse.asInternal(): com.google.protobuf.conformance.ConformanceResponseInternal { + return this as? com.google.protobuf.conformance.ConformanceResponseInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.JspbEncodingConfigInternal.checkRequiredFields() { +fun com.google.protobuf.conformance.JspbEncodingConfigInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.JspbEncodingConfigInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (useJspbArrayAnyFormat != false) { +fun com.google.protobuf.conformance.JspbEncodingConfigInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (useJspbArrayAnyFormat != false) { encoder.writeBool(fieldNr = 1, value = useJspbArrayAnyFormat) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.JspbEncodingConfigInternal.Companion.decodeWith( - msg: com.google.protobuf.conformance.JspbEncodingConfigInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf.conformance.JspbEncodingConfigInternal.Companion.decodeWith(msg: com.google.protobuf.conformance.JspbEncodingConfigInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.useJspbArrayAnyFormat = decoder.readBool() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -838,81 +687,77 @@ fun com.google.protobuf.conformance.JspbEncodingConfigInternal.Companion.decodeW } } -private fun com.google.protobuf.conformance.JspbEncodingConfigInternal.computeSize(): Int { +private fun com.google.protobuf.conformance.JspbEncodingConfigInternal.computeSize(): Int { var __result = 0 - if (useJspbArrayAnyFormat != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(useJspbArrayAnyFormat)) + if (useJspbArrayAnyFormat != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(useJspbArrayAnyFormat)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.JspbEncodingConfig.asInternal(): com.google.protobuf.conformance.JspbEncodingConfigInternal { - return this as? com.google.protobuf.conformance.JspbEncodingConfigInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf.conformance.JspbEncodingConfig.asInternal(): com.google.protobuf.conformance.JspbEncodingConfigInternal { + return this as? com.google.protobuf.conformance.JspbEncodingConfigInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.WireFormat.Companion.fromNumber(number: Int): com.google.protobuf.conformance.WireFormat { - return when (number) { - 0 -> { +fun com.google.protobuf.conformance.WireFormat.Companion.fromNumber(number: Int): com.google.protobuf.conformance.WireFormat { + return when (number) { + 0 -> { com.google.protobuf.conformance.WireFormat.UNSPECIFIED } - 1 -> { + 1 -> { com.google.protobuf.conformance.WireFormat.PROTOBUF } - 2 -> { + 2 -> { com.google.protobuf.conformance.WireFormat.JSON } - 3 -> { + 3 -> { com.google.protobuf.conformance.WireFormat.JSPB } - 4 -> { + 4 -> { com.google.protobuf.conformance.WireFormat.TEXT_FORMAT } - else -> { + else -> { com.google.protobuf.conformance.WireFormat.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf.conformance.TestCategory.Companion.fromNumber(number: Int): com.google.protobuf.conformance.TestCategory { - return when (number) { - 0 -> { +fun com.google.protobuf.conformance.TestCategory.Companion.fromNumber(number: Int): com.google.protobuf.conformance.TestCategory { + return when (number) { + 0 -> { com.google.protobuf.conformance.TestCategory.UNSPECIFIED_TEST } - 1 -> { + 1 -> { com.google.protobuf.conformance.TestCategory.BINARY_TEST } - 2 -> { + 2 -> { com.google.protobuf.conformance.TestCategory.JSON_TEST } - 3 -> { + 3 -> { com.google.protobuf.conformance.TestCategory.JSON_IGNORE_UNKNOWN_PARSING_TEST } - 4 -> { + 4 -> { com.google.protobuf.conformance.TestCategory.JSPB_TEST } - 5 -> { + 5 -> { com.google.protobuf.conformance.TestCategory.TEXT_FORMAT_TEST } - else -> { + else -> { com.google.protobuf.conformance.TestCategory.UNRECOGNIZED(number) } } diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt index c54959ca8..727a46840 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt @@ -3,52 +3,15 @@ */ @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) - package com.google.protobuf_test_messages.editions.proto3 -import com.google.protobuf.kotlin.asInternal -import com.google.protobuf.kotlin.checkRequiredFields -import com.google.protobuf.kotlin.decodeWith -import com.google.protobuf.kotlin.encodeWith -import com.google.protobuf.kotlin.fromNumber -import kotlinx.rpc.internal.utils.ExperimentalRpcApi +import com.google.protobuf.kotlin.* +import kotlinx.rpc.internal.utils.* import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.MsgFieldDelegate -import kotlinx.rpc.protobuf.internal.bool -import kotlinx.rpc.protobuf.internal.bytes -import kotlinx.rpc.protobuf.internal.double -import kotlinx.rpc.protobuf.internal.enum -import kotlinx.rpc.protobuf.internal.fixed32 -import kotlinx.rpc.protobuf.internal.fixed64 -import kotlinx.rpc.protobuf.internal.float -import kotlinx.rpc.protobuf.internal.int32 -import kotlinx.rpc.protobuf.internal.int64 -import kotlinx.rpc.protobuf.internal.packedBool -import kotlinx.rpc.protobuf.internal.packedDouble -import kotlinx.rpc.protobuf.internal.packedEnum -import kotlinx.rpc.protobuf.internal.packedFixed32 -import kotlinx.rpc.protobuf.internal.packedFixed64 -import kotlinx.rpc.protobuf.internal.packedFloat -import kotlinx.rpc.protobuf.internal.packedInt32 -import kotlinx.rpc.protobuf.internal.packedInt64 -import kotlinx.rpc.protobuf.internal.packedSFixed32 -import kotlinx.rpc.protobuf.internal.packedSFixed64 -import kotlinx.rpc.protobuf.internal.packedSInt32 -import kotlinx.rpc.protobuf.internal.packedSInt64 -import kotlinx.rpc.protobuf.internal.packedUInt32 -import kotlinx.rpc.protobuf.internal.packedUInt64 -import kotlinx.rpc.protobuf.internal.sFixed32 -import kotlinx.rpc.protobuf.internal.sFixed64 -import kotlinx.rpc.protobuf.internal.sInt32 -import kotlinx.rpc.protobuf.internal.sInt64 -import kotlinx.rpc.protobuf.internal.string -import kotlinx.rpc.protobuf.internal.tag -import kotlinx.rpc.protobuf.internal.uInt32 -import kotlinx.rpc.protobuf.internal.uInt64 - -class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 18) { - private object PresenceIndices { +import kotlinx.rpc.protobuf.internal.* + +class TestAllTypesProto3Internal: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 18) { + private object PresenceIndices { const val optionalNestedMessage: Int = 0 const val optionalForeignMessage: Int = 1 const val recursiveMessage: Int = 2 @@ -87,20 +50,14 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr override var optionalBool: Boolean by MsgFieldDelegate { false } override var optionalString: String by MsgFieldDelegate { "" } override var optionalBytes: ByteArray by MsgFieldDelegate { byteArrayOf() } - override var optionalNestedMessage: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate( - PresenceIndices.optionalNestedMessage - ) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } - override var optionalForeignMessage: com.google.protobuf_test_messages.editions.proto3.ForeignMessage by MsgFieldDelegate( - PresenceIndices.optionalForeignMessage - ) { com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() } + override var optionalNestedMessage: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate(PresenceIndices.optionalNestedMessage) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } + override var optionalForeignMessage: com.google.protobuf_test_messages.editions.proto3.ForeignMessage by MsgFieldDelegate(PresenceIndices.optionalForeignMessage) { com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() } override var optionalNestedEnum: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum by MsgFieldDelegate { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO } override var optionalForeignEnum: com.google.protobuf_test_messages.editions.proto3.ForeignEnum by MsgFieldDelegate { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO } override var optionalAliasedEnum: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum by MsgFieldDelegate { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO } override var optionalStringPiece: String by MsgFieldDelegate { "" } override var optionalCord: String by MsgFieldDelegate { "" } - override var recursiveMessage: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 by MsgFieldDelegate( - PresenceIndices.recursiveMessage - ) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() } + override var recursiveMessage: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 by MsgFieldDelegate(PresenceIndices.recursiveMessage) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() } override var repeatedInt32: List by MsgFieldDelegate { mutableListOf() } override var repeatedInt64: List by MsgFieldDelegate { mutableListOf() } override var repeatedUint32: List by MsgFieldDelegate { mutableListOf() } @@ -221,9 +178,8 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr override var FieldName18__: Int by MsgFieldDelegate { 0 } override var oneofField: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField? = null - class NestedMessageInternal : com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + class NestedMessageInternal: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val corecursive: Int = 0 } @@ -231,32 +187,25 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr override val _size: Int by lazy { computeSize() } override var a: Int by MsgFieldDelegate { 0 } - override var corecursive: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 by MsgFieldDelegate( - PresenceIndices.corecursive - ) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() } + override var corecursive: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 by MsgFieldDelegate(PresenceIndices.corecursive) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : - kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { - val msg = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.decodeWith( - msg, - it - ) + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + val msg = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.decodeWith(msg, it) } msg.checkRequiredFields() return msg @@ -268,7 +217,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapInt32Int32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt32Int32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -279,7 +228,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapInt64Int64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt64Int64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -290,7 +239,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapUint32Uint32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapUint32Uint32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -301,7 +250,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapUint64Uint64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapUint64Uint64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -312,7 +261,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapSint32Sint32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSint32Sint32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -323,7 +272,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapSint64Sint64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSint64Sint64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -334,7 +283,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapFixed32Fixed32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapFixed32Fixed32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -345,7 +294,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapFixed64Fixed64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapFixed64Fixed64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -356,7 +305,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapSfixed32Sfixed32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSfixed32Sfixed32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -367,7 +316,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapSfixed64Sfixed64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSfixed64Sfixed64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -378,7 +327,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapInt32FloatEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt32FloatEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -389,7 +338,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapInt32DoubleEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt32DoubleEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -400,7 +349,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapBoolBoolEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapBoolBoolEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -411,7 +360,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapStringStringEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringStringEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -422,7 +371,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapStringBytesEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringBytesEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -433,8 +382,8 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapStringNestedMessageEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + class MapStringNestedMessageEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val value: Int = 0 } @@ -442,16 +391,14 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr override val _size: Int by lazy { computeSize() } var key: String by MsgFieldDelegate { "" } - var value: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate( - PresenceIndices.value - ) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } + var value: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate(PresenceIndices.value) { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } @kotlinx.rpc.internal.utils.InternalRpcApi companion object } - class MapStringForeignMessageEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + class MapStringForeignMessageEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val value: Int = 0 } @@ -465,7 +412,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapStringNestedEnumEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringNestedEnumEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -476,7 +423,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } - class MapStringForeignEnumEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringForeignEnumEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -488,22 +435,21 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : - kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -516,30 +462,28 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.editions.pr companion object } -class ForeignMessageInternal : com.google.protobuf_test_messages.editions.proto3.ForeignMessage, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class ForeignMessageInternal: com.google.protobuf_test_messages.editions.proto3.ForeignMessage, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } override var c: Int by MsgFieldDelegate { 0 } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : - kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.editions.proto3.ForeignMessage): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.editions.proto3.ForeignMessage): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.ForeignMessage { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.ForeignMessage { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -552,28 +496,26 @@ class ForeignMessageInternal : com.google.protobuf_test_messages.editions.proto3 companion object } -class NullHypothesisProto3Internal : com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class NullHypothesisProto3Internal: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : - kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3 { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3 { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -586,28 +528,26 @@ class NullHypothesisProto3Internal : com.google.protobuf_test_messages.editions. companion object } -class EnumOnlyProto3Internal : com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class EnumOnlyProto3Internal: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : - kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3 { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3 { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -620,1117 +560,1029 @@ class EnumOnlyProto3Internal : com.google.protobuf_test_messages.editions.proto3 companion object } -operator fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 { +operator fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 { val msg = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.editions.proto3.ForeignMessage.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.ForeignMessage { +operator fun com.google.protobuf_test_messages.editions.proto3.ForeignMessage.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.ForeignMessage { val msg = com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3 { +operator fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3 { val msg = com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3 { +operator fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3 { val msg = com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage { - val msg = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal().apply(body) +operator fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage.Companion.invoke(body: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.() -> Unit): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage { + val msg = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { optionalNestedMessage.asInternal().checkRequiredFields() } - if (presenceMask[1]) { + if (presenceMask[1]) { optionalForeignMessage.asInternal().checkRequiredFields() } - if (presenceMask[2]) { + if (presenceMask[2]) { recursiveMessage.asInternal().checkRequiredFields() } - if (presenceMask[3]) { + if (presenceMask[3]) { optionalBoolWrapper.asInternal().checkRequiredFields() } - if (presenceMask[4]) { + if (presenceMask[4]) { optionalInt32Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[5]) { + if (presenceMask[5]) { optionalInt64Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[6]) { + if (presenceMask[6]) { optionalUint32Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[7]) { + if (presenceMask[7]) { optionalUint64Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[8]) { + if (presenceMask[8]) { optionalFloatWrapper.asInternal().checkRequiredFields() } - if (presenceMask[9]) { + if (presenceMask[9]) { optionalDoubleWrapper.asInternal().checkRequiredFields() } - if (presenceMask[10]) { + if (presenceMask[10]) { optionalStringWrapper.asInternal().checkRequiredFields() } - if (presenceMask[11]) { + if (presenceMask[11]) { optionalBytesWrapper.asInternal().checkRequiredFields() } - if (presenceMask[12]) { + if (presenceMask[12]) { optionalDuration.asInternal().checkRequiredFields() } - if (presenceMask[13]) { + if (presenceMask[13]) { optionalTimestamp.asInternal().checkRequiredFields() } - if (presenceMask[14]) { + if (presenceMask[14]) { optionalFieldMask.asInternal().checkRequiredFields() } - if (presenceMask[15]) { + if (presenceMask[15]) { optionalStruct.asInternal().checkRequiredFields() } - if (presenceMask[16]) { + if (presenceMask[16]) { optionalAny.asInternal().checkRequiredFields() } - if (presenceMask[17]) { + if (presenceMask[17]) { optionalValue.asInternal().checkRequiredFields() } - oneofField?.also { - when { - it is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { + oneofField?.also { + when { + it is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { it.value.asInternal().checkRequiredFields() } } } - repeatedNestedMessage.forEach { + repeatedNestedMessage.forEach { it.asInternal().checkRequiredFields() } - repeatedForeignMessage.forEach { + repeatedForeignMessage.forEach { it.asInternal().checkRequiredFields() } - repeatedBoolWrapper.forEach { + repeatedBoolWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedInt32Wrapper.forEach { + repeatedInt32Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedInt64Wrapper.forEach { + repeatedInt64Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedUint32Wrapper.forEach { + repeatedUint32Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedUint64Wrapper.forEach { + repeatedUint64Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedFloatWrapper.forEach { + repeatedFloatWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedDoubleWrapper.forEach { + repeatedDoubleWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedStringWrapper.forEach { + repeatedStringWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedBytesWrapper.forEach { + repeatedBytesWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedDuration.forEach { + repeatedDuration.forEach { it.asInternal().checkRequiredFields() } - repeatedTimestamp.forEach { + repeatedTimestamp.forEach { it.asInternal().checkRequiredFields() } - repeatedFieldmask.forEach { + repeatedFieldmask.forEach { it.asInternal().checkRequiredFields() } - repeatedStruct.forEach { + repeatedStruct.forEach { it.asInternal().checkRequiredFields() } - repeatedAny.forEach { + repeatedAny.forEach { it.asInternal().checkRequiredFields() } - repeatedValue.forEach { + repeatedValue.forEach { it.asInternal().checkRequiredFields() } - repeatedListValue.forEach { + repeatedListValue.forEach { it.asInternal().checkRequiredFields() } - mapStringNestedMessage.values.forEach { + mapStringNestedMessage.values.forEach { it.asInternal().checkRequiredFields() } - mapStringForeignMessage.values.forEach { + mapStringForeignMessage.values.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (optionalInt32 != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (optionalInt32 != 0) { encoder.writeInt32(fieldNr = 1, value = optionalInt32) } - if (optionalInt64 != 0L) { + if (optionalInt64 != 0L) { encoder.writeInt64(fieldNr = 2, value = optionalInt64) } - if (optionalUint32 != 0u) { + if (optionalUint32 != 0u) { encoder.writeUInt32(fieldNr = 3, value = optionalUint32) } - if (optionalUint64 != 0uL) { + if (optionalUint64 != 0uL) { encoder.writeUInt64(fieldNr = 4, value = optionalUint64) } - if (optionalSint32 != 0) { + if (optionalSint32 != 0) { encoder.writeSInt32(fieldNr = 5, value = optionalSint32) } - if (optionalSint64 != 0L) { + if (optionalSint64 != 0L) { encoder.writeSInt64(fieldNr = 6, value = optionalSint64) } - if (optionalFixed32 != 0u) { + if (optionalFixed32 != 0u) { encoder.writeFixed32(fieldNr = 7, value = optionalFixed32) } - if (optionalFixed64 != 0uL) { + if (optionalFixed64 != 0uL) { encoder.writeFixed64(fieldNr = 8, value = optionalFixed64) } - if (optionalSfixed32 != 0) { + if (optionalSfixed32 != 0) { encoder.writeSFixed32(fieldNr = 9, value = optionalSfixed32) } - if (optionalSfixed64 != 0L) { + if (optionalSfixed64 != 0L) { encoder.writeSFixed64(fieldNr = 10, value = optionalSfixed64) } - if (optionalFloat != 0.0f) { + if (optionalFloat != 0.0f) { encoder.writeFloat(fieldNr = 11, value = optionalFloat) } - if (optionalDouble != 0.0) { + if (optionalDouble != 0.0) { encoder.writeDouble(fieldNr = 12, value = optionalDouble) } - if (optionalBool != false) { + if (optionalBool != false) { encoder.writeBool(fieldNr = 13, value = optionalBool) } - if (optionalString.isNotEmpty()) { + if (optionalString.isNotEmpty()) { encoder.writeString(fieldNr = 14, value = optionalString) } - if (optionalBytes.isNotEmpty()) { + if (optionalBytes.isNotEmpty()) { encoder.writeBytes(fieldNr = 15, value = optionalBytes) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 18, value = optionalNestedMessage.asInternal()) { encodeWith(it) } } - if (presenceMask[1]) { + if (presenceMask[1]) { encoder.writeMessage(fieldNr = 19, value = optionalForeignMessage.asInternal()) { encodeWith(it) } } - if (optionalNestedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { + if (optionalNestedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { encoder.writeEnum(fieldNr = 21, value = optionalNestedEnum.number) } - if (optionalForeignEnum != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { + if (optionalForeignEnum != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { encoder.writeEnum(fieldNr = 22, value = optionalForeignEnum.number) } - if (optionalAliasedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { + if (optionalAliasedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { encoder.writeEnum(fieldNr = 23, value = optionalAliasedEnum.number) } - if (optionalStringPiece.isNotEmpty()) { + if (optionalStringPiece.isNotEmpty()) { encoder.writeString(fieldNr = 24, value = optionalStringPiece) } - if (optionalCord.isNotEmpty()) { + if (optionalCord.isNotEmpty()) { encoder.writeString(fieldNr = 25, value = optionalCord) } - if (presenceMask[2]) { + if (presenceMask[2]) { encoder.writeMessage(fieldNr = 27, value = recursiveMessage.asInternal()) { encodeWith(it) } } - if (repeatedInt32.isNotEmpty()) { - encoder.writePackedInt32( - fieldNr = 31, - value = repeatedInt32, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32) - ) + if (repeatedInt32.isNotEmpty()) { + encoder.writePackedInt32(fieldNr = 31, value = repeatedInt32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32)) } - if (repeatedInt64.isNotEmpty()) { - encoder.writePackedInt64( - fieldNr = 32, - value = repeatedInt64, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64) - ) + if (repeatedInt64.isNotEmpty()) { + encoder.writePackedInt64(fieldNr = 32, value = repeatedInt64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64)) } - if (repeatedUint32.isNotEmpty()) { - encoder.writePackedUInt32( - fieldNr = 33, - value = repeatedUint32, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32) - ) + if (repeatedUint32.isNotEmpty()) { + encoder.writePackedUInt32(fieldNr = 33, value = repeatedUint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32)) } - if (repeatedUint64.isNotEmpty()) { - encoder.writePackedUInt64( - fieldNr = 34, - value = repeatedUint64, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64) - ) + if (repeatedUint64.isNotEmpty()) { + encoder.writePackedUInt64(fieldNr = 34, value = repeatedUint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64)) } - if (repeatedSint32.isNotEmpty()) { - encoder.writePackedSInt32( - fieldNr = 35, - value = repeatedSint32, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32) - ) + if (repeatedSint32.isNotEmpty()) { + encoder.writePackedSInt32(fieldNr = 35, value = repeatedSint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32)) } - if (repeatedSint64.isNotEmpty()) { - encoder.writePackedSInt64( - fieldNr = 36, - value = repeatedSint64, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64) - ) + if (repeatedSint64.isNotEmpty()) { + encoder.writePackedSInt64(fieldNr = 36, value = repeatedSint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64)) } - if (repeatedFixed32.isNotEmpty()) { + if (repeatedFixed32.isNotEmpty()) { encoder.writePackedFixed32(fieldNr = 37, value = repeatedFixed32) } - if (repeatedFixed64.isNotEmpty()) { + if (repeatedFixed64.isNotEmpty()) { encoder.writePackedFixed64(fieldNr = 38, value = repeatedFixed64) } - if (repeatedSfixed32.isNotEmpty()) { + if (repeatedSfixed32.isNotEmpty()) { encoder.writePackedSFixed32(fieldNr = 39, value = repeatedSfixed32) } - if (repeatedSfixed64.isNotEmpty()) { + if (repeatedSfixed64.isNotEmpty()) { encoder.writePackedSFixed64(fieldNr = 40, value = repeatedSfixed64) } - if (repeatedFloat.isNotEmpty()) { + if (repeatedFloat.isNotEmpty()) { encoder.writePackedFloat(fieldNr = 41, value = repeatedFloat) } - if (repeatedDouble.isNotEmpty()) { + if (repeatedDouble.isNotEmpty()) { encoder.writePackedDouble(fieldNr = 42, value = repeatedDouble) } - if (repeatedBool.isNotEmpty()) { - encoder.writePackedBool( - fieldNr = 43, - value = repeatedBool, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool) - ) + if (repeatedBool.isNotEmpty()) { + encoder.writePackedBool(fieldNr = 43, value = repeatedBool, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool)) } - if (repeatedString.isNotEmpty()) { - repeatedString.forEach { + if (repeatedString.isNotEmpty()) { + repeatedString.forEach { encoder.writeString(44, it) } } - if (repeatedBytes.isNotEmpty()) { - repeatedBytes.forEach { + if (repeatedBytes.isNotEmpty()) { + repeatedBytes.forEach { encoder.writeBytes(45, it) } } - if (repeatedNestedMessage.isNotEmpty()) { - repeatedNestedMessage.forEach { + if (repeatedNestedMessage.isNotEmpty()) { + repeatedNestedMessage.forEach { encoder.writeMessage(fieldNr = 48, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedForeignMessage.isNotEmpty()) { - repeatedForeignMessage.forEach { + if (repeatedForeignMessage.isNotEmpty()) { + repeatedForeignMessage.forEach { encoder.writeMessage(fieldNr = 49, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedNestedEnum.isNotEmpty()) { - encoder.writePackedEnum( - fieldNr = 51, - value = repeatedNestedEnum.map { it.number }, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number }) - ) + if (repeatedNestedEnum.isNotEmpty()) { + encoder.writePackedEnum(fieldNr = 51, value = repeatedNestedEnum.map { it.number }, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number })) } - if (repeatedForeignEnum.isNotEmpty()) { - encoder.writePackedEnum( - fieldNr = 52, - value = repeatedForeignEnum.map { it.number }, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number }) - ) + if (repeatedForeignEnum.isNotEmpty()) { + encoder.writePackedEnum(fieldNr = 52, value = repeatedForeignEnum.map { it.number }, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number })) } - if (repeatedStringPiece.isNotEmpty()) { - repeatedStringPiece.forEach { + if (repeatedStringPiece.isNotEmpty()) { + repeatedStringPiece.forEach { encoder.writeString(54, it) } } - if (repeatedCord.isNotEmpty()) { - repeatedCord.forEach { + if (repeatedCord.isNotEmpty()) { + repeatedCord.forEach { encoder.writeString(55, it) } } - if (packedInt32.isNotEmpty()) { - encoder.writePackedInt32( - fieldNr = 75, - value = packedInt32, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32) - ) + if (packedInt32.isNotEmpty()) { + encoder.writePackedInt32(fieldNr = 75, value = packedInt32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32)) } - if (packedInt64.isNotEmpty()) { - encoder.writePackedInt64( - fieldNr = 76, - value = packedInt64, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64) - ) + if (packedInt64.isNotEmpty()) { + encoder.writePackedInt64(fieldNr = 76, value = packedInt64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64)) } - if (packedUint32.isNotEmpty()) { - encoder.writePackedUInt32( - fieldNr = 77, - value = packedUint32, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32) - ) + if (packedUint32.isNotEmpty()) { + encoder.writePackedUInt32(fieldNr = 77, value = packedUint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32)) } - if (packedUint64.isNotEmpty()) { - encoder.writePackedUInt64( - fieldNr = 78, - value = packedUint64, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64) - ) + if (packedUint64.isNotEmpty()) { + encoder.writePackedUInt64(fieldNr = 78, value = packedUint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64)) } - if (packedSint32.isNotEmpty()) { - encoder.writePackedSInt32( - fieldNr = 79, - value = packedSint32, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32) - ) + if (packedSint32.isNotEmpty()) { + encoder.writePackedSInt32(fieldNr = 79, value = packedSint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32)) } - if (packedSint64.isNotEmpty()) { - encoder.writePackedSInt64( - fieldNr = 80, - value = packedSint64, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64) - ) + if (packedSint64.isNotEmpty()) { + encoder.writePackedSInt64(fieldNr = 80, value = packedSint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64)) } - if (packedFixed32.isNotEmpty()) { + if (packedFixed32.isNotEmpty()) { encoder.writePackedFixed32(fieldNr = 81, value = packedFixed32) } - if (packedFixed64.isNotEmpty()) { + if (packedFixed64.isNotEmpty()) { encoder.writePackedFixed64(fieldNr = 82, value = packedFixed64) } - if (packedSfixed32.isNotEmpty()) { + if (packedSfixed32.isNotEmpty()) { encoder.writePackedSFixed32(fieldNr = 83, value = packedSfixed32) } - if (packedSfixed64.isNotEmpty()) { + if (packedSfixed64.isNotEmpty()) { encoder.writePackedSFixed64(fieldNr = 84, value = packedSfixed64) } - if (packedFloat.isNotEmpty()) { + if (packedFloat.isNotEmpty()) { encoder.writePackedFloat(fieldNr = 85, value = packedFloat) } - if (packedDouble.isNotEmpty()) { + if (packedDouble.isNotEmpty()) { encoder.writePackedDouble(fieldNr = 86, value = packedDouble) } - if (packedBool.isNotEmpty()) { - encoder.writePackedBool( - fieldNr = 87, - value = packedBool, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool) - ) + if (packedBool.isNotEmpty()) { + encoder.writePackedBool(fieldNr = 87, value = packedBool, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool)) } - if (packedNestedEnum.isNotEmpty()) { - encoder.writePackedEnum( - fieldNr = 88, - value = packedNestedEnum.map { it.number }, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number }) - ) + if (packedNestedEnum.isNotEmpty()) { + encoder.writePackedEnum(fieldNr = 88, value = packedNestedEnum.map { it.number }, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number })) } - if (unpackedInt32.isNotEmpty()) { - unpackedInt32.forEach { + if (unpackedInt32.isNotEmpty()) { + unpackedInt32.forEach { encoder.writeInt32(89, it) } } - if (unpackedInt64.isNotEmpty()) { - unpackedInt64.forEach { + if (unpackedInt64.isNotEmpty()) { + unpackedInt64.forEach { encoder.writeInt64(90, it) } } - if (unpackedUint32.isNotEmpty()) { - unpackedUint32.forEach { + if (unpackedUint32.isNotEmpty()) { + unpackedUint32.forEach { encoder.writeUInt32(91, it) } } - if (unpackedUint64.isNotEmpty()) { - unpackedUint64.forEach { + if (unpackedUint64.isNotEmpty()) { + unpackedUint64.forEach { encoder.writeUInt64(92, it) } } - if (unpackedSint32.isNotEmpty()) { - unpackedSint32.forEach { + if (unpackedSint32.isNotEmpty()) { + unpackedSint32.forEach { encoder.writeSInt32(93, it) } } - if (unpackedSint64.isNotEmpty()) { - unpackedSint64.forEach { + if (unpackedSint64.isNotEmpty()) { + unpackedSint64.forEach { encoder.writeSInt64(94, it) } } - if (unpackedFixed32.isNotEmpty()) { - unpackedFixed32.forEach { + if (unpackedFixed32.isNotEmpty()) { + unpackedFixed32.forEach { encoder.writeFixed32(95, it) } } - if (unpackedFixed64.isNotEmpty()) { - unpackedFixed64.forEach { + if (unpackedFixed64.isNotEmpty()) { + unpackedFixed64.forEach { encoder.writeFixed64(96, it) } } - if (unpackedSfixed32.isNotEmpty()) { - unpackedSfixed32.forEach { + if (unpackedSfixed32.isNotEmpty()) { + unpackedSfixed32.forEach { encoder.writeSFixed32(97, it) } } - if (unpackedSfixed64.isNotEmpty()) { - unpackedSfixed64.forEach { + if (unpackedSfixed64.isNotEmpty()) { + unpackedSfixed64.forEach { encoder.writeSFixed64(98, it) } } - if (unpackedFloat.isNotEmpty()) { - unpackedFloat.forEach { + if (unpackedFloat.isNotEmpty()) { + unpackedFloat.forEach { encoder.writeFloat(99, it) } } - if (unpackedDouble.isNotEmpty()) { - unpackedDouble.forEach { + if (unpackedDouble.isNotEmpty()) { + unpackedDouble.forEach { encoder.writeDouble(100, it) } } - if (unpackedBool.isNotEmpty()) { - unpackedBool.forEach { + if (unpackedBool.isNotEmpty()) { + unpackedBool.forEach { encoder.writeBool(101, it) } } - if (unpackedNestedEnum.isNotEmpty()) { - unpackedNestedEnum.forEach { + if (unpackedNestedEnum.isNotEmpty()) { + unpackedNestedEnum.forEach { encoder.writeEnum(102, it.number) } } - if (mapInt32Int32.isNotEmpty()) { + if (mapInt32Int32.isNotEmpty()) { mapInt32Int32.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 56, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 56, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapInt64Int64.isNotEmpty()) { + if (mapInt64Int64.isNotEmpty()) { mapInt64Int64.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 57, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 57, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapUint32Uint32.isNotEmpty()) { + if (mapUint32Uint32.isNotEmpty()) { mapUint32Uint32.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 58, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 58, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapUint64Uint64.isNotEmpty()) { + if (mapUint64Uint64.isNotEmpty()) { mapUint64Uint64.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 59, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 59, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSint32Sint32.isNotEmpty()) { + if (mapSint32Sint32.isNotEmpty()) { mapSint32Sint32.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 60, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 60, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSint64Sint64.isNotEmpty()) { + if (mapSint64Sint64.isNotEmpty()) { mapSint64Sint64.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 61, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 61, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapFixed32Fixed32.isNotEmpty()) { + if (mapFixed32Fixed32.isNotEmpty()) { mapFixed32Fixed32.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 62, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 62, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapFixed64Fixed64.isNotEmpty()) { + if (mapFixed64Fixed64.isNotEmpty()) { mapFixed64Fixed64.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 63, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 63, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSfixed32Sfixed32.isNotEmpty()) { + if (mapSfixed32Sfixed32.isNotEmpty()) { mapSfixed32Sfixed32.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 64, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 64, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSfixed64Sfixed64.isNotEmpty()) { + if (mapSfixed64Sfixed64.isNotEmpty()) { mapSfixed64Sfixed64.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 65, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 65, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapInt32Float.isNotEmpty()) { + if (mapInt32Float.isNotEmpty()) { mapInt32Float.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 66, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 66, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapInt32Double.isNotEmpty()) { + if (mapInt32Double.isNotEmpty()) { mapInt32Double.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 67, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 67, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapBoolBool.isNotEmpty()) { + if (mapBoolBool.isNotEmpty()) { mapBoolBool.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 68, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 68, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringString.isNotEmpty()) { + if (mapStringString.isNotEmpty()) { mapStringString.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 69, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 69, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringBytes.isNotEmpty()) { + if (mapStringBytes.isNotEmpty()) { mapStringBytes.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 70, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 70, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringNestedMessage.isNotEmpty()) { + if (mapStringNestedMessage.isNotEmpty()) { mapStringNestedMessage.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 71, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 71, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringForeignMessage.isNotEmpty()) { + if (mapStringForeignMessage.isNotEmpty()) { mapStringForeignMessage.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 72, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 72, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringNestedEnum.isNotEmpty()) { + if (mapStringNestedEnum.isNotEmpty()) { mapStringNestedEnum.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 73, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 73, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringForeignEnum.isNotEmpty()) { + if (mapStringForeignEnum.isNotEmpty()) { mapStringForeignEnum.forEach { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 74, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 74, value = entry.asInternal()) { encodeWith(it) } + } } } - if (presenceMask[3]) { + if (presenceMask[3]) { encoder.writeMessage(fieldNr = 201, value = optionalBoolWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[4]) { + if (presenceMask[4]) { encoder.writeMessage(fieldNr = 202, value = optionalInt32Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[5]) { + if (presenceMask[5]) { encoder.writeMessage(fieldNr = 203, value = optionalInt64Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[6]) { + if (presenceMask[6]) { encoder.writeMessage(fieldNr = 204, value = optionalUint32Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[7]) { + if (presenceMask[7]) { encoder.writeMessage(fieldNr = 205, value = optionalUint64Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[8]) { + if (presenceMask[8]) { encoder.writeMessage(fieldNr = 206, value = optionalFloatWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[9]) { + if (presenceMask[9]) { encoder.writeMessage(fieldNr = 207, value = optionalDoubleWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[10]) { + if (presenceMask[10]) { encoder.writeMessage(fieldNr = 208, value = optionalStringWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[11]) { + if (presenceMask[11]) { encoder.writeMessage(fieldNr = 209, value = optionalBytesWrapper.asInternal()) { encodeWith(it) } } - if (repeatedBoolWrapper.isNotEmpty()) { - repeatedBoolWrapper.forEach { + if (repeatedBoolWrapper.isNotEmpty()) { + repeatedBoolWrapper.forEach { encoder.writeMessage(fieldNr = 211, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedInt32Wrapper.isNotEmpty()) { - repeatedInt32Wrapper.forEach { + if (repeatedInt32Wrapper.isNotEmpty()) { + repeatedInt32Wrapper.forEach { encoder.writeMessage(fieldNr = 212, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedInt64Wrapper.isNotEmpty()) { - repeatedInt64Wrapper.forEach { + if (repeatedInt64Wrapper.isNotEmpty()) { + repeatedInt64Wrapper.forEach { encoder.writeMessage(fieldNr = 213, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedUint32Wrapper.isNotEmpty()) { - repeatedUint32Wrapper.forEach { + if (repeatedUint32Wrapper.isNotEmpty()) { + repeatedUint32Wrapper.forEach { encoder.writeMessage(fieldNr = 214, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedUint64Wrapper.isNotEmpty()) { - repeatedUint64Wrapper.forEach { + if (repeatedUint64Wrapper.isNotEmpty()) { + repeatedUint64Wrapper.forEach { encoder.writeMessage(fieldNr = 215, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedFloatWrapper.isNotEmpty()) { - repeatedFloatWrapper.forEach { + if (repeatedFloatWrapper.isNotEmpty()) { + repeatedFloatWrapper.forEach { encoder.writeMessage(fieldNr = 216, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedDoubleWrapper.isNotEmpty()) { - repeatedDoubleWrapper.forEach { + if (repeatedDoubleWrapper.isNotEmpty()) { + repeatedDoubleWrapper.forEach { encoder.writeMessage(fieldNr = 217, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedStringWrapper.isNotEmpty()) { - repeatedStringWrapper.forEach { + if (repeatedStringWrapper.isNotEmpty()) { + repeatedStringWrapper.forEach { encoder.writeMessage(fieldNr = 218, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedBytesWrapper.isNotEmpty()) { - repeatedBytesWrapper.forEach { + if (repeatedBytesWrapper.isNotEmpty()) { + repeatedBytesWrapper.forEach { encoder.writeMessage(fieldNr = 219, value = it.asInternal()) { encodeWith(it) } } } - if (presenceMask[12]) { + if (presenceMask[12]) { encoder.writeMessage(fieldNr = 301, value = optionalDuration.asInternal()) { encodeWith(it) } } - if (presenceMask[13]) { + if (presenceMask[13]) { encoder.writeMessage(fieldNr = 302, value = optionalTimestamp.asInternal()) { encodeWith(it) } } - if (presenceMask[14]) { + if (presenceMask[14]) { encoder.writeMessage(fieldNr = 303, value = optionalFieldMask.asInternal()) { encodeWith(it) } } - if (presenceMask[15]) { + if (presenceMask[15]) { encoder.writeMessage(fieldNr = 304, value = optionalStruct.asInternal()) { encodeWith(it) } } - if (presenceMask[16]) { + if (presenceMask[16]) { encoder.writeMessage(fieldNr = 305, value = optionalAny.asInternal()) { encodeWith(it) } } - if (presenceMask[17]) { + if (presenceMask[17]) { encoder.writeMessage(fieldNr = 306, value = optionalValue.asInternal()) { encodeWith(it) } } - if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { + if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { encoder.writeEnum(fieldNr = 307, value = optionalNullValue.number) } - if (repeatedDuration.isNotEmpty()) { - repeatedDuration.forEach { + if (repeatedDuration.isNotEmpty()) { + repeatedDuration.forEach { encoder.writeMessage(fieldNr = 311, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedTimestamp.isNotEmpty()) { - repeatedTimestamp.forEach { + if (repeatedTimestamp.isNotEmpty()) { + repeatedTimestamp.forEach { encoder.writeMessage(fieldNr = 312, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedFieldmask.isNotEmpty()) { - repeatedFieldmask.forEach { + if (repeatedFieldmask.isNotEmpty()) { + repeatedFieldmask.forEach { encoder.writeMessage(fieldNr = 313, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedStruct.isNotEmpty()) { - repeatedStruct.forEach { + if (repeatedStruct.isNotEmpty()) { + repeatedStruct.forEach { encoder.writeMessage(fieldNr = 324, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedAny.isNotEmpty()) { - repeatedAny.forEach { + if (repeatedAny.isNotEmpty()) { + repeatedAny.forEach { encoder.writeMessage(fieldNr = 315, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedValue.isNotEmpty()) { - repeatedValue.forEach { + if (repeatedValue.isNotEmpty()) { + repeatedValue.forEach { encoder.writeMessage(fieldNr = 316, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedListValue.isNotEmpty()) { - repeatedListValue.forEach { + if (repeatedListValue.isNotEmpty()) { + repeatedListValue.forEach { encoder.writeMessage(fieldNr = 317, value = it.asInternal()) { encodeWith(it) } } } - if (fieldname1 != 0) { + if (fieldname1 != 0) { encoder.writeInt32(fieldNr = 401, value = fieldname1) } - if (fieldName2 != 0) { + if (fieldName2 != 0) { encoder.writeInt32(fieldNr = 402, value = fieldName2) } - if (FieldName3 != 0) { + if (FieldName3 != 0) { encoder.writeInt32(fieldNr = 403, value = FieldName3) } - if (field_Name4_ != 0) { + if (field_Name4_ != 0) { encoder.writeInt32(fieldNr = 404, value = field_Name4_) } - if (field0name5 != 0) { + if (field0name5 != 0) { encoder.writeInt32(fieldNr = 405, value = field0name5) } - if (field_0Name6 != 0) { + if (field_0Name6 != 0) { encoder.writeInt32(fieldNr = 406, value = field_0Name6) } - if (fieldName7 != 0) { + if (fieldName7 != 0) { encoder.writeInt32(fieldNr = 407, value = fieldName7) } - if (FieldName8 != 0) { + if (FieldName8 != 0) { encoder.writeInt32(fieldNr = 408, value = FieldName8) } - if (field_Name9 != 0) { + if (field_Name9 != 0) { encoder.writeInt32(fieldNr = 409, value = field_Name9) } - if (Field_Name10 != 0) { + if (Field_Name10 != 0) { encoder.writeInt32(fieldNr = 410, value = Field_Name10) } - if (FIELD_NAME11 != 0) { + if (FIELD_NAME11 != 0) { encoder.writeInt32(fieldNr = 411, value = FIELD_NAME11) } - if (FIELDName12 != 0) { + if (FIELDName12 != 0) { encoder.writeInt32(fieldNr = 412, value = FIELDName12) } - if (_FieldName13 != 0) { + if (_FieldName13 != 0) { encoder.writeInt32(fieldNr = 413, value = _FieldName13) } - if (__FieldName14 != 0) { + if (__FieldName14 != 0) { encoder.writeInt32(fieldNr = 414, value = __FieldName14) } - if (field_Name15 != 0) { + if (field_Name15 != 0) { encoder.writeInt32(fieldNr = 415, value = field_Name15) } - if (field__Name16 != 0) { + if (field__Name16 != 0) { encoder.writeInt32(fieldNr = 416, value = field__Name16) } - if (fieldName17__ != 0) { + if (fieldName17__ != 0) { encoder.writeInt32(fieldNr = 417, value = fieldName17__) } - if (FieldName18__ != 0) { + if (FieldName18__ != 0) { encoder.writeInt32(fieldNr = 418, value = FieldName18__) } - oneofField?.also { - when (val value = it) { - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { + oneofField?.also { + when (val value = it) { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { encoder.writeUInt32(fieldNr = 111, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { encoder.writeMessage(fieldNr = 112, value = value.value.asInternal()) { encodeWith(it) } } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofString -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofString -> { encoder.writeString(fieldNr = 113, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { encoder.writeBytes(fieldNr = 114, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBool -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBool -> { encoder.writeBool(fieldNr = 115, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { encoder.writeUInt64(fieldNr = 116, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { encoder.writeFloat(fieldNr = 117, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { encoder.writeDouble(fieldNr = 118, value = value.value) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { encoder.writeEnum(fieldNr = 119, value = value.value.number) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { encoder.writeEnum(fieldNr = 120, value = value.value.number) } } @@ -1738,1157 +1590,1004 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalInt32 = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalInt64 = decoder.readInt64() } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalUint32 = decoder.readUInt32() } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalUint64 = decoder.readUInt64() } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalSint32 = decoder.readSInt32() } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalSint64 = decoder.readSInt64() } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.optionalFixed32 = decoder.readFixed32() } - tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.optionalFixed64 = decoder.readFixed64() } - tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.optionalSfixed32 = decoder.readSFixed32() } - tag.fieldNr == 10 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 10 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.optionalSfixed64 = decoder.readSFixed64() } - tag.fieldNr == 11 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 11 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.optionalFloat = decoder.readFloat() } - tag.fieldNr == 12 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 12 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.optionalDouble = decoder.readDouble() } - tag.fieldNr == 13 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 13 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalBool = decoder.readBool() } - tag.fieldNr == 14 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 14 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalString = decoder.readString() } - tag.fieldNr == 15 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 15 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalBytes = decoder.readBytes() } - tag.fieldNr == 18 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { - msg.optionalNestedMessage = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + tag.fieldNr == 18 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { + msg.optionalNestedMessage = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } - decoder.readMessage( - msg.optionalNestedMessage.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith - ) + decoder.readMessage(msg.optionalNestedMessage.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) } - tag.fieldNr == 19 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[1]) { - msg.optionalForeignMessage = - com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() + tag.fieldNr == 19 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[1]) { + msg.optionalForeignMessage = com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() } - decoder.readMessage( - msg.optionalForeignMessage.asInternal(), - com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal::decodeWith - ) + decoder.readMessage(msg.optionalForeignMessage.asInternal(), com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal::decodeWith) } - tag.fieldNr == 21 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.optionalNestedEnum = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 21 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.optionalNestedEnum = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) } - tag.fieldNr == 22 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.optionalForeignEnum = - com.google.protobuf_test_messages.editions.proto3.ForeignEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 22 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.optionalForeignEnum = com.google.protobuf_test_messages.editions.proto3.ForeignEnum.fromNumber(decoder.readEnum()) } - tag.fieldNr == 23 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.optionalAliasedEnum = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 23 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.optionalAliasedEnum = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.fromNumber(decoder.readEnum()) } - tag.fieldNr == 24 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 24 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalStringPiece = decoder.readString() } - tag.fieldNr == 25 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 25 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalCord = decoder.readString() } - tag.fieldNr == 27 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[2]) { - msg.recursiveMessage = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() + tag.fieldNr == 27 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[2]) { + msg.recursiveMessage = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() } - decoder.readMessage( - msg.recursiveMessage.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal::decodeWith - ) + decoder.readMessage(msg.recursiveMessage.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal::decodeWith) } - tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedInt32 += decoder.readPackedInt32() } - tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt32() (msg.repeatedInt32 as MutableList).add(elem) } - tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedInt64 += decoder.readPackedInt64() } - tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt64() (msg.repeatedInt64 as MutableList).add(elem) } - tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedUint32 += decoder.readPackedUInt32() } - tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt32() (msg.repeatedUint32 as MutableList).add(elem) } - tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedUint64 += decoder.readPackedUInt64() } - tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt64() (msg.repeatedUint64 as MutableList).add(elem) } - tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSint32 += decoder.readPackedSInt32() } - tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt32() (msg.repeatedSint32 as MutableList).add(elem) } - tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSint64 += decoder.readPackedSInt64() } - tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt64() (msg.repeatedSint64 as MutableList).add(elem) } - tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedFixed32 += decoder.readPackedFixed32() } - tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFixed32() (msg.repeatedFixed32 as MutableList).add(elem) } - tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedFixed64 += decoder.readPackedFixed64() } - tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readFixed64() (msg.repeatedFixed64 as MutableList).add(elem) } - tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSfixed32 += decoder.readPackedSFixed32() } - tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readSFixed32() (msg.repeatedSfixed32 as MutableList).add(elem) } - tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSfixed64 += decoder.readPackedSFixed64() } - tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readSFixed64() (msg.repeatedSfixed64 as MutableList).add(elem) } - tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedFloat += decoder.readPackedFloat() } - tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFloat() (msg.repeatedFloat as MutableList).add(elem) } - tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedDouble += decoder.readPackedDouble() } - tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readDouble() (msg.repeatedDouble as MutableList).add(elem) } - tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedBool += decoder.readPackedBool() } - tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readBool() (msg.repeatedBool as MutableList).add(elem) } - tag.fieldNr == 44 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 44 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.repeatedString as MutableList).add(elem) } - tag.fieldNr == 45 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 45 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readBytes() (msg.repeatedBytes as MutableList).add(elem) } - tag.fieldNr == 48 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - val elem = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() - decoder.readMessage( - elem.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith - ) + tag.fieldNr == 48 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + val elem = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + decoder.readMessage(elem.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) (msg.repeatedNestedMessage as MutableList).add(elem) } - tag.fieldNr == 49 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 49 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() - decoder.readMessage( - elem.asInternal(), - com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal::decodeWith - ) + decoder.readMessage(elem.asInternal(), com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal::decodeWith) (msg.repeatedForeignMessage as MutableList).add(elem) } - tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.repeatedNestedEnum += decoder.readPackedEnum() - .map { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } + tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.repeatedNestedEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } } - tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - val elem = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + val elem = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) (msg.repeatedNestedEnum as MutableList).add(elem) } - tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.repeatedForeignEnum += decoder.readPackedEnum() - .map { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.fromNumber(it) } + tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.repeatedForeignEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.fromNumber(it) } } - tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = com.google.protobuf_test_messages.editions.proto3.ForeignEnum.fromNumber(decoder.readEnum()) (msg.repeatedForeignEnum as MutableList).add(elem) } - tag.fieldNr == 54 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 54 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.repeatedStringPiece as MutableList).add(elem) } - tag.fieldNr == 55 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 55 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.repeatedCord as MutableList).add(elem) } - tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedInt32 += decoder.readPackedInt32() } - tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt32() (msg.packedInt32 as MutableList).add(elem) } - tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedInt64 += decoder.readPackedInt64() } - tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt64() (msg.packedInt64 as MutableList).add(elem) } - tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedUint32 += decoder.readPackedUInt32() } - tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt32() (msg.packedUint32 as MutableList).add(elem) } - tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedUint64 += decoder.readPackedUInt64() } - tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt64() (msg.packedUint64 as MutableList).add(elem) } - tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSint32 += decoder.readPackedSInt32() } - tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt32() (msg.packedSint32 as MutableList).add(elem) } - tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSint64 += decoder.readPackedSInt64() } - tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt64() (msg.packedSint64 as MutableList).add(elem) } - tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedFixed32 += decoder.readPackedFixed32() } - tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFixed32() (msg.packedFixed32 as MutableList).add(elem) } - tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedFixed64 += decoder.readPackedFixed64() } - tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readFixed64() (msg.packedFixed64 as MutableList).add(elem) } - tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSfixed32 += decoder.readPackedSFixed32() } - tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readSFixed32() (msg.packedSfixed32 as MutableList).add(elem) } - tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSfixed64 += decoder.readPackedSFixed64() } - tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readSFixed64() (msg.packedSfixed64 as MutableList).add(elem) } - tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedFloat += decoder.readPackedFloat() } - tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFloat() (msg.packedFloat as MutableList).add(elem) } - tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedDouble += decoder.readPackedDouble() } - tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readDouble() (msg.packedDouble as MutableList).add(elem) } - tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedBool += decoder.readPackedBool() } - tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readBool() (msg.packedBool as MutableList).add(elem) } - tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.packedNestedEnum += decoder.readPackedEnum() - .map { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } + tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.packedNestedEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } } - tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - val elem = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + val elem = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) (msg.packedNestedEnum as MutableList).add(elem) } - tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedInt32 += decoder.readPackedInt32() } - tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt32() (msg.unpackedInt32 as MutableList).add(elem) } - tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedInt64 += decoder.readPackedInt64() } - tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt64() (msg.unpackedInt64 as MutableList).add(elem) } - tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedUint32 += decoder.readPackedUInt32() } - tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt32() (msg.unpackedUint32 as MutableList).add(elem) } - tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedUint64 += decoder.readPackedUInt64() } - tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt64() (msg.unpackedUint64 as MutableList).add(elem) } - tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSint32 += decoder.readPackedSInt32() } - tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt32() (msg.unpackedSint32 as MutableList).add(elem) } - tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSint64 += decoder.readPackedSInt64() } - tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt64() (msg.unpackedSint64 as MutableList).add(elem) } - tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedFixed32 += decoder.readPackedFixed32() } - tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFixed32() (msg.unpackedFixed32 as MutableList).add(elem) } - tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedFixed64 += decoder.readPackedFixed64() } - tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readFixed64() (msg.unpackedFixed64 as MutableList).add(elem) } - tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSfixed32 += decoder.readPackedSFixed32() } - tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readSFixed32() (msg.unpackedSfixed32 as MutableList).add(elem) } - tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSfixed64 += decoder.readPackedSFixed64() } - tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readSFixed64() (msg.unpackedSfixed64 as MutableList).add(elem) } - tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedFloat += decoder.readPackedFloat() } - tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFloat() (msg.unpackedFloat as MutableList).add(elem) } - tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedDouble += decoder.readPackedDouble() } - tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readDouble() (msg.unpackedDouble as MutableList).add(elem) } - tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedBool += decoder.readPackedBool() } - tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readBool() (msg.unpackedBool as MutableList).add(elem) } - tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.unpackedNestedEnum += decoder.readPackedEnum() - .map { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } + tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.unpackedNestedEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } } - tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - val elem = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + val elem = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) (msg.unpackedNestedEnum as MutableList).add(elem) } - tag.fieldNr == 56 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal::decodeWith - ) + tag.fieldNr == 56 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal::decodeWith) (msg.mapInt32Int32 as MutableMap)[key] = value } } - tag.fieldNr == 57 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal::decodeWith - ) + tag.fieldNr == 57 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal::decodeWith) (msg.mapInt64Int64 as MutableMap)[key] = value } } - tag.fieldNr == 58 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal::decodeWith - ) + tag.fieldNr == 58 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal::decodeWith) (msg.mapUint32Uint32 as MutableMap)[key] = value } } - tag.fieldNr == 59 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal::decodeWith - ) + tag.fieldNr == 59 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal::decodeWith) (msg.mapUint64Uint64 as MutableMap)[key] = value } } - tag.fieldNr == 60 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal::decodeWith - ) + tag.fieldNr == 60 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal::decodeWith) (msg.mapSint32Sint32 as MutableMap)[key] = value } } - tag.fieldNr == 61 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal::decodeWith - ) + tag.fieldNr == 61 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal::decodeWith) (msg.mapSint64Sint64 as MutableMap)[key] = value } } - tag.fieldNr == 62 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal::decodeWith - ) + tag.fieldNr == 62 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal::decodeWith) (msg.mapFixed32Fixed32 as MutableMap)[key] = value } } - tag.fieldNr == 63 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal::decodeWith - ) + tag.fieldNr == 63 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal::decodeWith) (msg.mapFixed64Fixed64 as MutableMap)[key] = value } } - tag.fieldNr == 64 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal::decodeWith - ) + tag.fieldNr == 64 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal::decodeWith) (msg.mapSfixed32Sfixed32 as MutableMap)[key] = value } } - tag.fieldNr == 65 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal::decodeWith - ) + tag.fieldNr == 65 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal::decodeWith) (msg.mapSfixed64Sfixed64 as MutableMap)[key] = value } } - tag.fieldNr == 66 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal::decodeWith - ) + tag.fieldNr == 66 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal::decodeWith) (msg.mapInt32Float as MutableMap)[key] = value } } - tag.fieldNr == 67 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal::decodeWith - ) + tag.fieldNr == 67 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal::decodeWith) (msg.mapInt32Double as MutableMap)[key] = value } } - tag.fieldNr == 68 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal::decodeWith - ) + tag.fieldNr == 68 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal::decodeWith) (msg.mapBoolBool as MutableMap)[key] = value } } - tag.fieldNr == 69 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal::decodeWith - ) + tag.fieldNr == 69 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal::decodeWith) (msg.mapStringString as MutableMap)[key] = value } } - tag.fieldNr == 70 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal::decodeWith - ) + tag.fieldNr == 70 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal::decodeWith) (msg.mapStringBytes as MutableMap)[key] = value } } - tag.fieldNr == 71 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal::decodeWith - ) + tag.fieldNr == 71 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal::decodeWith) (msg.mapStringNestedMessage as MutableMap)[key] = value } } - tag.fieldNr == 72 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal::decodeWith - ) + tag.fieldNr == 72 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal::decodeWith) (msg.mapStringForeignMessage as MutableMap)[key] = value } } - tag.fieldNr == 73 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal::decodeWith - ) + tag.fieldNr == 73 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal::decodeWith) (msg.mapStringNestedEnum as MutableMap)[key] = value } } - tag.fieldNr == 74 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal::decodeWith - ) + tag.fieldNr == 74 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal::decodeWith) (msg.mapStringForeignEnum as MutableMap)[key] = value } } - tag.fieldNr == 201 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[3]) { + tag.fieldNr == 201 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[3]) { msg.optionalBoolWrapper = com.google.protobuf.kotlin.BoolValueInternal() } - decoder.readMessage( - msg.optionalBoolWrapper.asInternal(), - com.google.protobuf.kotlin.BoolValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalBoolWrapper.asInternal(), com.google.protobuf.kotlin.BoolValueInternal::decodeWith) } - tag.fieldNr == 202 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[4]) { + tag.fieldNr == 202 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[4]) { msg.optionalInt32Wrapper = com.google.protobuf.kotlin.Int32ValueInternal() } - decoder.readMessage( - msg.optionalInt32Wrapper.asInternal(), - com.google.protobuf.kotlin.Int32ValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalInt32Wrapper.asInternal(), com.google.protobuf.kotlin.Int32ValueInternal::decodeWith) } - tag.fieldNr == 203 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[5]) { + tag.fieldNr == 203 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[5]) { msg.optionalInt64Wrapper = com.google.protobuf.kotlin.Int64ValueInternal() } - decoder.readMessage( - msg.optionalInt64Wrapper.asInternal(), - com.google.protobuf.kotlin.Int64ValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalInt64Wrapper.asInternal(), com.google.protobuf.kotlin.Int64ValueInternal::decodeWith) } - tag.fieldNr == 204 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[6]) { + tag.fieldNr == 204 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[6]) { msg.optionalUint32Wrapper = com.google.protobuf.kotlin.UInt32ValueInternal() } - decoder.readMessage( - msg.optionalUint32Wrapper.asInternal(), - com.google.protobuf.kotlin.UInt32ValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalUint32Wrapper.asInternal(), com.google.protobuf.kotlin.UInt32ValueInternal::decodeWith) } - tag.fieldNr == 205 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[7]) { + tag.fieldNr == 205 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[7]) { msg.optionalUint64Wrapper = com.google.protobuf.kotlin.UInt64ValueInternal() } - decoder.readMessage( - msg.optionalUint64Wrapper.asInternal(), - com.google.protobuf.kotlin.UInt64ValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalUint64Wrapper.asInternal(), com.google.protobuf.kotlin.UInt64ValueInternal::decodeWith) } - tag.fieldNr == 206 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[8]) { + tag.fieldNr == 206 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[8]) { msg.optionalFloatWrapper = com.google.protobuf.kotlin.FloatValueInternal() } - decoder.readMessage( - msg.optionalFloatWrapper.asInternal(), - com.google.protobuf.kotlin.FloatValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalFloatWrapper.asInternal(), com.google.protobuf.kotlin.FloatValueInternal::decodeWith) } - tag.fieldNr == 207 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[9]) { + tag.fieldNr == 207 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[9]) { msg.optionalDoubleWrapper = com.google.protobuf.kotlin.DoubleValueInternal() } - decoder.readMessage( - msg.optionalDoubleWrapper.asInternal(), - com.google.protobuf.kotlin.DoubleValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalDoubleWrapper.asInternal(), com.google.protobuf.kotlin.DoubleValueInternal::decodeWith) } - tag.fieldNr == 208 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[10]) { + tag.fieldNr == 208 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[10]) { msg.optionalStringWrapper = com.google.protobuf.kotlin.StringValueInternal() } - decoder.readMessage( - msg.optionalStringWrapper.asInternal(), - com.google.protobuf.kotlin.StringValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalStringWrapper.asInternal(), com.google.protobuf.kotlin.StringValueInternal::decodeWith) } - tag.fieldNr == 209 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[11]) { + tag.fieldNr == 209 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[11]) { msg.optionalBytesWrapper = com.google.protobuf.kotlin.BytesValueInternal() } - decoder.readMessage( - msg.optionalBytesWrapper.asInternal(), - com.google.protobuf.kotlin.BytesValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalBytesWrapper.asInternal(), com.google.protobuf.kotlin.BytesValueInternal::decodeWith) } - tag.fieldNr == 211 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 211 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.BoolValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.BoolValueInternal::decodeWith) (msg.repeatedBoolWrapper as MutableList).add(elem) } - tag.fieldNr == 212 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 212 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.Int32ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.Int32ValueInternal::decodeWith) (msg.repeatedInt32Wrapper as MutableList).add(elem) } - tag.fieldNr == 213 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 213 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.Int64ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.Int64ValueInternal::decodeWith) (msg.repeatedInt64Wrapper as MutableList).add(elem) } - tag.fieldNr == 214 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 214 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.UInt32ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.UInt32ValueInternal::decodeWith) (msg.repeatedUint32Wrapper as MutableList).add(elem) } - tag.fieldNr == 215 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 215 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.UInt64ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.UInt64ValueInternal::decodeWith) (msg.repeatedUint64Wrapper as MutableList).add(elem) } - tag.fieldNr == 216 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 216 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.FloatValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.FloatValueInternal::decodeWith) (msg.repeatedFloatWrapper as MutableList).add(elem) } - tag.fieldNr == 217 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 217 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.DoubleValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.DoubleValueInternal::decodeWith) (msg.repeatedDoubleWrapper as MutableList).add(elem) } - tag.fieldNr == 218 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 218 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.StringValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.StringValueInternal::decodeWith) (msg.repeatedStringWrapper as MutableList).add(elem) } - tag.fieldNr == 219 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 219 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.BytesValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.BytesValueInternal::decodeWith) (msg.repeatedBytesWrapper as MutableList).add(elem) } - tag.fieldNr == 301 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[12]) { + tag.fieldNr == 301 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[12]) { msg.optionalDuration = com.google.protobuf.kotlin.DurationInternal() } - decoder.readMessage( - msg.optionalDuration.asInternal(), - com.google.protobuf.kotlin.DurationInternal::decodeWith - ) + decoder.readMessage(msg.optionalDuration.asInternal(), com.google.protobuf.kotlin.DurationInternal::decodeWith) } - tag.fieldNr == 302 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[13]) { + tag.fieldNr == 302 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[13]) { msg.optionalTimestamp = com.google.protobuf.kotlin.TimestampInternal() } - decoder.readMessage( - msg.optionalTimestamp.asInternal(), - com.google.protobuf.kotlin.TimestampInternal::decodeWith - ) + decoder.readMessage(msg.optionalTimestamp.asInternal(), com.google.protobuf.kotlin.TimestampInternal::decodeWith) } - tag.fieldNr == 303 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[14]) { + tag.fieldNr == 303 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[14]) { msg.optionalFieldMask = com.google.protobuf.kotlin.FieldMaskInternal() } - decoder.readMessage( - msg.optionalFieldMask.asInternal(), - com.google.protobuf.kotlin.FieldMaskInternal::decodeWith - ) + decoder.readMessage(msg.optionalFieldMask.asInternal(), com.google.protobuf.kotlin.FieldMaskInternal::decodeWith) } - tag.fieldNr == 304 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[15]) { + tag.fieldNr == 304 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[15]) { msg.optionalStruct = com.google.protobuf.kotlin.StructInternal() } - decoder.readMessage( - msg.optionalStruct.asInternal(), - com.google.protobuf.kotlin.StructInternal::decodeWith - ) + decoder.readMessage(msg.optionalStruct.asInternal(), com.google.protobuf.kotlin.StructInternal::decodeWith) } - tag.fieldNr == 305 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[16]) { + tag.fieldNr == 305 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[16]) { msg.optionalAny = com.google.protobuf.kotlin.AnyInternal() } decoder.readMessage(msg.optionalAny.asInternal(), com.google.protobuf.kotlin.AnyInternal::decodeWith) } - tag.fieldNr == 306 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[17]) { + tag.fieldNr == 306 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[17]) { msg.optionalValue = com.google.protobuf.kotlin.ValueInternal() } - decoder.readMessage( - msg.optionalValue.asInternal(), - com.google.protobuf.kotlin.ValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalValue.asInternal(), com.google.protobuf.kotlin.ValueInternal::decodeWith) } - tag.fieldNr == 307 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 307 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalNullValue = com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum()) } - tag.fieldNr == 311 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 311 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.DurationInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.DurationInternal::decodeWith) (msg.repeatedDuration as MutableList).add(elem) } - tag.fieldNr == 312 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 312 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.TimestampInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.TimestampInternal::decodeWith) (msg.repeatedTimestamp as MutableList).add(elem) } - tag.fieldNr == 313 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 313 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.FieldMaskInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.FieldMaskInternal::decodeWith) (msg.repeatedFieldmask as MutableList).add(elem) } - tag.fieldNr == 324 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 324 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.StructInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.StructInternal::decodeWith) (msg.repeatedStruct as MutableList).add(elem) } - tag.fieldNr == 315 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 315 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.AnyInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.AnyInternal::decodeWith) (msg.repeatedAny as MutableList).add(elem) } - tag.fieldNr == 316 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 316 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.ValueInternal::decodeWith) (msg.repeatedValue as MutableList).add(elem) } - tag.fieldNr == 317 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 317 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.ListValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.ListValueInternal::decodeWith) (msg.repeatedListValue as MutableList).add(elem) } - tag.fieldNr == 401 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 401 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldname1 = decoder.readInt32() } - tag.fieldNr == 402 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 402 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldName2 = decoder.readInt32() } - tag.fieldNr == 403 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 403 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FieldName3 = decoder.readInt32() } - tag.fieldNr == 404 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 404 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_Name4_ = decoder.readInt32() } - tag.fieldNr == 405 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 405 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field0name5 = decoder.readInt32() } - tag.fieldNr == 406 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 406 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_0Name6 = decoder.readInt32() } - tag.fieldNr == 407 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 407 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldName7 = decoder.readInt32() } - tag.fieldNr == 408 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 408 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FieldName8 = decoder.readInt32() } - tag.fieldNr == 409 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 409 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_Name9 = decoder.readInt32() } - tag.fieldNr == 410 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 410 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.Field_Name10 = decoder.readInt32() } - tag.fieldNr == 411 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 411 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FIELD_NAME11 = decoder.readInt32() } - tag.fieldNr == 412 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 412 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FIELDName12 = decoder.readInt32() } - tag.fieldNr == 413 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 413 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg._FieldName13 = decoder.readInt32() } - tag.fieldNr == 414 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 414 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.__FieldName14 = decoder.readInt32() } - tag.fieldNr == 415 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 415 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_Name15 = decoder.readInt32() } - tag.fieldNr == 416 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 416 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field__Name16 = decoder.readInt32() } - tag.fieldNr == 417 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 417 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldName17__ = decoder.readInt32() } - tag.fieldNr == 418 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 418 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FieldName18__ = decoder.readInt32() } - tag.fieldNr == 111 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint32(decoder.readUInt32()) + tag.fieldNr == 111 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint32(decoder.readUInt32()) } - tag.fieldNr == 112 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - val field = - (msg.oneofField as? com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage) - ?: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage( - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() - ).also { - msg.oneofField = it - } + tag.fieldNr == 112 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + val field = (msg.oneofField as? com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage) ?: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal()).also { + msg.oneofField = it + } - decoder.readMessage( - field.value.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith - ) + decoder.readMessage(field.value.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) } - tag.fieldNr == 113 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.oneofField = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofString(decoder.readString()) + tag.fieldNr == 113 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofString(decoder.readString()) } - tag.fieldNr == 114 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.oneofField = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBytes(decoder.readBytes()) + tag.fieldNr == 114 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBytes(decoder.readBytes()) } - tag.fieldNr == 115 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBool(decoder.readBool()) + tag.fieldNr == 115 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBool(decoder.readBool()) } - tag.fieldNr == 116 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint64(decoder.readUInt64()) + tag.fieldNr == 116 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint64(decoder.readUInt64()) } - tag.fieldNr == 117 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { - msg.oneofField = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofFloat(decoder.readFloat()) + tag.fieldNr == 117 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofFloat(decoder.readFloat()) } - tag.fieldNr == 118 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { - msg.oneofField = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofDouble(decoder.readDouble()) + tag.fieldNr == 118 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofDouble(decoder.readDouble()) } - tag.fieldNr == 119 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofEnum( - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber( - decoder.readEnum() - ) - ) + tag.fieldNr == 119 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofEnum(com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum())) } - tag.fieldNr == 120 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNullValue( - com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum()) - ) + tag.fieldNr == 120 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNullValue(com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum())) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -2899,1321 +2598,726 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.computeSize(): Int { var __result = 0 - if (optionalInt32 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(optionalInt32)) + if (optionalInt32 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(optionalInt32)) } - if (optionalInt64 != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int64(optionalInt64)) + if (optionalInt64 != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(optionalInt64)) } - if (optionalUint32 != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 3, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(optionalUint32)) + if (optionalUint32 != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(optionalUint32)) } - if (optionalUint64 != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 4, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(optionalUint64)) + if (optionalUint64 != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(optionalUint64)) } - if (optionalSint32 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 5, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(optionalSint32)) + if (optionalSint32 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(optionalSint32)) } - if (optionalSint64 != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 6, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(optionalSint64)) + if (optionalSint64 != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(optionalSint64)) } - if (optionalFixed32 != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 7, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(optionalFixed32)) + if (optionalFixed32 != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(optionalFixed32)) } - if (optionalFixed64 != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 8, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(optionalFixed64)) + if (optionalFixed64 != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(8, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(optionalFixed64)) } - if (optionalSfixed32 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 9, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(optionalSfixed32)) + if (optionalSfixed32 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(9, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(optionalSfixed32)) } - if (optionalSfixed64 != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 10, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(optionalSfixed64)) + if (optionalSfixed64 != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(10, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(optionalSfixed64)) } - if (optionalFloat != 0.0f) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 11, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.float(optionalFloat)) + if (optionalFloat != 0.0f) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(11, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(optionalFloat)) } - if (optionalDouble != 0.0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 12, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.double(optionalDouble)) + if (optionalDouble != 0.0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(12, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(optionalDouble)) } - if (optionalBool != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 13, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(optionalBool)) + if (optionalBool != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(13, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(optionalBool)) } - if (optionalString.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalString).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 14, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (optionalString.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalString).let { kotlinx.rpc.protobuf.internal.WireSize.tag(14, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (optionalBytes.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(optionalBytes).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 15, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (optionalBytes.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(optionalBytes).let { kotlinx.rpc.protobuf.internal.WireSize.tag(15, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[0]) { - __result += optionalNestedMessage.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 18, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += optionalNestedMessage.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(18, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[1]) { - __result += optionalForeignMessage.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 19, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[1]) { + __result += optionalForeignMessage.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(19, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (optionalNestedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 21, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNestedEnum.number)) + if (optionalNestedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(21, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNestedEnum.number)) } - if (optionalForeignEnum != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 22, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalForeignEnum.number)) + if (optionalForeignEnum != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(22, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalForeignEnum.number)) } - if (optionalAliasedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 23, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalAliasedEnum.number)) + if (optionalAliasedEnum != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(23, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalAliasedEnum.number)) } - if (optionalStringPiece.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalStringPiece).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 24, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (optionalStringPiece.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalStringPiece).let { kotlinx.rpc.protobuf.internal.WireSize.tag(24, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (optionalCord.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalCord).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 25, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (optionalCord.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalCord).let { kotlinx.rpc.protobuf.internal.WireSize.tag(25, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[2]) { - __result += recursiveMessage.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 27, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[2]) { + __result += recursiveMessage.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(27, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedInt32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 31, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedInt32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(31, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedInt64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 32, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedInt64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(32, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedUint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 33, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedUint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(33, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedUint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 34, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedUint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(34, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedSint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 35, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedSint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(35, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedSint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 36, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedSint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(36, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedFixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(repeatedFixed32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 37, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedFixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(repeatedFixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(37, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedFixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(repeatedFixed64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 38, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedFixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(repeatedFixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(38, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedSfixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(repeatedSfixed32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 39, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedSfixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(repeatedSfixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(39, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedSfixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(repeatedSfixed64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 40, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedSfixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(repeatedSfixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(40, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedFloat.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(repeatedFloat).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 41, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedFloat.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(repeatedFloat).let { kotlinx.rpc.protobuf.internal.WireSize.tag(41, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedDouble.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(repeatedDouble).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 42, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedDouble.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(repeatedDouble).let { kotlinx.rpc.protobuf.internal.WireSize.tag(42, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedBool.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 43, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedBool.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool).let { kotlinx.rpc.protobuf.internal.WireSize.tag(43, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedString.isNotEmpty()) { - __result += repeatedString.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 44, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedString.isNotEmpty()) { + __result += repeatedString.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(44, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedBytes.isNotEmpty()) { - __result += repeatedBytes.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.bytes(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 45, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedBytes.isNotEmpty()) { + __result += repeatedBytes.sumOf { kotlinx.rpc.protobuf.internal.WireSize.bytes(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(45, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedNestedMessage.isNotEmpty()) { - __result += repeatedNestedMessage.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 48, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedNestedMessage.isNotEmpty()) { + __result += repeatedNestedMessage.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(48, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedForeignMessage.isNotEmpty()) { - __result += repeatedForeignMessage.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 49, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedForeignMessage.isNotEmpty()) { + __result += repeatedForeignMessage.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(49, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedNestedEnum.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number }).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 51, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedNestedEnum.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number }).let { kotlinx.rpc.protobuf.internal.WireSize.tag(51, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedForeignEnum.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number }).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 52, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedForeignEnum.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number }).let { kotlinx.rpc.protobuf.internal.WireSize.tag(52, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedStringPiece.isNotEmpty()) { - __result += repeatedStringPiece.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 54, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedStringPiece.isNotEmpty()) { + __result += repeatedStringPiece.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(54, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedCord.isNotEmpty()) { - __result += repeatedCord.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 55, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedCord.isNotEmpty()) { + __result += repeatedCord.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(55, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (packedInt32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 75, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedInt32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(75, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedInt64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 76, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedInt64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(76, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedUint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 77, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedUint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(77, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedUint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 78, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedUint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(78, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedSint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 79, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedSint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(79, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedSint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 80, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedSint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(80, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedFixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(packedFixed32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 81, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedFixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(packedFixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(81, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedFixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(packedFixed64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 82, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedFixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(packedFixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(82, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedSfixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(packedSfixed32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 83, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedSfixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(packedSfixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(83, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedSfixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(packedSfixed64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 84, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedSfixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(packedSfixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(84, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedFloat.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(packedFloat).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 85, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedFloat.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(packedFloat).let { kotlinx.rpc.protobuf.internal.WireSize.tag(85, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedDouble.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(packedDouble).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 86, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedDouble.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(packedDouble).let { kotlinx.rpc.protobuf.internal.WireSize.tag(86, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedBool.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 87, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedBool.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool).let { kotlinx.rpc.protobuf.internal.WireSize.tag(87, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedNestedEnum.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number }).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 88, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedNestedEnum.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number }).let { kotlinx.rpc.protobuf.internal.WireSize.tag(88, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (unpackedInt32.isNotEmpty()) { - __result += unpackedInt32.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.int32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 89, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedInt32.isNotEmpty()) { + __result += unpackedInt32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.int32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(89, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedInt64.isNotEmpty()) { - __result += unpackedInt64.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.int64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 90, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedInt64.isNotEmpty()) { + __result += unpackedInt64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.int64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(90, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedUint32.isNotEmpty()) { - __result += unpackedUint32.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.uInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 91, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedUint32.isNotEmpty()) { + __result += unpackedUint32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.uInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(91, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedUint64.isNotEmpty()) { - __result += unpackedUint64.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.uInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 92, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedUint64.isNotEmpty()) { + __result += unpackedUint64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.uInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(92, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedSint32.isNotEmpty()) { - __result += unpackedSint32.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.sInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 93, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedSint32.isNotEmpty()) { + __result += unpackedSint32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(93, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedSint64.isNotEmpty()) { - __result += unpackedSint64.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.sInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 94, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedSint64.isNotEmpty()) { + __result += unpackedSint64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(94, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedFixed32.isNotEmpty()) { - __result += unpackedFixed32.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.fixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 95, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) - } + if (unpackedFixed32.isNotEmpty()) { + __result += unpackedFixed32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.fixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(95, kotlinx.rpc.protobuf.internal.WireType.FIXED32) } } - if (unpackedFixed64.isNotEmpty()) { - __result += unpackedFixed64.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.fixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 96, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) - } + if (unpackedFixed64.isNotEmpty()) { + __result += unpackedFixed64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.fixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(96, kotlinx.rpc.protobuf.internal.WireType.FIXED64) } } - if (unpackedSfixed32.isNotEmpty()) { - __result += unpackedSfixed32.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.sFixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 97, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) - } + if (unpackedSfixed32.isNotEmpty()) { + __result += unpackedSfixed32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sFixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(97, kotlinx.rpc.protobuf.internal.WireType.FIXED32) } } - if (unpackedSfixed64.isNotEmpty()) { - __result += unpackedSfixed64.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.sFixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 98, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) - } + if (unpackedSfixed64.isNotEmpty()) { + __result += unpackedSfixed64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sFixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(98, kotlinx.rpc.protobuf.internal.WireType.FIXED64) } } - if (unpackedFloat.isNotEmpty()) { - __result += unpackedFloat.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.float(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 99, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) - } + if (unpackedFloat.isNotEmpty()) { + __result += unpackedFloat.sumOf { kotlinx.rpc.protobuf.internal.WireSize.float(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(99, kotlinx.rpc.protobuf.internal.WireType.FIXED32) } } - if (unpackedDouble.isNotEmpty()) { - __result += unpackedDouble.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.double(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 100, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) - } + if (unpackedDouble.isNotEmpty()) { + __result += unpackedDouble.sumOf { kotlinx.rpc.protobuf.internal.WireSize.double(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(100, kotlinx.rpc.protobuf.internal.WireType.FIXED64) } } - if (unpackedBool.isNotEmpty()) { - __result += unpackedBool.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.bool(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 101, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedBool.isNotEmpty()) { + __result += unpackedBool.sumOf { kotlinx.rpc.protobuf.internal.WireSize.bool(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(101, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedNestedEnum.isNotEmpty()) { - __result += unpackedNestedEnum.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.enum(it.number) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 102, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedNestedEnum.isNotEmpty()) { + __result += unpackedNestedEnum.sumOf { kotlinx.rpc.protobuf.internal.WireSize.enum(it.number) + kotlinx.rpc.protobuf.internal.WireSize.tag(102, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (mapInt32Int32.isNotEmpty()) { + if (mapInt32Int32.isNotEmpty()) { __result += mapInt32Int32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapInt64Int64.isNotEmpty()) { + if (mapInt64Int64.isNotEmpty()) { __result += mapInt64Int64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapUint32Uint32.isNotEmpty()) { + if (mapUint32Uint32.isNotEmpty()) { __result += mapUint32Uint32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapUint64Uint64.isNotEmpty()) { + if (mapUint64Uint64.isNotEmpty()) { __result += mapUint64Uint64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapSint32Sint32.isNotEmpty()) { + if (mapSint32Sint32.isNotEmpty()) { __result += mapSint32Sint32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapSint64Sint64.isNotEmpty()) { + if (mapSint64Sint64.isNotEmpty()) { __result += mapSint64Sint64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapFixed32Fixed32.isNotEmpty()) { + if (mapFixed32Fixed32.isNotEmpty()) { __result += mapFixed32Fixed32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapFixed64Fixed64.isNotEmpty()) { + if (mapFixed64Fixed64.isNotEmpty()) { __result += mapFixed64Fixed64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapSfixed32Sfixed32.isNotEmpty()) { + if (mapSfixed32Sfixed32.isNotEmpty()) { __result += mapSfixed32Sfixed32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapSfixed64Sfixed64.isNotEmpty()) { + if (mapSfixed64Sfixed64.isNotEmpty()) { __result += mapSfixed64Sfixed64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapInt32Float.isNotEmpty()) { + if (mapInt32Float.isNotEmpty()) { __result += mapInt32Float.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapInt32Double.isNotEmpty()) { + if (mapInt32Double.isNotEmpty()) { __result += mapInt32Double.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapBoolBool.isNotEmpty()) { + if (mapBoolBool.isNotEmpty()) { __result += mapBoolBool.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringString.isNotEmpty()) { + if (mapStringString.isNotEmpty()) { __result += mapStringString.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringBytes.isNotEmpty()) { + if (mapStringBytes.isNotEmpty()) { __result += mapStringBytes.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringNestedMessage.isNotEmpty()) { + if (mapStringNestedMessage.isNotEmpty()) { __result += mapStringNestedMessage.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringForeignMessage.isNotEmpty()) { + if (mapStringForeignMessage.isNotEmpty()) { __result += mapStringForeignMessage.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringNestedEnum.isNotEmpty()) { + if (mapStringNestedEnum.isNotEmpty()) { __result += mapStringNestedEnum.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringForeignEnum.isNotEmpty()) { + if (mapStringForeignEnum.isNotEmpty()) { __result += mapStringForeignEnum.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (presenceMask[3]) { - __result += optionalBoolWrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 201, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[3]) { + __result += optionalBoolWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(201, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[4]) { - __result += optionalInt32Wrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 202, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[4]) { + __result += optionalInt32Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(202, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[5]) { - __result += optionalInt64Wrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 203, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[5]) { + __result += optionalInt64Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(203, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[6]) { - __result += optionalUint32Wrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 204, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[6]) { + __result += optionalUint32Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(204, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[7]) { - __result += optionalUint64Wrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 205, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[7]) { + __result += optionalUint64Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(205, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[8]) { - __result += optionalFloatWrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 206, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[8]) { + __result += optionalFloatWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(206, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[9]) { - __result += optionalDoubleWrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 207, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[9]) { + __result += optionalDoubleWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(207, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[10]) { - __result += optionalStringWrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 208, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[10]) { + __result += optionalStringWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(208, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[11]) { - __result += optionalBytesWrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 209, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[11]) { + __result += optionalBytesWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(209, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedBoolWrapper.isNotEmpty()) { - __result += repeatedBoolWrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 211, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedBoolWrapper.isNotEmpty()) { + __result += repeatedBoolWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(211, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedInt32Wrapper.isNotEmpty()) { - __result += repeatedInt32Wrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 212, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedInt32Wrapper.isNotEmpty()) { + __result += repeatedInt32Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(212, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedInt64Wrapper.isNotEmpty()) { - __result += repeatedInt64Wrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 213, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedInt64Wrapper.isNotEmpty()) { + __result += repeatedInt64Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(213, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedUint32Wrapper.isNotEmpty()) { - __result += repeatedUint32Wrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 214, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedUint32Wrapper.isNotEmpty()) { + __result += repeatedUint32Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(214, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedUint64Wrapper.isNotEmpty()) { - __result += repeatedUint64Wrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 215, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedUint64Wrapper.isNotEmpty()) { + __result += repeatedUint64Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(215, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedFloatWrapper.isNotEmpty()) { - __result += repeatedFloatWrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 216, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedFloatWrapper.isNotEmpty()) { + __result += repeatedFloatWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(216, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedDoubleWrapper.isNotEmpty()) { - __result += repeatedDoubleWrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 217, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedDoubleWrapper.isNotEmpty()) { + __result += repeatedDoubleWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(217, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedStringWrapper.isNotEmpty()) { - __result += repeatedStringWrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 218, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedStringWrapper.isNotEmpty()) { + __result += repeatedStringWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(218, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedBytesWrapper.isNotEmpty()) { - __result += repeatedBytesWrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 219, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedBytesWrapper.isNotEmpty()) { + __result += repeatedBytesWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(219, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (presenceMask[12]) { - __result += optionalDuration.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 301, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[12]) { + __result += optionalDuration.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(301, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[13]) { - __result += optionalTimestamp.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 302, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[13]) { + __result += optionalTimestamp.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(302, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[14]) { - __result += optionalFieldMask.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 303, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[14]) { + __result += optionalFieldMask.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(303, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[15]) { - __result += optionalStruct.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 304, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[15]) { + __result += optionalStruct.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(304, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[16]) { - __result += optionalAny.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 305, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[16]) { + __result += optionalAny.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(305, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[17]) { - __result += optionalValue.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 306, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[17]) { + __result += optionalValue.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(306, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 307, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNullValue.number)) + if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(307, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNullValue.number)) } - if (repeatedDuration.isNotEmpty()) { - __result += repeatedDuration.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 311, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedDuration.isNotEmpty()) { + __result += repeatedDuration.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(311, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedTimestamp.isNotEmpty()) { - __result += repeatedTimestamp.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 312, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedTimestamp.isNotEmpty()) { + __result += repeatedTimestamp.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(312, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedFieldmask.isNotEmpty()) { - __result += repeatedFieldmask.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 313, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedFieldmask.isNotEmpty()) { + __result += repeatedFieldmask.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(313, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedStruct.isNotEmpty()) { - __result += repeatedStruct.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 324, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedStruct.isNotEmpty()) { + __result += repeatedStruct.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(324, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedAny.isNotEmpty()) { - __result += repeatedAny.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 315, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedAny.isNotEmpty()) { + __result += repeatedAny.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(315, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedValue.isNotEmpty()) { - __result += repeatedValue.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 316, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedValue.isNotEmpty()) { + __result += repeatedValue.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(316, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedListValue.isNotEmpty()) { - __result += repeatedListValue.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 317, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedListValue.isNotEmpty()) { + __result += repeatedListValue.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(317, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (fieldname1 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 401, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldname1)) + if (fieldname1 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(401, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldname1)) } - if (fieldName2 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 402, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName2)) + if (fieldName2 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(402, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName2)) } - if (FieldName3 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 403, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName3)) + if (FieldName3 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(403, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName3)) } - if (field_Name4_ != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 404, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name4_)) + if (field_Name4_ != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(404, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name4_)) } - if (field0name5 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 405, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field0name5)) + if (field0name5 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(405, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field0name5)) } - if (field_0Name6 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 406, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_0Name6)) + if (field_0Name6 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(406, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_0Name6)) } - if (fieldName7 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 407, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName7)) + if (fieldName7 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(407, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName7)) } - if (FieldName8 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 408, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName8)) + if (FieldName8 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(408, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName8)) } - if (field_Name9 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 409, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name9)) + if (field_Name9 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(409, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name9)) } - if (Field_Name10 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 410, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(Field_Name10)) + if (Field_Name10 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(410, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(Field_Name10)) } - if (FIELD_NAME11 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 411, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELD_NAME11)) + if (FIELD_NAME11 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(411, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELD_NAME11)) } - if (FIELDName12 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 412, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELDName12)) + if (FIELDName12 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(412, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELDName12)) } - if (_FieldName13 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 413, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(_FieldName13)) + if (_FieldName13 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(413, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(_FieldName13)) } - if (__FieldName14 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 414, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(__FieldName14)) + if (__FieldName14 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(414, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(__FieldName14)) } - if (field_Name15 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 415, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name15)) + if (field_Name15 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(415, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name15)) } - if (field__Name16 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 416, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field__Name16)) + if (field__Name16 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(416, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field__Name16)) } - if (fieldName17__ != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 417, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName17__)) + if (fieldName17__ != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(417, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName17__)) } - if (FieldName18__ != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 418, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName18__)) + if (FieldName18__ != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(418, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName18__)) } - oneofField?.also { - when (val value = it) { - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 111, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value.value)) + oneofField?.also { + when (val value = it) { + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(111, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value.value)) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { - __result += value.value.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 112, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { + __result += value.value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(112, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofString -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 113, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofString -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(113, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 114, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(114, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBool -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 115, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(value.value)) + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofBool -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(115, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(value.value)) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 116, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value.value)) + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(116, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value.value)) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 117, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.float(value.value)) + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(117, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(value.value)) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 118, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.double(value.value)) + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(118, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(value.value)) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 119, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(119, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) } - is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 120, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) + is com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(120, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) } } } @@ -4222,37 +3326,33 @@ private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3 } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal { - return this as? com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal { + return this as? com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (c != 0) { +fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (c != 0) { encoder.writeInt32(fieldNr = 1, value = c) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.c = decoder.readInt32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4263,44 +3363,37 @@ fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.Com } } -private fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal.computeSize(): Int { var __result = 0 - if (c != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(c)) + if (c != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(c)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.ForeignMessage.asInternal(): com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal { - return this as? com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.editions.proto3.ForeignMessage.asInternal(): com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal { + return this as? com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { +fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { // no fields to encode } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + when { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4311,37 +3404,33 @@ fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Intern } } -private fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal.computeSize(): Int { var __result = 0 return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3.asInternal(): com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal { - return this as? com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3.asInternal(): com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal { + return this as? com.google.protobuf_test_messages.editions.proto3.NullHypothesisProto3Internal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { +fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { // no fields to encode } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + when { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4352,63 +3441,54 @@ fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.Com } } -private fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal.computeSize(): Int { var __result = 0 return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.asInternal(): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal { - return this as? com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.asInternal(): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal { + return this as? com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3Internal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { corecursive.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (a != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (a != 0) { encoder.writeInt32(fieldNr = 1, value = a) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = corecursive.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.a = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { msg.corecursive = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal() } - decoder.readMessage( - msg.corecursive.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal::decodeWith - ) + decoder.readMessage(msg.corecursive.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal::decodeWith) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4419,69 +3499,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal.computeSize(): Int { var __result = 0 - if (a != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(a)) + if (a != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(a)) } - if (presenceMask[0]) { - __result += corecursive.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += corecursive.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal { - return this as? com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedMessage.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal { + return this as? com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeInt32(fieldNr = 1, value = key) } - if (value != 0) { + if (value != 0) { encoder.writeInt32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readInt32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4492,66 +3558,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) } - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0L) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0L) { encoder.writeInt64(fieldNr = 1, value = key) } - if (value != 0L) { + if (value != 0L) { encoder.writeInt64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readInt64() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4562,66 +3617,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int64(key)) + if (key != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(key)) } - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0u) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0u) { encoder.writeUInt32(fieldNr = 1, value = key) } - if (value != 0u) { + if (value != 0u) { encoder.writeUInt32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readUInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readUInt32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4632,66 +3676,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(key)) + if (key != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(key)) } - if (value != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value)) + if (value != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0uL) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0uL) { encoder.writeUInt64(fieldNr = 1, value = key) } - if (value != 0uL) { + if (value != 0uL) { encoder.writeUInt64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readUInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readUInt64() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4702,66 +3735,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(key)) + if (key != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(key)) } - if (value != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value)) + if (value != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeSInt32(fieldNr = 1, value = key) } - if (value != 0) { + if (value != 0) { encoder.writeSInt32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readSInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readSInt32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4772,66 +3794,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(key)) } - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0L) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0L) { encoder.writeSInt64(fieldNr = 1, value = key) } - if (value != 0L) { + if (value != 0L) { encoder.writeSInt64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readSInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readSInt64() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4842,66 +3853,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(key)) + if (key != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(key)) } - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0u) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0u) { encoder.writeFixed32(fieldNr = 1, value = key) } - if (value != 0u) { + if (value != 0u) { encoder.writeFixed32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.key = decoder.readFixed32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readFixed32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4912,66 +3912,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(key)) + if (key != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(key)) } - if (value != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(value)) + if (value != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0uL) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0uL) { encoder.writeFixed64(fieldNr = 1, value = key) } - if (value != 0uL) { + if (value != 0uL) { encoder.writeFixed64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.key = decoder.readFixed64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readFixed64() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4982,66 +3971,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(key)) + if (key != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(key)) } - if (value != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(value)) + if (value != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeSFixed32(fieldNr = 1, value = key) } - if (value != 0) { + if (value != 0) { encoder.writeSFixed32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.key = decoder.readSFixed32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readSFixed32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5052,66 +4030,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(key)) } - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0L) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0L) { encoder.writeSFixed64(fieldNr = 1, value = key) } - if (value != 0L) { + if (value != 0L) { encoder.writeSFixed64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.key = decoder.readSFixed64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readSFixed64() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5122,66 +4089,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(key)) + if (key != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(key)) } - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeInt32(fieldNr = 1, value = key) } - if (value != 0.0f) { + if (value != 0.0f) { encoder.writeFloat(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readFloat() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5192,66 +4148,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) } - if (value != 0.0f) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.float(value)) + if (value != 0.0f) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeInt32(fieldNr = 1, value = key) } - if (value != 0.0) { + if (value != 0.0) { encoder.writeDouble(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readDouble() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5262,66 +4207,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) } - if (value != 0.0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.double(value)) + if (value != 0.0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != false) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != false) { encoder.writeBool(fieldNr = 1, value = key) } - if (value != false) { + if (value != false) { encoder.writeBool(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readBool() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readBool() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5332,66 +4266,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.computeSize(): Int { var __result = 0 - if (key != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(key)) + if (key != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(key)) } - if (value != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(value)) + if (value != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value.isNotEmpty()) { + if (value.isNotEmpty()) { encoder.writeString(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readString() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5402,70 +4325,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value.isNotEmpty()) { + if (value.isNotEmpty()) { encoder.writeBytes(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readBytes() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5476,81 +4384,62 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { value.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = value.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { - msg.value = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { + msg.value = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } - decoder.readMessage( - msg.value.asInternal(), - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith - ) + decoder.readMessage(msg.value.asInternal(), com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5561,80 +4450,62 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[0]) { - __result += value.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { value.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = value.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { msg.value = com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal() } - decoder.readMessage( - msg.value.asInternal(), - com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal::decodeWith - ) + decoder.readMessage(msg.value.asInternal(), com.google.protobuf_test_messages.editions.proto3.ForeignMessageInternal::decodeWith) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5645,71 +4516,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[0]) { - __result += value.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { + if (value != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { encoder.writeEnum(fieldNr = 2, value = value.number) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.value = - com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.value = com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5720,68 +4575,55 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (value != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) + if (value != com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { + if (value != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { encoder.writeEnum(fieldNr = 2, value = value.number) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = com.google.protobuf_test_messages.editions.proto3.ForeignEnum.fromNumber(decoder.readEnum()) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5792,111 +4634,103 @@ fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal } } -private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (value != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) + if (value != com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.ForeignEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.ForeignEnum { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.editions.proto3.ForeignEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.ForeignEnum { + return when (number) { + 0 -> { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_FOO } - 1 -> { + 1 -> { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_BAR } - 2 -> { + 2 -> { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.FOREIGN_BAZ } - else -> { + else -> { com.google.protobuf_test_messages.editions.proto3.ForeignEnum.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum { + return when (number) { + 0 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.FOO } - 1 -> { + 1 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.BAR } - 2 -> { + 2 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.BAZ } - -1 -> { + -1 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.NEG } - else -> { + else -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.NestedEnum.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum { + return when (number) { + 0 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO } - 1 -> { + 1 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_BAR } - 2 -> { + 2 -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_BAZ } - else -> { + else -> { com.google.protobuf_test_messages.editions.proto3.TestAllTypesProto3.AliasedEnum.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool { + return when (number) { + 0 -> { com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool.kFalse } - 1 -> { + 1 -> { com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool.kTrue } - else -> { + else -> { com.google.protobuf_test_messages.editions.proto3.EnumOnlyProto3.Bool.UNRECOGNIZED(number) } } diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt index 4b3001d22..efd65c26c 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt @@ -3,52 +3,15 @@ */ @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) - package com.google.protobuf_test_messages.proto3 -import com.google.protobuf.kotlin.asInternal -import com.google.protobuf.kotlin.checkRequiredFields -import com.google.protobuf.kotlin.decodeWith -import com.google.protobuf.kotlin.encodeWith -import com.google.protobuf.kotlin.fromNumber -import kotlinx.rpc.internal.utils.ExperimentalRpcApi +import com.google.protobuf.kotlin.* +import kotlinx.rpc.internal.utils.* import kotlinx.rpc.protobuf.input.stream.asInputStream -import kotlinx.rpc.protobuf.internal.MsgFieldDelegate -import kotlinx.rpc.protobuf.internal.bool -import kotlinx.rpc.protobuf.internal.bytes -import kotlinx.rpc.protobuf.internal.double -import kotlinx.rpc.protobuf.internal.enum -import kotlinx.rpc.protobuf.internal.fixed32 -import kotlinx.rpc.protobuf.internal.fixed64 -import kotlinx.rpc.protobuf.internal.float -import kotlinx.rpc.protobuf.internal.int32 -import kotlinx.rpc.protobuf.internal.int64 -import kotlinx.rpc.protobuf.internal.packedBool -import kotlinx.rpc.protobuf.internal.packedDouble -import kotlinx.rpc.protobuf.internal.packedEnum -import kotlinx.rpc.protobuf.internal.packedFixed32 -import kotlinx.rpc.protobuf.internal.packedFixed64 -import kotlinx.rpc.protobuf.internal.packedFloat -import kotlinx.rpc.protobuf.internal.packedInt32 -import kotlinx.rpc.protobuf.internal.packedInt64 -import kotlinx.rpc.protobuf.internal.packedSFixed32 -import kotlinx.rpc.protobuf.internal.packedSFixed64 -import kotlinx.rpc.protobuf.internal.packedSInt32 -import kotlinx.rpc.protobuf.internal.packedSInt64 -import kotlinx.rpc.protobuf.internal.packedUInt32 -import kotlinx.rpc.protobuf.internal.packedUInt64 -import kotlinx.rpc.protobuf.internal.sFixed32 -import kotlinx.rpc.protobuf.internal.sFixed64 -import kotlinx.rpc.protobuf.internal.sInt32 -import kotlinx.rpc.protobuf.internal.sInt64 -import kotlinx.rpc.protobuf.internal.string -import kotlinx.rpc.protobuf.internal.tag -import kotlinx.rpc.protobuf.internal.uInt32 -import kotlinx.rpc.protobuf.internal.uInt64 - -class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.TestAllTypesProto3, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 18) { - private object PresenceIndices { +import kotlinx.rpc.protobuf.internal.* + +class TestAllTypesProto3Internal: com.google.protobuf_test_messages.proto3.TestAllTypesProto3, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 18) { + private object PresenceIndices { const val optionalNestedMessage: Int = 0 const val optionalForeignMessage: Int = 1 const val recursiveMessage: Int = 2 @@ -87,20 +50,14 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test override var optionalBool: Boolean by MsgFieldDelegate { false } override var optionalString: String by MsgFieldDelegate { "" } override var optionalBytes: ByteArray by MsgFieldDelegate { byteArrayOf() } - override var optionalNestedMessage: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate( - PresenceIndices.optionalNestedMessage - ) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } - override var optionalForeignMessage: com.google.protobuf_test_messages.proto3.ForeignMessage by MsgFieldDelegate( - PresenceIndices.optionalForeignMessage - ) { com.google.protobuf_test_messages.proto3.ForeignMessageInternal() } + override var optionalNestedMessage: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate(PresenceIndices.optionalNestedMessage) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } + override var optionalForeignMessage: com.google.protobuf_test_messages.proto3.ForeignMessage by MsgFieldDelegate(PresenceIndices.optionalForeignMessage) { com.google.protobuf_test_messages.proto3.ForeignMessageInternal() } override var optionalNestedEnum: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum by MsgFieldDelegate { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO } override var optionalForeignEnum: com.google.protobuf_test_messages.proto3.ForeignEnum by MsgFieldDelegate { com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO } override var optionalAliasedEnum: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum by MsgFieldDelegate { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO } override var optionalStringPiece: String by MsgFieldDelegate { "" } override var optionalCord: String by MsgFieldDelegate { "" } - override var recursiveMessage: com.google.protobuf_test_messages.proto3.TestAllTypesProto3 by MsgFieldDelegate( - PresenceIndices.recursiveMessage - ) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } + override var recursiveMessage: com.google.protobuf_test_messages.proto3.TestAllTypesProto3 by MsgFieldDelegate(PresenceIndices.recursiveMessage) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } override var repeatedInt32: List by MsgFieldDelegate { mutableListOf() } override var repeatedInt64: List by MsgFieldDelegate { mutableListOf() } override var repeatedUint32: List by MsgFieldDelegate { mutableListOf() } @@ -221,9 +178,8 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test override var FieldName18__: Int by MsgFieldDelegate { 0 } override var oneofField: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField? = null - class NestedMessageInternal : com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + class NestedMessageInternal: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val corecursive: Int = 0 } @@ -231,32 +187,25 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test override val _size: Int by lazy { computeSize() } override var a: Int by MsgFieldDelegate { 0 } - override var corecursive: com.google.protobuf_test_messages.proto3.TestAllTypesProto3 by MsgFieldDelegate( - PresenceIndices.corecursive - ) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } + override var corecursive: com.google.protobuf_test_messages.proto3.TestAllTypesProto3 by MsgFieldDelegate(PresenceIndices.corecursive) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : - kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { - val msg = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.decodeWith( - msg, - it - ) + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + val msg = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.decodeWith(msg, it) } msg.checkRequiredFields() return msg @@ -268,7 +217,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapInt32Int32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt32Int32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -279,7 +228,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapInt64Int64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt64Int64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -290,7 +239,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapUint32Uint32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapUint32Uint32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -301,7 +250,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapUint64Uint64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapUint64Uint64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -312,7 +261,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapSint32Sint32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSint32Sint32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -323,7 +272,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapSint64Sint64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSint64Sint64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -334,7 +283,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapFixed32Fixed32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapFixed32Fixed32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -345,7 +294,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapFixed64Fixed64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapFixed64Fixed64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -356,7 +305,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapSfixed32Sfixed32EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSfixed32Sfixed32EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -367,7 +316,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapSfixed64Sfixed64EntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapSfixed64Sfixed64EntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -378,7 +327,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapInt32FloatEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt32FloatEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -389,7 +338,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapInt32DoubleEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapInt32DoubleEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -400,7 +349,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapBoolBoolEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapBoolBoolEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -411,7 +360,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapStringStringEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringStringEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -422,7 +371,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapStringBytesEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringBytesEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -433,8 +382,8 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapStringNestedMessageEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + class MapStringNestedMessageEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val value: Int = 0 } @@ -442,16 +391,14 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test override val _size: Int by lazy { computeSize() } var key: String by MsgFieldDelegate { "" } - var value: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate( - PresenceIndices.value - ) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } + var value: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage by MsgFieldDelegate(PresenceIndices.value) { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } @kotlinx.rpc.internal.utils.InternalRpcApi companion object } - class MapStringForeignMessageEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { - private object PresenceIndices { + class MapStringForeignMessageEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 1) { + private object PresenceIndices { const val value: Int = 0 } @@ -465,7 +412,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapStringNestedEnumEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringNestedEnumEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -476,7 +423,7 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } - class MapStringForeignEnumEntryInternal : kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { + class MapStringForeignEnumEntryInternal: kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @@ -488,21 +435,21 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.proto3.TestAllTypesProto3): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.proto3.TestAllTypesProto3): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.TestAllTypesProto3 { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.TestAllTypesProto3 { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -515,29 +462,28 @@ class TestAllTypesProto3Internal : com.google.protobuf_test_messages.proto3.Test companion object } -class ForeignMessageInternal : com.google.protobuf_test_messages.proto3.ForeignMessage, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class ForeignMessageInternal: com.google.protobuf_test_messages.proto3.ForeignMessage, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } override var c: Int by MsgFieldDelegate { 0 } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.proto3.ForeignMessage): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.proto3.ForeignMessage): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.ForeignMessage { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.ForeignMessage { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.proto3.ForeignMessageInternal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.proto3.ForeignMessageInternal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -550,27 +496,26 @@ class ForeignMessageInternal : com.google.protobuf_test_messages.proto3.ForeignM companion object } -class NullHypothesisProto3Internal : com.google.protobuf_test_messages.proto3.NullHypothesisProto3, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class NullHypothesisProto3Internal: com.google.protobuf_test_messages.proto3.NullHypothesisProto3, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.proto3.NullHypothesisProto3): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.proto3.NullHypothesisProto3): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.NullHypothesisProto3 { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.NullHypothesisProto3 { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -583,27 +528,26 @@ class NullHypothesisProto3Internal : com.google.protobuf_test_messages.proto3.Nu companion object } -class EnumOnlyProto3Internal : com.google.protobuf_test_messages.proto3.EnumOnlyProto3, - kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { +class EnumOnlyProto3Internal: com.google.protobuf_test_messages.proto3.EnumOnlyProto3, kotlinx.rpc.protobuf.internal.InternalMessage(fieldsWithPresence = 0) { @kotlinx.rpc.internal.utils.InternalRpcApi override val _size: Int by lazy { computeSize() } @kotlinx.rpc.internal.utils.InternalRpcApi - object CODEC : kotlinx.rpc.grpc.codec.MessageCodec { - override fun encode(value: com.google.protobuf_test_messages.proto3.EnumOnlyProto3): kotlinx.rpc.protobuf.input.stream.InputStream { + object CODEC: kotlinx.rpc.grpc.codec.MessageCodec { + override fun encode(value: com.google.protobuf_test_messages.proto3.EnumOnlyProto3): kotlinx.rpc.protobuf.input.stream.InputStream { val buffer = kotlinx.io.Buffer() val encoder = kotlinx.rpc.protobuf.internal.WireEncoder(buffer) - kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformEncodeException { value.asInternal().encodeWith(encoder) } encoder.flush() return buffer.asInputStream() } - override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.EnumOnlyProto3 { - kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { + override fun decode(stream: kotlinx.rpc.protobuf.input.stream.InputStream): com.google.protobuf_test_messages.proto3.EnumOnlyProto3 { + kotlinx.rpc.protobuf.internal.WireDecoder(stream).use { val msg = com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal() - kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { + kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException { com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.decodeWith(msg, it) } msg.checkRequiredFields() @@ -616,1103 +560,1029 @@ class EnumOnlyProto3Internal : com.google.protobuf_test_messages.proto3.EnumOnly companion object } -operator fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.Companion.invoke(body: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.() -> Unit): com.google.protobuf_test_messages.proto3.TestAllTypesProto3 { +operator fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.Companion.invoke(body: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.() -> Unit): com.google.protobuf_test_messages.proto3.TestAllTypesProto3 { val msg = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.proto3.ForeignMessage.Companion.invoke(body: com.google.protobuf_test_messages.proto3.ForeignMessageInternal.() -> Unit): com.google.protobuf_test_messages.proto3.ForeignMessage { +operator fun com.google.protobuf_test_messages.proto3.ForeignMessage.Companion.invoke(body: com.google.protobuf_test_messages.proto3.ForeignMessageInternal.() -> Unit): com.google.protobuf_test_messages.proto3.ForeignMessage { val msg = com.google.protobuf_test_messages.proto3.ForeignMessageInternal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3.Companion.invoke(body: com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.() -> Unit): com.google.protobuf_test_messages.proto3.NullHypothesisProto3 { +operator fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3.Companion.invoke(body: com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.() -> Unit): com.google.protobuf_test_messages.proto3.NullHypothesisProto3 { val msg = com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Companion.invoke(body: com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.() -> Unit): com.google.protobuf_test_messages.proto3.EnumOnlyProto3 { +operator fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Companion.invoke(body: com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.() -> Unit): com.google.protobuf_test_messages.proto3.EnumOnlyProto3 { val msg = com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal().apply(body) msg.checkRequiredFields() return msg } -operator fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage.Companion.invoke(body: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.() -> Unit): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage { +operator fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage.Companion.invoke(body: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.() -> Unit): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage { val msg = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal().apply(body) msg.checkRequiredFields() return msg } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { optionalNestedMessage.asInternal().checkRequiredFields() } - if (presenceMask[1]) { + if (presenceMask[1]) { optionalForeignMessage.asInternal().checkRequiredFields() } - if (presenceMask[2]) { + if (presenceMask[2]) { recursiveMessage.asInternal().checkRequiredFields() } - if (presenceMask[3]) { + if (presenceMask[3]) { optionalBoolWrapper.asInternal().checkRequiredFields() } - if (presenceMask[4]) { + if (presenceMask[4]) { optionalInt32Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[5]) { + if (presenceMask[5]) { optionalInt64Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[6]) { + if (presenceMask[6]) { optionalUint32Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[7]) { + if (presenceMask[7]) { optionalUint64Wrapper.asInternal().checkRequiredFields() } - if (presenceMask[8]) { + if (presenceMask[8]) { optionalFloatWrapper.asInternal().checkRequiredFields() } - if (presenceMask[9]) { + if (presenceMask[9]) { optionalDoubleWrapper.asInternal().checkRequiredFields() } - if (presenceMask[10]) { + if (presenceMask[10]) { optionalStringWrapper.asInternal().checkRequiredFields() } - if (presenceMask[11]) { + if (presenceMask[11]) { optionalBytesWrapper.asInternal().checkRequiredFields() } - if (presenceMask[12]) { + if (presenceMask[12]) { optionalDuration.asInternal().checkRequiredFields() } - if (presenceMask[13]) { + if (presenceMask[13]) { optionalTimestamp.asInternal().checkRequiredFields() } - if (presenceMask[14]) { + if (presenceMask[14]) { optionalFieldMask.asInternal().checkRequiredFields() } - if (presenceMask[15]) { + if (presenceMask[15]) { optionalStruct.asInternal().checkRequiredFields() } - if (presenceMask[16]) { + if (presenceMask[16]) { optionalAny.asInternal().checkRequiredFields() } - if (presenceMask[17]) { + if (presenceMask[17]) { optionalValue.asInternal().checkRequiredFields() } - oneofField?.also { - when { - it is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { + oneofField?.also { + when { + it is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { it.value.asInternal().checkRequiredFields() } } } - repeatedNestedMessage.forEach { + repeatedNestedMessage.forEach { it.asInternal().checkRequiredFields() } - repeatedForeignMessage.forEach { + repeatedForeignMessage.forEach { it.asInternal().checkRequiredFields() } - repeatedBoolWrapper.forEach { + repeatedBoolWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedInt32Wrapper.forEach { + repeatedInt32Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedInt64Wrapper.forEach { + repeatedInt64Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedUint32Wrapper.forEach { + repeatedUint32Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedUint64Wrapper.forEach { + repeatedUint64Wrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedFloatWrapper.forEach { + repeatedFloatWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedDoubleWrapper.forEach { + repeatedDoubleWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedStringWrapper.forEach { + repeatedStringWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedBytesWrapper.forEach { + repeatedBytesWrapper.forEach { it.asInternal().checkRequiredFields() } - repeatedDuration.forEach { + repeatedDuration.forEach { it.asInternal().checkRequiredFields() } - repeatedTimestamp.forEach { + repeatedTimestamp.forEach { it.asInternal().checkRequiredFields() } - repeatedFieldmask.forEach { + repeatedFieldmask.forEach { it.asInternal().checkRequiredFields() } - repeatedStruct.forEach { + repeatedStruct.forEach { it.asInternal().checkRequiredFields() } - repeatedAny.forEach { + repeatedAny.forEach { it.asInternal().checkRequiredFields() } - repeatedValue.forEach { + repeatedValue.forEach { it.asInternal().checkRequiredFields() } - repeatedListValue.forEach { + repeatedListValue.forEach { it.asInternal().checkRequiredFields() } - mapStringNestedMessage.values.forEach { + mapStringNestedMessage.values.forEach { it.asInternal().checkRequiredFields() } - mapStringForeignMessage.values.forEach { + mapStringForeignMessage.values.forEach { it.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (optionalInt32 != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (optionalInt32 != 0) { encoder.writeInt32(fieldNr = 1, value = optionalInt32) } - if (optionalInt64 != 0L) { + if (optionalInt64 != 0L) { encoder.writeInt64(fieldNr = 2, value = optionalInt64) } - if (optionalUint32 != 0u) { + if (optionalUint32 != 0u) { encoder.writeUInt32(fieldNr = 3, value = optionalUint32) } - if (optionalUint64 != 0uL) { + if (optionalUint64 != 0uL) { encoder.writeUInt64(fieldNr = 4, value = optionalUint64) } - if (optionalSint32 != 0) { + if (optionalSint32 != 0) { encoder.writeSInt32(fieldNr = 5, value = optionalSint32) } - if (optionalSint64 != 0L) { + if (optionalSint64 != 0L) { encoder.writeSInt64(fieldNr = 6, value = optionalSint64) } - if (optionalFixed32 != 0u) { + if (optionalFixed32 != 0u) { encoder.writeFixed32(fieldNr = 7, value = optionalFixed32) } - if (optionalFixed64 != 0uL) { + if (optionalFixed64 != 0uL) { encoder.writeFixed64(fieldNr = 8, value = optionalFixed64) } - if (optionalSfixed32 != 0) { + if (optionalSfixed32 != 0) { encoder.writeSFixed32(fieldNr = 9, value = optionalSfixed32) } - if (optionalSfixed64 != 0L) { + if (optionalSfixed64 != 0L) { encoder.writeSFixed64(fieldNr = 10, value = optionalSfixed64) } - if (optionalFloat != 0.0f) { + if (optionalFloat != 0.0f) { encoder.writeFloat(fieldNr = 11, value = optionalFloat) } - if (optionalDouble != 0.0) { + if (optionalDouble != 0.0) { encoder.writeDouble(fieldNr = 12, value = optionalDouble) } - if (optionalBool != false) { + if (optionalBool != false) { encoder.writeBool(fieldNr = 13, value = optionalBool) } - if (optionalString.isNotEmpty()) { + if (optionalString.isNotEmpty()) { encoder.writeString(fieldNr = 14, value = optionalString) } - if (optionalBytes.isNotEmpty()) { + if (optionalBytes.isNotEmpty()) { encoder.writeBytes(fieldNr = 15, value = optionalBytes) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 18, value = optionalNestedMessage.asInternal()) { encodeWith(it) } } - if (presenceMask[1]) { + if (presenceMask[1]) { encoder.writeMessage(fieldNr = 19, value = optionalForeignMessage.asInternal()) { encodeWith(it) } } - if (optionalNestedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { + if (optionalNestedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { encoder.writeEnum(fieldNr = 21, value = optionalNestedEnum.number) } - if (optionalForeignEnum != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { + if (optionalForeignEnum != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { encoder.writeEnum(fieldNr = 22, value = optionalForeignEnum.number) } - if (optionalAliasedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { + if (optionalAliasedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { encoder.writeEnum(fieldNr = 23, value = optionalAliasedEnum.number) } - if (optionalStringPiece.isNotEmpty()) { + if (optionalStringPiece.isNotEmpty()) { encoder.writeString(fieldNr = 24, value = optionalStringPiece) } - if (optionalCord.isNotEmpty()) { + if (optionalCord.isNotEmpty()) { encoder.writeString(fieldNr = 25, value = optionalCord) } - if (presenceMask[2]) { + if (presenceMask[2]) { encoder.writeMessage(fieldNr = 27, value = recursiveMessage.asInternal()) { encodeWith(it) } } - if (repeatedInt32.isNotEmpty()) { - encoder.writePackedInt32( - fieldNr = 31, - value = repeatedInt32, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32) - ) + if (repeatedInt32.isNotEmpty()) { + encoder.writePackedInt32(fieldNr = 31, value = repeatedInt32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32)) } - if (repeatedInt64.isNotEmpty()) { - encoder.writePackedInt64( - fieldNr = 32, - value = repeatedInt64, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64) - ) + if (repeatedInt64.isNotEmpty()) { + encoder.writePackedInt64(fieldNr = 32, value = repeatedInt64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64)) } - if (repeatedUint32.isNotEmpty()) { - encoder.writePackedUInt32( - fieldNr = 33, - value = repeatedUint32, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32) - ) + if (repeatedUint32.isNotEmpty()) { + encoder.writePackedUInt32(fieldNr = 33, value = repeatedUint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32)) } - if (repeatedUint64.isNotEmpty()) { - encoder.writePackedUInt64( - fieldNr = 34, - value = repeatedUint64, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64) - ) + if (repeatedUint64.isNotEmpty()) { + encoder.writePackedUInt64(fieldNr = 34, value = repeatedUint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64)) } - if (repeatedSint32.isNotEmpty()) { - encoder.writePackedSInt32( - fieldNr = 35, - value = repeatedSint32, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32) - ) + if (repeatedSint32.isNotEmpty()) { + encoder.writePackedSInt32(fieldNr = 35, value = repeatedSint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32)) } - if (repeatedSint64.isNotEmpty()) { - encoder.writePackedSInt64( - fieldNr = 36, - value = repeatedSint64, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64) - ) + if (repeatedSint64.isNotEmpty()) { + encoder.writePackedSInt64(fieldNr = 36, value = repeatedSint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64)) } - if (repeatedFixed32.isNotEmpty()) { + if (repeatedFixed32.isNotEmpty()) { encoder.writePackedFixed32(fieldNr = 37, value = repeatedFixed32) } - if (repeatedFixed64.isNotEmpty()) { + if (repeatedFixed64.isNotEmpty()) { encoder.writePackedFixed64(fieldNr = 38, value = repeatedFixed64) } - if (repeatedSfixed32.isNotEmpty()) { + if (repeatedSfixed32.isNotEmpty()) { encoder.writePackedSFixed32(fieldNr = 39, value = repeatedSfixed32) } - if (repeatedSfixed64.isNotEmpty()) { + if (repeatedSfixed64.isNotEmpty()) { encoder.writePackedSFixed64(fieldNr = 40, value = repeatedSfixed64) } - if (repeatedFloat.isNotEmpty()) { + if (repeatedFloat.isNotEmpty()) { encoder.writePackedFloat(fieldNr = 41, value = repeatedFloat) } - if (repeatedDouble.isNotEmpty()) { + if (repeatedDouble.isNotEmpty()) { encoder.writePackedDouble(fieldNr = 42, value = repeatedDouble) } - if (repeatedBool.isNotEmpty()) { - encoder.writePackedBool( - fieldNr = 43, - value = repeatedBool, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool) - ) + if (repeatedBool.isNotEmpty()) { + encoder.writePackedBool(fieldNr = 43, value = repeatedBool, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool)) } - if (repeatedString.isNotEmpty()) { - repeatedString.forEach { + if (repeatedString.isNotEmpty()) { + repeatedString.forEach { encoder.writeString(44, it) } } - if (repeatedBytes.isNotEmpty()) { - repeatedBytes.forEach { + if (repeatedBytes.isNotEmpty()) { + repeatedBytes.forEach { encoder.writeBytes(45, it) } } - if (repeatedNestedMessage.isNotEmpty()) { - repeatedNestedMessage.forEach { + if (repeatedNestedMessage.isNotEmpty()) { + repeatedNestedMessage.forEach { encoder.writeMessage(fieldNr = 48, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedForeignMessage.isNotEmpty()) { - repeatedForeignMessage.forEach { + if (repeatedForeignMessage.isNotEmpty()) { + repeatedForeignMessage.forEach { encoder.writeMessage(fieldNr = 49, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedNestedEnum.isNotEmpty()) { - encoder.writePackedEnum( - fieldNr = 51, - value = repeatedNestedEnum.map { it.number }, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number }) - ) + if (repeatedNestedEnum.isNotEmpty()) { + encoder.writePackedEnum(fieldNr = 51, value = repeatedNestedEnum.map { it.number }, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number })) } - if (repeatedForeignEnum.isNotEmpty()) { - encoder.writePackedEnum( - fieldNr = 52, - value = repeatedForeignEnum.map { it.number }, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number }) - ) + if (repeatedForeignEnum.isNotEmpty()) { + encoder.writePackedEnum(fieldNr = 52, value = repeatedForeignEnum.map { it.number }, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number })) } - if (repeatedStringPiece.isNotEmpty()) { - repeatedStringPiece.forEach { + if (repeatedStringPiece.isNotEmpty()) { + repeatedStringPiece.forEach { encoder.writeString(54, it) } } - if (repeatedCord.isNotEmpty()) { - repeatedCord.forEach { + if (repeatedCord.isNotEmpty()) { + repeatedCord.forEach { encoder.writeString(55, it) } } - if (packedInt32.isNotEmpty()) { - encoder.writePackedInt32( - fieldNr = 75, - value = packedInt32, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32) - ) + if (packedInt32.isNotEmpty()) { + encoder.writePackedInt32(fieldNr = 75, value = packedInt32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32)) } - if (packedInt64.isNotEmpty()) { - encoder.writePackedInt64( - fieldNr = 76, - value = packedInt64, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64) - ) + if (packedInt64.isNotEmpty()) { + encoder.writePackedInt64(fieldNr = 76, value = packedInt64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64)) } - if (packedUint32.isNotEmpty()) { - encoder.writePackedUInt32( - fieldNr = 77, - value = packedUint32, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32) - ) + if (packedUint32.isNotEmpty()) { + encoder.writePackedUInt32(fieldNr = 77, value = packedUint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32)) } - if (packedUint64.isNotEmpty()) { - encoder.writePackedUInt64( - fieldNr = 78, - value = packedUint64, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64) - ) + if (packedUint64.isNotEmpty()) { + encoder.writePackedUInt64(fieldNr = 78, value = packedUint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64)) } - if (packedSint32.isNotEmpty()) { - encoder.writePackedSInt32( - fieldNr = 79, - value = packedSint32, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32) - ) + if (packedSint32.isNotEmpty()) { + encoder.writePackedSInt32(fieldNr = 79, value = packedSint32, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32)) } - if (packedSint64.isNotEmpty()) { - encoder.writePackedSInt64( - fieldNr = 80, - value = packedSint64, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64) - ) + if (packedSint64.isNotEmpty()) { + encoder.writePackedSInt64(fieldNr = 80, value = packedSint64, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64)) } - if (packedFixed32.isNotEmpty()) { + if (packedFixed32.isNotEmpty()) { encoder.writePackedFixed32(fieldNr = 81, value = packedFixed32) } - if (packedFixed64.isNotEmpty()) { + if (packedFixed64.isNotEmpty()) { encoder.writePackedFixed64(fieldNr = 82, value = packedFixed64) } - if (packedSfixed32.isNotEmpty()) { + if (packedSfixed32.isNotEmpty()) { encoder.writePackedSFixed32(fieldNr = 83, value = packedSfixed32) } - if (packedSfixed64.isNotEmpty()) { + if (packedSfixed64.isNotEmpty()) { encoder.writePackedSFixed64(fieldNr = 84, value = packedSfixed64) } - if (packedFloat.isNotEmpty()) { + if (packedFloat.isNotEmpty()) { encoder.writePackedFloat(fieldNr = 85, value = packedFloat) } - if (packedDouble.isNotEmpty()) { + if (packedDouble.isNotEmpty()) { encoder.writePackedDouble(fieldNr = 86, value = packedDouble) } - if (packedBool.isNotEmpty()) { - encoder.writePackedBool( - fieldNr = 87, - value = packedBool, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool) - ) + if (packedBool.isNotEmpty()) { + encoder.writePackedBool(fieldNr = 87, value = packedBool, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool)) } - if (packedNestedEnum.isNotEmpty()) { - encoder.writePackedEnum( - fieldNr = 88, - value = packedNestedEnum.map { it.number }, - fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number }) - ) + if (packedNestedEnum.isNotEmpty()) { + encoder.writePackedEnum(fieldNr = 88, value = packedNestedEnum.map { it.number }, fieldSize = kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number })) } - if (unpackedInt32.isNotEmpty()) { - unpackedInt32.forEach { + if (unpackedInt32.isNotEmpty()) { + unpackedInt32.forEach { encoder.writeInt32(89, it) } } - if (unpackedInt64.isNotEmpty()) { - unpackedInt64.forEach { + if (unpackedInt64.isNotEmpty()) { + unpackedInt64.forEach { encoder.writeInt64(90, it) } } - if (unpackedUint32.isNotEmpty()) { - unpackedUint32.forEach { + if (unpackedUint32.isNotEmpty()) { + unpackedUint32.forEach { encoder.writeUInt32(91, it) } } - if (unpackedUint64.isNotEmpty()) { - unpackedUint64.forEach { + if (unpackedUint64.isNotEmpty()) { + unpackedUint64.forEach { encoder.writeUInt64(92, it) } } - if (unpackedSint32.isNotEmpty()) { - unpackedSint32.forEach { + if (unpackedSint32.isNotEmpty()) { + unpackedSint32.forEach { encoder.writeSInt32(93, it) } } - if (unpackedSint64.isNotEmpty()) { - unpackedSint64.forEach { + if (unpackedSint64.isNotEmpty()) { + unpackedSint64.forEach { encoder.writeSInt64(94, it) } } - if (unpackedFixed32.isNotEmpty()) { - unpackedFixed32.forEach { + if (unpackedFixed32.isNotEmpty()) { + unpackedFixed32.forEach { encoder.writeFixed32(95, it) } } - if (unpackedFixed64.isNotEmpty()) { - unpackedFixed64.forEach { + if (unpackedFixed64.isNotEmpty()) { + unpackedFixed64.forEach { encoder.writeFixed64(96, it) } } - if (unpackedSfixed32.isNotEmpty()) { - unpackedSfixed32.forEach { + if (unpackedSfixed32.isNotEmpty()) { + unpackedSfixed32.forEach { encoder.writeSFixed32(97, it) } } - if (unpackedSfixed64.isNotEmpty()) { - unpackedSfixed64.forEach { + if (unpackedSfixed64.isNotEmpty()) { + unpackedSfixed64.forEach { encoder.writeSFixed64(98, it) } } - if (unpackedFloat.isNotEmpty()) { - unpackedFloat.forEach { + if (unpackedFloat.isNotEmpty()) { + unpackedFloat.forEach { encoder.writeFloat(99, it) } } - if (unpackedDouble.isNotEmpty()) { - unpackedDouble.forEach { + if (unpackedDouble.isNotEmpty()) { + unpackedDouble.forEach { encoder.writeDouble(100, it) } } - if (unpackedBool.isNotEmpty()) { - unpackedBool.forEach { + if (unpackedBool.isNotEmpty()) { + unpackedBool.forEach { encoder.writeBool(101, it) } } - if (unpackedNestedEnum.isNotEmpty()) { - unpackedNestedEnum.forEach { + if (unpackedNestedEnum.isNotEmpty()) { + unpackedNestedEnum.forEach { encoder.writeEnum(102, it.number) } } - if (mapInt32Int32.isNotEmpty()) { + if (mapInt32Int32.isNotEmpty()) { mapInt32Int32.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 56, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 56, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapInt64Int64.isNotEmpty()) { + if (mapInt64Int64.isNotEmpty()) { mapInt64Int64.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 57, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 57, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapUint32Uint32.isNotEmpty()) { + if (mapUint32Uint32.isNotEmpty()) { mapUint32Uint32.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 58, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 58, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapUint64Uint64.isNotEmpty()) { + if (mapUint64Uint64.isNotEmpty()) { mapUint64Uint64.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 59, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 59, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSint32Sint32.isNotEmpty()) { + if (mapSint32Sint32.isNotEmpty()) { mapSint32Sint32.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 60, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 60, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSint64Sint64.isNotEmpty()) { + if (mapSint64Sint64.isNotEmpty()) { mapSint64Sint64.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 61, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 61, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapFixed32Fixed32.isNotEmpty()) { + if (mapFixed32Fixed32.isNotEmpty()) { mapFixed32Fixed32.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 62, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 62, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapFixed64Fixed64.isNotEmpty()) { + if (mapFixed64Fixed64.isNotEmpty()) { mapFixed64Fixed64.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 63, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 63, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSfixed32Sfixed32.isNotEmpty()) { + if (mapSfixed32Sfixed32.isNotEmpty()) { mapSfixed32Sfixed32.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 64, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 64, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapSfixed64Sfixed64.isNotEmpty()) { + if (mapSfixed64Sfixed64.isNotEmpty()) { mapSfixed64Sfixed64.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 65, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 65, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapInt32Float.isNotEmpty()) { + if (mapInt32Float.isNotEmpty()) { mapInt32Float.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 66, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 66, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapInt32Double.isNotEmpty()) { + if (mapInt32Double.isNotEmpty()) { mapInt32Double.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 67, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 67, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapBoolBool.isNotEmpty()) { + if (mapBoolBool.isNotEmpty()) { mapBoolBool.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 68, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 68, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringString.isNotEmpty()) { + if (mapStringString.isNotEmpty()) { mapStringString.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 69, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 69, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringBytes.isNotEmpty()) { + if (mapStringBytes.isNotEmpty()) { mapStringBytes.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal().apply { key = kEntry.key value = kEntry.value } - .also { entry -> - encoder.writeMessage(fieldNr = 70, value = entry.asInternal()) { encodeWith(it) } - } + .also { entry -> + encoder.writeMessage(fieldNr = 70, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringNestedMessage.isNotEmpty()) { + if (mapStringNestedMessage.isNotEmpty()) { mapStringNestedMessage.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 71, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 71, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringForeignMessage.isNotEmpty()) { + if (mapStringForeignMessage.isNotEmpty()) { mapStringForeignMessage.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 72, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 72, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringNestedEnum.isNotEmpty()) { + if (mapStringNestedEnum.isNotEmpty()) { mapStringNestedEnum.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 73, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 73, value = entry.asInternal()) { encodeWith(it) } + } } } - if (mapStringForeignEnum.isNotEmpty()) { + if (mapStringForeignEnum.isNotEmpty()) { mapStringForeignEnum.forEach { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - .also { entry -> - encoder.writeMessage(fieldNr = 74, value = entry.asInternal()) { encodeWith(it) } - } + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + .also { entry -> + encoder.writeMessage(fieldNr = 74, value = entry.asInternal()) { encodeWith(it) } + } } } - if (presenceMask[3]) { + if (presenceMask[3]) { encoder.writeMessage(fieldNr = 201, value = optionalBoolWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[4]) { + if (presenceMask[4]) { encoder.writeMessage(fieldNr = 202, value = optionalInt32Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[5]) { + if (presenceMask[5]) { encoder.writeMessage(fieldNr = 203, value = optionalInt64Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[6]) { + if (presenceMask[6]) { encoder.writeMessage(fieldNr = 204, value = optionalUint32Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[7]) { + if (presenceMask[7]) { encoder.writeMessage(fieldNr = 205, value = optionalUint64Wrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[8]) { + if (presenceMask[8]) { encoder.writeMessage(fieldNr = 206, value = optionalFloatWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[9]) { + if (presenceMask[9]) { encoder.writeMessage(fieldNr = 207, value = optionalDoubleWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[10]) { + if (presenceMask[10]) { encoder.writeMessage(fieldNr = 208, value = optionalStringWrapper.asInternal()) { encodeWith(it) } } - if (presenceMask[11]) { + if (presenceMask[11]) { encoder.writeMessage(fieldNr = 209, value = optionalBytesWrapper.asInternal()) { encodeWith(it) } } - if (repeatedBoolWrapper.isNotEmpty()) { - repeatedBoolWrapper.forEach { + if (repeatedBoolWrapper.isNotEmpty()) { + repeatedBoolWrapper.forEach { encoder.writeMessage(fieldNr = 211, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedInt32Wrapper.isNotEmpty()) { - repeatedInt32Wrapper.forEach { + if (repeatedInt32Wrapper.isNotEmpty()) { + repeatedInt32Wrapper.forEach { encoder.writeMessage(fieldNr = 212, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedInt64Wrapper.isNotEmpty()) { - repeatedInt64Wrapper.forEach { + if (repeatedInt64Wrapper.isNotEmpty()) { + repeatedInt64Wrapper.forEach { encoder.writeMessage(fieldNr = 213, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedUint32Wrapper.isNotEmpty()) { - repeatedUint32Wrapper.forEach { + if (repeatedUint32Wrapper.isNotEmpty()) { + repeatedUint32Wrapper.forEach { encoder.writeMessage(fieldNr = 214, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedUint64Wrapper.isNotEmpty()) { - repeatedUint64Wrapper.forEach { + if (repeatedUint64Wrapper.isNotEmpty()) { + repeatedUint64Wrapper.forEach { encoder.writeMessage(fieldNr = 215, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedFloatWrapper.isNotEmpty()) { - repeatedFloatWrapper.forEach { + if (repeatedFloatWrapper.isNotEmpty()) { + repeatedFloatWrapper.forEach { encoder.writeMessage(fieldNr = 216, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedDoubleWrapper.isNotEmpty()) { - repeatedDoubleWrapper.forEach { + if (repeatedDoubleWrapper.isNotEmpty()) { + repeatedDoubleWrapper.forEach { encoder.writeMessage(fieldNr = 217, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedStringWrapper.isNotEmpty()) { - repeatedStringWrapper.forEach { + if (repeatedStringWrapper.isNotEmpty()) { + repeatedStringWrapper.forEach { encoder.writeMessage(fieldNr = 218, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedBytesWrapper.isNotEmpty()) { - repeatedBytesWrapper.forEach { + if (repeatedBytesWrapper.isNotEmpty()) { + repeatedBytesWrapper.forEach { encoder.writeMessage(fieldNr = 219, value = it.asInternal()) { encodeWith(it) } } } - if (presenceMask[12]) { + if (presenceMask[12]) { encoder.writeMessage(fieldNr = 301, value = optionalDuration.asInternal()) { encodeWith(it) } } - if (presenceMask[13]) { + if (presenceMask[13]) { encoder.writeMessage(fieldNr = 302, value = optionalTimestamp.asInternal()) { encodeWith(it) } } - if (presenceMask[14]) { + if (presenceMask[14]) { encoder.writeMessage(fieldNr = 303, value = optionalFieldMask.asInternal()) { encodeWith(it) } } - if (presenceMask[15]) { + if (presenceMask[15]) { encoder.writeMessage(fieldNr = 304, value = optionalStruct.asInternal()) { encodeWith(it) } } - if (presenceMask[16]) { + if (presenceMask[16]) { encoder.writeMessage(fieldNr = 305, value = optionalAny.asInternal()) { encodeWith(it) } } - if (presenceMask[17]) { + if (presenceMask[17]) { encoder.writeMessage(fieldNr = 306, value = optionalValue.asInternal()) { encodeWith(it) } } - if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { + if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { encoder.writeEnum(fieldNr = 307, value = optionalNullValue.number) } - if (repeatedDuration.isNotEmpty()) { - repeatedDuration.forEach { + if (repeatedDuration.isNotEmpty()) { + repeatedDuration.forEach { encoder.writeMessage(fieldNr = 311, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedTimestamp.isNotEmpty()) { - repeatedTimestamp.forEach { + if (repeatedTimestamp.isNotEmpty()) { + repeatedTimestamp.forEach { encoder.writeMessage(fieldNr = 312, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedFieldmask.isNotEmpty()) { - repeatedFieldmask.forEach { + if (repeatedFieldmask.isNotEmpty()) { + repeatedFieldmask.forEach { encoder.writeMessage(fieldNr = 313, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedStruct.isNotEmpty()) { - repeatedStruct.forEach { + if (repeatedStruct.isNotEmpty()) { + repeatedStruct.forEach { encoder.writeMessage(fieldNr = 324, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedAny.isNotEmpty()) { - repeatedAny.forEach { + if (repeatedAny.isNotEmpty()) { + repeatedAny.forEach { encoder.writeMessage(fieldNr = 315, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedValue.isNotEmpty()) { - repeatedValue.forEach { + if (repeatedValue.isNotEmpty()) { + repeatedValue.forEach { encoder.writeMessage(fieldNr = 316, value = it.asInternal()) { encodeWith(it) } } } - if (repeatedListValue.isNotEmpty()) { - repeatedListValue.forEach { + if (repeatedListValue.isNotEmpty()) { + repeatedListValue.forEach { encoder.writeMessage(fieldNr = 317, value = it.asInternal()) { encodeWith(it) } } } - if (fieldname1 != 0) { + if (fieldname1 != 0) { encoder.writeInt32(fieldNr = 401, value = fieldname1) } - if (fieldName2 != 0) { + if (fieldName2 != 0) { encoder.writeInt32(fieldNr = 402, value = fieldName2) } - if (FieldName3 != 0) { + if (FieldName3 != 0) { encoder.writeInt32(fieldNr = 403, value = FieldName3) } - if (field_Name4_ != 0) { + if (field_Name4_ != 0) { encoder.writeInt32(fieldNr = 404, value = field_Name4_) } - if (field0name5 != 0) { + if (field0name5 != 0) { encoder.writeInt32(fieldNr = 405, value = field0name5) } - if (field_0Name6 != 0) { + if (field_0Name6 != 0) { encoder.writeInt32(fieldNr = 406, value = field_0Name6) } - if (fieldName7 != 0) { + if (fieldName7 != 0) { encoder.writeInt32(fieldNr = 407, value = fieldName7) } - if (FieldName8 != 0) { + if (FieldName8 != 0) { encoder.writeInt32(fieldNr = 408, value = FieldName8) } - if (field_Name9 != 0) { + if (field_Name9 != 0) { encoder.writeInt32(fieldNr = 409, value = field_Name9) } - if (Field_Name10 != 0) { + if (Field_Name10 != 0) { encoder.writeInt32(fieldNr = 410, value = Field_Name10) } - if (FIELD_NAME11 != 0) { + if (FIELD_NAME11 != 0) { encoder.writeInt32(fieldNr = 411, value = FIELD_NAME11) } - if (FIELDName12 != 0) { + if (FIELDName12 != 0) { encoder.writeInt32(fieldNr = 412, value = FIELDName12) } - if (_FieldName13 != 0) { + if (_FieldName13 != 0) { encoder.writeInt32(fieldNr = 413, value = _FieldName13) } - if (__FieldName14 != 0) { + if (__FieldName14 != 0) { encoder.writeInt32(fieldNr = 414, value = __FieldName14) } - if (field_Name15 != 0) { + if (field_Name15 != 0) { encoder.writeInt32(fieldNr = 415, value = field_Name15) } - if (field__Name16 != 0) { + if (field__Name16 != 0) { encoder.writeInt32(fieldNr = 416, value = field__Name16) } - if (fieldName17__ != 0) { + if (fieldName17__ != 0) { encoder.writeInt32(fieldNr = 417, value = fieldName17__) } - if (FieldName18__ != 0) { + if (FieldName18__ != 0) { encoder.writeInt32(fieldNr = 418, value = FieldName18__) } - oneofField?.also { - when (val value = it) { - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { + oneofField?.also { + when (val value = it) { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { encoder.writeUInt32(fieldNr = 111, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { encoder.writeMessage(fieldNr = 112, value = value.value.asInternal()) { encodeWith(it) } } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofString -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofString -> { encoder.writeString(fieldNr = 113, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { encoder.writeBytes(fieldNr = 114, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBool -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBool -> { encoder.writeBool(fieldNr = 115, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { encoder.writeUInt64(fieldNr = 116, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { encoder.writeFloat(fieldNr = 117, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { encoder.writeDouble(fieldNr = 118, value = value.value) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { encoder.writeEnum(fieldNr = 119, value = value.value.number) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { encoder.writeEnum(fieldNr = 120, value = value.value.number) } } @@ -1720,1149 +1590,1004 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.encodeWi } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalInt32 = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalInt64 = decoder.readInt64() } - tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 3 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalUint32 = decoder.readUInt32() } - tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 4 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalUint64 = decoder.readUInt64() } - tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 5 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalSint32 = decoder.readSInt32() } - tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 6 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalSint64 = decoder.readSInt64() } - tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 7 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.optionalFixed32 = decoder.readFixed32() } - tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 8 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.optionalFixed64 = decoder.readFixed64() } - tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 9 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.optionalSfixed32 = decoder.readSFixed32() } - tag.fieldNr == 10 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 10 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.optionalSfixed64 = decoder.readSFixed64() } - tag.fieldNr == 11 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 11 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.optionalFloat = decoder.readFloat() } - tag.fieldNr == 12 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 12 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.optionalDouble = decoder.readDouble() } - tag.fieldNr == 13 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 13 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalBool = decoder.readBool() } - tag.fieldNr == 14 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 14 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalString = decoder.readString() } - tag.fieldNr == 15 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 15 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalBytes = decoder.readBytes() } - tag.fieldNr == 18 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { - msg.optionalNestedMessage = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + tag.fieldNr == 18 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { + msg.optionalNestedMessage = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } - decoder.readMessage( - msg.optionalNestedMessage.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith - ) + decoder.readMessage(msg.optionalNestedMessage.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) } - tag.fieldNr == 19 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[1]) { + tag.fieldNr == 19 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[1]) { msg.optionalForeignMessage = com.google.protobuf_test_messages.proto3.ForeignMessageInternal() } - decoder.readMessage( - msg.optionalForeignMessage.asInternal(), - com.google.protobuf_test_messages.proto3.ForeignMessageInternal::decodeWith - ) + decoder.readMessage(msg.optionalForeignMessage.asInternal(), com.google.protobuf_test_messages.proto3.ForeignMessageInternal::decodeWith) } - tag.fieldNr == 21 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.optionalNestedEnum = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 21 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.optionalNestedEnum = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) } - tag.fieldNr == 22 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.optionalForeignEnum = - com.google.protobuf_test_messages.proto3.ForeignEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 22 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.optionalForeignEnum = com.google.protobuf_test_messages.proto3.ForeignEnum.fromNumber(decoder.readEnum()) } - tag.fieldNr == 23 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.optionalAliasedEnum = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 23 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.optionalAliasedEnum = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.fromNumber(decoder.readEnum()) } - tag.fieldNr == 24 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 24 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalStringPiece = decoder.readString() } - tag.fieldNr == 25 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 25 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.optionalCord = decoder.readString() } - tag.fieldNr == 27 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[2]) { + tag.fieldNr == 27 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[2]) { msg.recursiveMessage = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } - decoder.readMessage( - msg.recursiveMessage.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal::decodeWith - ) + decoder.readMessage(msg.recursiveMessage.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal::decodeWith) } - tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedInt32 += decoder.readPackedInt32() } - tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 31 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt32() (msg.repeatedInt32 as MutableList).add(elem) } - tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedInt64 += decoder.readPackedInt64() } - tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 32 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt64() (msg.repeatedInt64 as MutableList).add(elem) } - tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedUint32 += decoder.readPackedUInt32() } - tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 33 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt32() (msg.repeatedUint32 as MutableList).add(elem) } - tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedUint64 += decoder.readPackedUInt64() } - tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 34 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt64() (msg.repeatedUint64 as MutableList).add(elem) } - tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSint32 += decoder.readPackedSInt32() } - tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 35 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt32() (msg.repeatedSint32 as MutableList).add(elem) } - tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSint64 += decoder.readPackedSInt64() } - tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 36 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt64() (msg.repeatedSint64 as MutableList).add(elem) } - tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedFixed32 += decoder.readPackedFixed32() } - tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 37 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFixed32() (msg.repeatedFixed32 as MutableList).add(elem) } - tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedFixed64 += decoder.readPackedFixed64() } - tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 38 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readFixed64() (msg.repeatedFixed64 as MutableList).add(elem) } - tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSfixed32 += decoder.readPackedSFixed32() } - tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 39 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readSFixed32() (msg.repeatedSfixed32 as MutableList).add(elem) } - tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedSfixed64 += decoder.readPackedSFixed64() } - tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 40 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readSFixed64() (msg.repeatedSfixed64 as MutableList).add(elem) } - tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedFloat += decoder.readPackedFloat() } - tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 41 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFloat() (msg.repeatedFloat as MutableList).add(elem) } - tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedDouble += decoder.readPackedDouble() } - tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 42 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readDouble() (msg.repeatedDouble as MutableList).add(elem) } - tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.repeatedBool += decoder.readPackedBool() } - tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 43 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readBool() (msg.repeatedBool as MutableList).add(elem) } - tag.fieldNr == 44 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 44 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.repeatedString as MutableList).add(elem) } - tag.fieldNr == 45 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 45 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readBytes() (msg.repeatedBytes as MutableList).add(elem) } - tag.fieldNr == 48 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 48 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() - decoder.readMessage( - elem.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith - ) + decoder.readMessage(elem.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) (msg.repeatedNestedMessage as MutableList).add(elem) } - tag.fieldNr == 49 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 49 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf_test_messages.proto3.ForeignMessageInternal() - decoder.readMessage( - elem.asInternal(), - com.google.protobuf_test_messages.proto3.ForeignMessageInternal::decodeWith - ) + decoder.readMessage(elem.asInternal(), com.google.protobuf_test_messages.proto3.ForeignMessageInternal::decodeWith) (msg.repeatedForeignMessage as MutableList).add(elem) } - tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.repeatedNestedEnum += decoder.readPackedEnum() - .map { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } + tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.repeatedNestedEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } } - tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - val elem = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 51 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + val elem = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) (msg.repeatedNestedEnum as MutableList).add(elem) } - tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.repeatedForeignEnum += decoder.readPackedEnum() - .map { com.google.protobuf_test_messages.proto3.ForeignEnum.fromNumber(it) } + tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.repeatedForeignEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.proto3.ForeignEnum.fromNumber(it) } } - tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 52 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = com.google.protobuf_test_messages.proto3.ForeignEnum.fromNumber(decoder.readEnum()) (msg.repeatedForeignEnum as MutableList).add(elem) } - tag.fieldNr == 54 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 54 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.repeatedStringPiece as MutableList).add(elem) } - tag.fieldNr == 55 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 55 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = decoder.readString() (msg.repeatedCord as MutableList).add(elem) } - tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedInt32 += decoder.readPackedInt32() } - tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 75 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt32() (msg.packedInt32 as MutableList).add(elem) } - tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedInt64 += decoder.readPackedInt64() } - tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 76 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt64() (msg.packedInt64 as MutableList).add(elem) } - tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedUint32 += decoder.readPackedUInt32() } - tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 77 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt32() (msg.packedUint32 as MutableList).add(elem) } - tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedUint64 += decoder.readPackedUInt64() } - tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 78 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt64() (msg.packedUint64 as MutableList).add(elem) } - tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSint32 += decoder.readPackedSInt32() } - tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 79 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt32() (msg.packedSint32 as MutableList).add(elem) } - tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSint64 += decoder.readPackedSInt64() } - tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 80 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt64() (msg.packedSint64 as MutableList).add(elem) } - tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedFixed32 += decoder.readPackedFixed32() } - tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 81 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFixed32() (msg.packedFixed32 as MutableList).add(elem) } - tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedFixed64 += decoder.readPackedFixed64() } - tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 82 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readFixed64() (msg.packedFixed64 as MutableList).add(elem) } - tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSfixed32 += decoder.readPackedSFixed32() } - tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 83 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readSFixed32() (msg.packedSfixed32 as MutableList).add(elem) } - tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedSfixed64 += decoder.readPackedSFixed64() } - tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 84 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readSFixed64() (msg.packedSfixed64 as MutableList).add(elem) } - tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedFloat += decoder.readPackedFloat() } - tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 85 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFloat() (msg.packedFloat as MutableList).add(elem) } - tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedDouble += decoder.readPackedDouble() } - tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 86 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readDouble() (msg.packedDouble as MutableList).add(elem) } - tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.packedBool += decoder.readPackedBool() } - tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 87 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readBool() (msg.packedBool as MutableList).add(elem) } - tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.packedNestedEnum += decoder.readPackedEnum() - .map { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } + tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.packedNestedEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } } - tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - val elem = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 88 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + val elem = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) (msg.packedNestedEnum as MutableList).add(elem) } - tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedInt32 += decoder.readPackedInt32() } - tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 89 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt32() (msg.unpackedInt32 as MutableList).add(elem) } - tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedInt64 += decoder.readPackedInt64() } - tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 90 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readInt64() (msg.unpackedInt64 as MutableList).add(elem) } - tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedUint32 += decoder.readPackedUInt32() } - tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 91 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt32() (msg.unpackedUint32 as MutableList).add(elem) } - tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedUint64 += decoder.readPackedUInt64() } - tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 92 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readUInt64() (msg.unpackedUint64 as MutableList).add(elem) } - tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSint32 += decoder.readPackedSInt32() } - tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 93 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt32() (msg.unpackedSint32 as MutableList).add(elem) } - tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSint64 += decoder.readPackedSInt64() } - tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 94 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readSInt64() (msg.unpackedSint64 as MutableList).add(elem) } - tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedFixed32 += decoder.readPackedFixed32() } - tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 95 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFixed32() (msg.unpackedFixed32 as MutableList).add(elem) } - tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedFixed64 += decoder.readPackedFixed64() } - tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 96 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readFixed64() (msg.unpackedFixed64 as MutableList).add(elem) } - tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSfixed32 += decoder.readPackedSFixed32() } - tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 97 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readSFixed32() (msg.unpackedSfixed32 as MutableList).add(elem) } - tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedSfixed64 += decoder.readPackedSFixed64() } - tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 98 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readSFixed64() (msg.unpackedSfixed64 as MutableList).add(elem) } - tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedFloat += decoder.readPackedFloat() } - tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 99 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { val elem = decoder.readFloat() (msg.unpackedFloat as MutableList).add(elem) } - tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedDouble += decoder.readPackedDouble() } - tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 100 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { val elem = decoder.readDouble() (msg.unpackedDouble as MutableList).add(elem) } - tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.unpackedBool += decoder.readPackedBool() } - tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 101 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { val elem = decoder.readBool() (msg.unpackedBool as MutableList).add(elem) } - tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.unpackedNestedEnum += decoder.readPackedEnum() - .map { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } + tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.unpackedNestedEnum += decoder.readPackedEnum().map { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(it) } } - tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - val elem = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 102 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + val elem = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) (msg.unpackedNestedEnum as MutableList).add(elem) } - tag.fieldNr == 56 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal::decodeWith - ) + tag.fieldNr == 56 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal::decodeWith) (msg.mapInt32Int32 as MutableMap)[key] = value } } - tag.fieldNr == 57 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal::decodeWith - ) + tag.fieldNr == 57 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal::decodeWith) (msg.mapInt64Int64 as MutableMap)[key] = value } } - tag.fieldNr == 58 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal::decodeWith - ) + tag.fieldNr == 58 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal::decodeWith) (msg.mapUint32Uint32 as MutableMap)[key] = value } } - tag.fieldNr == 59 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal::decodeWith - ) + tag.fieldNr == 59 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal::decodeWith) (msg.mapUint64Uint64 as MutableMap)[key] = value } } - tag.fieldNr == 60 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal::decodeWith - ) + tag.fieldNr == 60 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal::decodeWith) (msg.mapSint32Sint32 as MutableMap)[key] = value } } - tag.fieldNr == 61 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal::decodeWith - ) + tag.fieldNr == 61 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal::decodeWith) (msg.mapSint64Sint64 as MutableMap)[key] = value } } - tag.fieldNr == 62 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal::decodeWith - ) + tag.fieldNr == 62 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal::decodeWith) (msg.mapFixed32Fixed32 as MutableMap)[key] = value } } - tag.fieldNr == 63 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal::decodeWith - ) + tag.fieldNr == 63 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal::decodeWith) (msg.mapFixed64Fixed64 as MutableMap)[key] = value } } - tag.fieldNr == 64 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal::decodeWith - ) + tag.fieldNr == 64 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal::decodeWith) (msg.mapSfixed32Sfixed32 as MutableMap)[key] = value } } - tag.fieldNr == 65 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal::decodeWith - ) + tag.fieldNr == 65 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal::decodeWith) (msg.mapSfixed64Sfixed64 as MutableMap)[key] = value } } - tag.fieldNr == 66 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal::decodeWith - ) + tag.fieldNr == 66 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal::decodeWith) (msg.mapInt32Float as MutableMap)[key] = value } } - tag.fieldNr == 67 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal::decodeWith - ) + tag.fieldNr == 67 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal::decodeWith) (msg.mapInt32Double as MutableMap)[key] = value } } - tag.fieldNr == 68 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal::decodeWith - ) + tag.fieldNr == 68 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal::decodeWith) (msg.mapBoolBool as MutableMap)[key] = value } } - tag.fieldNr == 69 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal::decodeWith - ) + tag.fieldNr == 69 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal::decodeWith) (msg.mapStringString as MutableMap)[key] = value } } - tag.fieldNr == 70 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal::decodeWith - ) + tag.fieldNr == 70 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal::decodeWith) (msg.mapStringBytes as MutableMap)[key] = value } } - tag.fieldNr == 71 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal::decodeWith - ) + tag.fieldNr == 71 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal::decodeWith) (msg.mapStringNestedMessage as MutableMap)[key] = value } } - tag.fieldNr == 72 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal::decodeWith - ) + tag.fieldNr == 72 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal::decodeWith) (msg.mapStringForeignMessage as MutableMap)[key] = value } } - tag.fieldNr == 73 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal::decodeWith - ) + tag.fieldNr == 73 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal::decodeWith) (msg.mapStringNestedEnum as MutableMap)[key] = value } } - tag.fieldNr == 74 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal()) { - decoder.readMessage( - this.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal::decodeWith - ) + tag.fieldNr == 74 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + with(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal()) { + decoder.readMessage(this.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal::decodeWith) (msg.mapStringForeignEnum as MutableMap)[key] = value } } - tag.fieldNr == 201 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[3]) { + tag.fieldNr == 201 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[3]) { msg.optionalBoolWrapper = com.google.protobuf.kotlin.BoolValueInternal() } - decoder.readMessage( - msg.optionalBoolWrapper.asInternal(), - com.google.protobuf.kotlin.BoolValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalBoolWrapper.asInternal(), com.google.protobuf.kotlin.BoolValueInternal::decodeWith) } - tag.fieldNr == 202 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[4]) { + tag.fieldNr == 202 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[4]) { msg.optionalInt32Wrapper = com.google.protobuf.kotlin.Int32ValueInternal() } - decoder.readMessage( - msg.optionalInt32Wrapper.asInternal(), - com.google.protobuf.kotlin.Int32ValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalInt32Wrapper.asInternal(), com.google.protobuf.kotlin.Int32ValueInternal::decodeWith) } - tag.fieldNr == 203 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[5]) { + tag.fieldNr == 203 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[5]) { msg.optionalInt64Wrapper = com.google.protobuf.kotlin.Int64ValueInternal() } - decoder.readMessage( - msg.optionalInt64Wrapper.asInternal(), - com.google.protobuf.kotlin.Int64ValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalInt64Wrapper.asInternal(), com.google.protobuf.kotlin.Int64ValueInternal::decodeWith) } - tag.fieldNr == 204 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[6]) { + tag.fieldNr == 204 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[6]) { msg.optionalUint32Wrapper = com.google.protobuf.kotlin.UInt32ValueInternal() } - decoder.readMessage( - msg.optionalUint32Wrapper.asInternal(), - com.google.protobuf.kotlin.UInt32ValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalUint32Wrapper.asInternal(), com.google.protobuf.kotlin.UInt32ValueInternal::decodeWith) } - tag.fieldNr == 205 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[7]) { + tag.fieldNr == 205 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[7]) { msg.optionalUint64Wrapper = com.google.protobuf.kotlin.UInt64ValueInternal() } - decoder.readMessage( - msg.optionalUint64Wrapper.asInternal(), - com.google.protobuf.kotlin.UInt64ValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalUint64Wrapper.asInternal(), com.google.protobuf.kotlin.UInt64ValueInternal::decodeWith) } - tag.fieldNr == 206 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[8]) { + tag.fieldNr == 206 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[8]) { msg.optionalFloatWrapper = com.google.protobuf.kotlin.FloatValueInternal() } - decoder.readMessage( - msg.optionalFloatWrapper.asInternal(), - com.google.protobuf.kotlin.FloatValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalFloatWrapper.asInternal(), com.google.protobuf.kotlin.FloatValueInternal::decodeWith) } - tag.fieldNr == 207 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[9]) { + tag.fieldNr == 207 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[9]) { msg.optionalDoubleWrapper = com.google.protobuf.kotlin.DoubleValueInternal() } - decoder.readMessage( - msg.optionalDoubleWrapper.asInternal(), - com.google.protobuf.kotlin.DoubleValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalDoubleWrapper.asInternal(), com.google.protobuf.kotlin.DoubleValueInternal::decodeWith) } - tag.fieldNr == 208 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[10]) { + tag.fieldNr == 208 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[10]) { msg.optionalStringWrapper = com.google.protobuf.kotlin.StringValueInternal() } - decoder.readMessage( - msg.optionalStringWrapper.asInternal(), - com.google.protobuf.kotlin.StringValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalStringWrapper.asInternal(), com.google.protobuf.kotlin.StringValueInternal::decodeWith) } - tag.fieldNr == 209 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[11]) { + tag.fieldNr == 209 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[11]) { msg.optionalBytesWrapper = com.google.protobuf.kotlin.BytesValueInternal() } - decoder.readMessage( - msg.optionalBytesWrapper.asInternal(), - com.google.protobuf.kotlin.BytesValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalBytesWrapper.asInternal(), com.google.protobuf.kotlin.BytesValueInternal::decodeWith) } - tag.fieldNr == 211 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 211 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.BoolValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.BoolValueInternal::decodeWith) (msg.repeatedBoolWrapper as MutableList).add(elem) } - tag.fieldNr == 212 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 212 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.Int32ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.Int32ValueInternal::decodeWith) (msg.repeatedInt32Wrapper as MutableList).add(elem) } - tag.fieldNr == 213 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 213 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.Int64ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.Int64ValueInternal::decodeWith) (msg.repeatedInt64Wrapper as MutableList).add(elem) } - tag.fieldNr == 214 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 214 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.UInt32ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.UInt32ValueInternal::decodeWith) (msg.repeatedUint32Wrapper as MutableList).add(elem) } - tag.fieldNr == 215 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 215 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.UInt64ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.UInt64ValueInternal::decodeWith) (msg.repeatedUint64Wrapper as MutableList).add(elem) } - tag.fieldNr == 216 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 216 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.FloatValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.FloatValueInternal::decodeWith) (msg.repeatedFloatWrapper as MutableList).add(elem) } - tag.fieldNr == 217 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 217 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.DoubleValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.DoubleValueInternal::decodeWith) (msg.repeatedDoubleWrapper as MutableList).add(elem) } - tag.fieldNr == 218 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 218 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.StringValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.StringValueInternal::decodeWith) (msg.repeatedStringWrapper as MutableList).add(elem) } - tag.fieldNr == 219 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 219 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.BytesValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.BytesValueInternal::decodeWith) (msg.repeatedBytesWrapper as MutableList).add(elem) } - tag.fieldNr == 301 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[12]) { + tag.fieldNr == 301 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[12]) { msg.optionalDuration = com.google.protobuf.kotlin.DurationInternal() } - decoder.readMessage( - msg.optionalDuration.asInternal(), - com.google.protobuf.kotlin.DurationInternal::decodeWith - ) + decoder.readMessage(msg.optionalDuration.asInternal(), com.google.protobuf.kotlin.DurationInternal::decodeWith) } - tag.fieldNr == 302 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[13]) { + tag.fieldNr == 302 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[13]) { msg.optionalTimestamp = com.google.protobuf.kotlin.TimestampInternal() } - decoder.readMessage( - msg.optionalTimestamp.asInternal(), - com.google.protobuf.kotlin.TimestampInternal::decodeWith - ) + decoder.readMessage(msg.optionalTimestamp.asInternal(), com.google.protobuf.kotlin.TimestampInternal::decodeWith) } - tag.fieldNr == 303 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[14]) { + tag.fieldNr == 303 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[14]) { msg.optionalFieldMask = com.google.protobuf.kotlin.FieldMaskInternal() } - decoder.readMessage( - msg.optionalFieldMask.asInternal(), - com.google.protobuf.kotlin.FieldMaskInternal::decodeWith - ) + decoder.readMessage(msg.optionalFieldMask.asInternal(), com.google.protobuf.kotlin.FieldMaskInternal::decodeWith) } - tag.fieldNr == 304 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[15]) { + tag.fieldNr == 304 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[15]) { msg.optionalStruct = com.google.protobuf.kotlin.StructInternal() } - decoder.readMessage( - msg.optionalStruct.asInternal(), - com.google.protobuf.kotlin.StructInternal::decodeWith - ) + decoder.readMessage(msg.optionalStruct.asInternal(), com.google.protobuf.kotlin.StructInternal::decodeWith) } - tag.fieldNr == 305 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[16]) { + tag.fieldNr == 305 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[16]) { msg.optionalAny = com.google.protobuf.kotlin.AnyInternal() } decoder.readMessage(msg.optionalAny.asInternal(), com.google.protobuf.kotlin.AnyInternal::decodeWith) } - tag.fieldNr == 306 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[17]) { + tag.fieldNr == 306 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[17]) { msg.optionalValue = com.google.protobuf.kotlin.ValueInternal() } - decoder.readMessage( - msg.optionalValue.asInternal(), - com.google.protobuf.kotlin.ValueInternal::decodeWith - ) + decoder.readMessage(msg.optionalValue.asInternal(), com.google.protobuf.kotlin.ValueInternal::decodeWith) } - tag.fieldNr == 307 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 307 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.optionalNullValue = com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum()) } - tag.fieldNr == 311 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 311 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.DurationInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.DurationInternal::decodeWith) (msg.repeatedDuration as MutableList).add(elem) } - tag.fieldNr == 312 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 312 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.TimestampInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.TimestampInternal::decodeWith) (msg.repeatedTimestamp as MutableList).add(elem) } - tag.fieldNr == 313 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 313 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.FieldMaskInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.FieldMaskInternal::decodeWith) (msg.repeatedFieldmask as MutableList).add(elem) } - tag.fieldNr == 324 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 324 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.StructInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.StructInternal::decodeWith) (msg.repeatedStruct as MutableList).add(elem) } - tag.fieldNr == 315 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 315 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.AnyInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.AnyInternal::decodeWith) (msg.repeatedAny as MutableList).add(elem) } - tag.fieldNr == 316 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 316 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.ValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.ValueInternal::decodeWith) (msg.repeatedValue as MutableList).add(elem) } - tag.fieldNr == 317 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 317 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { val elem = com.google.protobuf.kotlin.ListValueInternal() decoder.readMessage(elem.asInternal(), com.google.protobuf.kotlin.ListValueInternal::decodeWith) (msg.repeatedListValue as MutableList).add(elem) } - tag.fieldNr == 401 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 401 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldname1 = decoder.readInt32() } - tag.fieldNr == 402 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 402 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldName2 = decoder.readInt32() } - tag.fieldNr == 403 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 403 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FieldName3 = decoder.readInt32() } - tag.fieldNr == 404 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 404 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_Name4_ = decoder.readInt32() } - tag.fieldNr == 405 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 405 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field0name5 = decoder.readInt32() } - tag.fieldNr == 406 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 406 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_0Name6 = decoder.readInt32() } - tag.fieldNr == 407 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 407 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldName7 = decoder.readInt32() } - tag.fieldNr == 408 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 408 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FieldName8 = decoder.readInt32() } - tag.fieldNr == 409 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 409 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_Name9 = decoder.readInt32() } - tag.fieldNr == 410 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 410 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.Field_Name10 = decoder.readInt32() } - tag.fieldNr == 411 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 411 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FIELD_NAME11 = decoder.readInt32() } - tag.fieldNr == 412 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 412 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FIELDName12 = decoder.readInt32() } - tag.fieldNr == 413 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 413 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg._FieldName13 = decoder.readInt32() } - tag.fieldNr == 414 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 414 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.__FieldName14 = decoder.readInt32() } - tag.fieldNr == 415 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 415 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field_Name15 = decoder.readInt32() } - tag.fieldNr == 416 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 416 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.field__Name16 = decoder.readInt32() } - tag.fieldNr == 417 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 417 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.fieldName17__ = decoder.readInt32() } - tag.fieldNr == 418 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 418 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.FieldName18__ = decoder.readInt32() } - tag.fieldNr == 111 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint32(decoder.readUInt32()) + tag.fieldNr == 111 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint32(decoder.readUInt32()) } - tag.fieldNr == 112 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - val field = - (msg.oneofField as? com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage) - ?: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal()) - .also { - msg.oneofField = it - } + tag.fieldNr == 112 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + val field = (msg.oneofField as? com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage) ?: com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage(com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal()).also { + msg.oneofField = it + } - decoder.readMessage( - field.value.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith - ) + decoder.readMessage(field.value.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) } - tag.fieldNr == 113 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.oneofField = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofString(decoder.readString()) + tag.fieldNr == 113 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofString(decoder.readString()) } - tag.fieldNr == 114 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - msg.oneofField = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBytes(decoder.readBytes()) + tag.fieldNr == 114 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBytes(decoder.readBytes()) } - tag.fieldNr == 115 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBool(decoder.readBool()) + tag.fieldNr == 115 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBool(decoder.readBool()) } - tag.fieldNr == 116 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint64(decoder.readUInt64()) + tag.fieldNr == 116 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint64(decoder.readUInt64()) } - tag.fieldNr == 117 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { - msg.oneofField = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofFloat(decoder.readFloat()) + tag.fieldNr == 117 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofFloat(decoder.readFloat()) } - tag.fieldNr == 118 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { - msg.oneofField = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofDouble(decoder.readDouble()) + tag.fieldNr == 118 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofDouble(decoder.readDouble()) } - tag.fieldNr == 119 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofEnum( - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) - ) + tag.fieldNr == 119 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofEnum(com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum())) } - tag.fieldNr == 120 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNullValue( - com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum()) - ) + tag.fieldNr == 120 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.oneofField = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNullValue(com.google.protobuf.kotlin.NullValue.fromNumber(decoder.readEnum())) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -2873,1308 +2598,726 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.Companio } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.computeSize(): Int { var __result = 0 - if (optionalInt32 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(optionalInt32)) + if (optionalInt32 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(optionalInt32)) } - if (optionalInt64 != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int64(optionalInt64)) + if (optionalInt64 != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(optionalInt64)) } - if (optionalUint32 != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 3, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(optionalUint32)) + if (optionalUint32 != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(3, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(optionalUint32)) } - if (optionalUint64 != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 4, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(optionalUint64)) + if (optionalUint64 != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(4, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(optionalUint64)) } - if (optionalSint32 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 5, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(optionalSint32)) + if (optionalSint32 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(5, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(optionalSint32)) } - if (optionalSint64 != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 6, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(optionalSint64)) + if (optionalSint64 != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(6, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(optionalSint64)) } - if (optionalFixed32 != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 7, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(optionalFixed32)) + if (optionalFixed32 != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(7, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(optionalFixed32)) } - if (optionalFixed64 != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 8, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(optionalFixed64)) + if (optionalFixed64 != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(8, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(optionalFixed64)) } - if (optionalSfixed32 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 9, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(optionalSfixed32)) + if (optionalSfixed32 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(9, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(optionalSfixed32)) } - if (optionalSfixed64 != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 10, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(optionalSfixed64)) + if (optionalSfixed64 != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(10, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(optionalSfixed64)) } - if (optionalFloat != 0.0f) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 11, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.float(optionalFloat)) + if (optionalFloat != 0.0f) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(11, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(optionalFloat)) } - if (optionalDouble != 0.0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 12, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.double(optionalDouble)) + if (optionalDouble != 0.0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(12, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(optionalDouble)) } - if (optionalBool != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 13, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(optionalBool)) + if (optionalBool != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(13, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(optionalBool)) } - if (optionalString.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalString).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 14, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (optionalString.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalString).let { kotlinx.rpc.protobuf.internal.WireSize.tag(14, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (optionalBytes.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(optionalBytes).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 15, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (optionalBytes.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(optionalBytes).let { kotlinx.rpc.protobuf.internal.WireSize.tag(15, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[0]) { - __result += optionalNestedMessage.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 18, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += optionalNestedMessage.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(18, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[1]) { - __result += optionalForeignMessage.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 19, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[1]) { + __result += optionalForeignMessage.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(19, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (optionalNestedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 21, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNestedEnum.number)) + if (optionalNestedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(21, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNestedEnum.number)) } - if (optionalForeignEnum != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 22, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalForeignEnum.number)) + if (optionalForeignEnum != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(22, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalForeignEnum.number)) } - if (optionalAliasedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 23, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalAliasedEnum.number)) + if (optionalAliasedEnum != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(23, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalAliasedEnum.number)) } - if (optionalStringPiece.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalStringPiece).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 24, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (optionalStringPiece.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalStringPiece).let { kotlinx.rpc.protobuf.internal.WireSize.tag(24, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (optionalCord.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalCord).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 25, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (optionalCord.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(optionalCord).let { kotlinx.rpc.protobuf.internal.WireSize.tag(25, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[2]) { - __result += recursiveMessage.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 27, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[2]) { + __result += recursiveMessage.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(27, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedInt32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 31, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedInt32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(repeatedInt32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(31, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedInt64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 32, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedInt64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(repeatedInt64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(32, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedUint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 33, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedUint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(repeatedUint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(33, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedUint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 34, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedUint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(repeatedUint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(34, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedSint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 35, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedSint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(repeatedSint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(35, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedSint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 36, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedSint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(repeatedSint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(36, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedFixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(repeatedFixed32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 37, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedFixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(repeatedFixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(37, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedFixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(repeatedFixed64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 38, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedFixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(repeatedFixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(38, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedSfixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(repeatedSfixed32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 39, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedSfixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(repeatedSfixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(39, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedSfixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(repeatedSfixed64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 40, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedSfixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(repeatedSfixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(40, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedFloat.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(repeatedFloat).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 41, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedFloat.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(repeatedFloat).let { kotlinx.rpc.protobuf.internal.WireSize.tag(41, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedDouble.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(repeatedDouble).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 42, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedDouble.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(repeatedDouble).let { kotlinx.rpc.protobuf.internal.WireSize.tag(42, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedBool.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 43, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedBool.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(repeatedBool).let { kotlinx.rpc.protobuf.internal.WireSize.tag(43, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedString.isNotEmpty()) { - __result += repeatedString.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 44, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedString.isNotEmpty()) { + __result += repeatedString.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(44, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedBytes.isNotEmpty()) { - __result += repeatedBytes.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.bytes(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 45, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedBytes.isNotEmpty()) { + __result += repeatedBytes.sumOf { kotlinx.rpc.protobuf.internal.WireSize.bytes(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(45, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedNestedMessage.isNotEmpty()) { - __result += repeatedNestedMessage.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 48, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedNestedMessage.isNotEmpty()) { + __result += repeatedNestedMessage.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(48, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedForeignMessage.isNotEmpty()) { - __result += repeatedForeignMessage.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 49, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedForeignMessage.isNotEmpty()) { + __result += repeatedForeignMessage.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(49, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedNestedEnum.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number }).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 51, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedNestedEnum.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedNestedEnum.map { it.number }).let { kotlinx.rpc.protobuf.internal.WireSize.tag(51, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedForeignEnum.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number }).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 52, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (repeatedForeignEnum.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(repeatedForeignEnum.map { it.number }).let { kotlinx.rpc.protobuf.internal.WireSize.tag(52, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedStringPiece.isNotEmpty()) { - __result += repeatedStringPiece.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 54, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedStringPiece.isNotEmpty()) { + __result += repeatedStringPiece.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(54, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedCord.isNotEmpty()) { - __result += repeatedCord.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 55, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedCord.isNotEmpty()) { + __result += repeatedCord.sumOf { kotlinx.rpc.protobuf.internal.WireSize.string(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(55, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (packedInt32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 75, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedInt32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt32(packedInt32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(75, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedInt64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 76, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedInt64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedInt64(packedInt64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(76, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedUint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 77, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedUint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt32(packedUint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(77, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedUint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 78, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedUint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedUInt64(packedUint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(78, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedSint32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 79, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedSint32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt32(packedSint32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(79, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedSint64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 80, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedSint64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSInt64(packedSint64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(80, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedFixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(packedFixed32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 81, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedFixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed32(packedFixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(81, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedFixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(packedFixed64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 82, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedFixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFixed64(packedFixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(82, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedSfixed32.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(packedSfixed32).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 83, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedSfixed32.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed32(packedSfixed32).let { kotlinx.rpc.protobuf.internal.WireSize.tag(83, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedSfixed64.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(packedSfixed64).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 84, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedSfixed64.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedSFixed64(packedSfixed64).let { kotlinx.rpc.protobuf.internal.WireSize.tag(84, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedFloat.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(packedFloat).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 85, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedFloat.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedFloat(packedFloat).let { kotlinx.rpc.protobuf.internal.WireSize.tag(85, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedDouble.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(packedDouble).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 86, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedDouble.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedDouble(packedDouble).let { kotlinx.rpc.protobuf.internal.WireSize.tag(86, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedBool.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 87, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedBool.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedBool(packedBool).let { kotlinx.rpc.protobuf.internal.WireSize.tag(87, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (packedNestedEnum.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number }).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 88, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (packedNestedEnum.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.packedEnum(packedNestedEnum.map { it.number }).let { kotlinx.rpc.protobuf.internal.WireSize.tag(88, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (unpackedInt32.isNotEmpty()) { - __result += unpackedInt32.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.int32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 89, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedInt32.isNotEmpty()) { + __result += unpackedInt32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.int32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(89, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedInt64.isNotEmpty()) { - __result += unpackedInt64.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.int64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 90, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedInt64.isNotEmpty()) { + __result += unpackedInt64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.int64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(90, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedUint32.isNotEmpty()) { - __result += unpackedUint32.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.uInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 91, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedUint32.isNotEmpty()) { + __result += unpackedUint32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.uInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(91, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedUint64.isNotEmpty()) { - __result += unpackedUint64.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.uInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 92, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedUint64.isNotEmpty()) { + __result += unpackedUint64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.uInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(92, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedSint32.isNotEmpty()) { - __result += unpackedSint32.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.sInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 93, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedSint32.isNotEmpty()) { + __result += unpackedSint32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sInt32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(93, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedSint64.isNotEmpty()) { - __result += unpackedSint64.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.sInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 94, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedSint64.isNotEmpty()) { + __result += unpackedSint64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sInt64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(94, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedFixed32.isNotEmpty()) { - __result += unpackedFixed32.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.fixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 95, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) - } + if (unpackedFixed32.isNotEmpty()) { + __result += unpackedFixed32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.fixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(95, kotlinx.rpc.protobuf.internal.WireType.FIXED32) } } - if (unpackedFixed64.isNotEmpty()) { - __result += unpackedFixed64.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.fixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 96, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) - } + if (unpackedFixed64.isNotEmpty()) { + __result += unpackedFixed64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.fixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(96, kotlinx.rpc.protobuf.internal.WireType.FIXED64) } } - if (unpackedSfixed32.isNotEmpty()) { - __result += unpackedSfixed32.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.sFixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 97, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) - } + if (unpackedSfixed32.isNotEmpty()) { + __result += unpackedSfixed32.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sFixed32(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(97, kotlinx.rpc.protobuf.internal.WireType.FIXED32) } } - if (unpackedSfixed64.isNotEmpty()) { - __result += unpackedSfixed64.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.sFixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 98, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) - } + if (unpackedSfixed64.isNotEmpty()) { + __result += unpackedSfixed64.sumOf { kotlinx.rpc.protobuf.internal.WireSize.sFixed64(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(98, kotlinx.rpc.protobuf.internal.WireType.FIXED64) } } - if (unpackedFloat.isNotEmpty()) { - __result += unpackedFloat.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.float(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 99, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) - } + if (unpackedFloat.isNotEmpty()) { + __result += unpackedFloat.sumOf { kotlinx.rpc.protobuf.internal.WireSize.float(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(99, kotlinx.rpc.protobuf.internal.WireType.FIXED32) } } - if (unpackedDouble.isNotEmpty()) { - __result += unpackedDouble.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.double(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 100, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) - } + if (unpackedDouble.isNotEmpty()) { + __result += unpackedDouble.sumOf { kotlinx.rpc.protobuf.internal.WireSize.double(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(100, kotlinx.rpc.protobuf.internal.WireType.FIXED64) } } - if (unpackedBool.isNotEmpty()) { - __result += unpackedBool.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.bool(it) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 101, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedBool.isNotEmpty()) { + __result += unpackedBool.sumOf { kotlinx.rpc.protobuf.internal.WireSize.bool(it) + kotlinx.rpc.protobuf.internal.WireSize.tag(101, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (unpackedNestedEnum.isNotEmpty()) { - __result += unpackedNestedEnum.sumOf { - kotlinx.rpc.protobuf.internal.WireSize.enum(it.number) + kotlinx.rpc.protobuf.internal.WireSize.tag( - 102, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) - } + if (unpackedNestedEnum.isNotEmpty()) { + __result += unpackedNestedEnum.sumOf { kotlinx.rpc.protobuf.internal.WireSize.enum(it.number) + kotlinx.rpc.protobuf.internal.WireSize.tag(102, kotlinx.rpc.protobuf.internal.WireType.VARINT) } } - if (mapInt32Int32.isNotEmpty()) { + if (mapInt32Int32.isNotEmpty()) { __result += mapInt32Int32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapInt64Int64.isNotEmpty()) { + if (mapInt64Int64.isNotEmpty()) { __result += mapInt64Int64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapUint32Uint32.isNotEmpty()) { + if (mapUint32Uint32.isNotEmpty()) { __result += mapUint32Uint32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapUint64Uint64.isNotEmpty()) { + if (mapUint64Uint64.isNotEmpty()) { __result += mapUint64Uint64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapSint32Sint32.isNotEmpty()) { + if (mapSint32Sint32.isNotEmpty()) { __result += mapSint32Sint32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapSint64Sint64.isNotEmpty()) { + if (mapSint64Sint64.isNotEmpty()) { __result += mapSint64Sint64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapFixed32Fixed32.isNotEmpty()) { + if (mapFixed32Fixed32.isNotEmpty()) { __result += mapFixed32Fixed32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapFixed64Fixed64.isNotEmpty()) { + if (mapFixed64Fixed64.isNotEmpty()) { __result += mapFixed64Fixed64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapSfixed32Sfixed32.isNotEmpty()) { + if (mapSfixed32Sfixed32.isNotEmpty()) { __result += mapSfixed32Sfixed32.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapSfixed64Sfixed64.isNotEmpty()) { + if (mapSfixed64Sfixed64.isNotEmpty()) { __result += mapSfixed64Sfixed64.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapInt32Float.isNotEmpty()) { + if (mapInt32Float.isNotEmpty()) { __result += mapInt32Float.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapInt32Double.isNotEmpty()) { + if (mapInt32Double.isNotEmpty()) { __result += mapInt32Double.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapBoolBool.isNotEmpty()) { + if (mapBoolBool.isNotEmpty()) { __result += mapBoolBool.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapStringString.isNotEmpty()) { + if (mapStringString.isNotEmpty()) { __result += mapStringString.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapStringBytes.isNotEmpty()) { + if (mapStringBytes.isNotEmpty()) { __result += mapStringBytes.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal().apply { + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal().apply { key = kEntry.key value = kEntry.value } - ._size + ._size } } - if (mapStringNestedMessage.isNotEmpty()) { + if (mapStringNestedMessage.isNotEmpty()) { __result += mapStringNestedMessage.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringForeignMessage.isNotEmpty()) { + if (mapStringForeignMessage.isNotEmpty()) { __result += mapStringForeignMessage.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringNestedEnum.isNotEmpty()) { + if (mapStringNestedEnum.isNotEmpty()) { __result += mapStringNestedEnum.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (mapStringForeignEnum.isNotEmpty()) { + if (mapStringForeignEnum.isNotEmpty()) { __result += mapStringForeignEnum.entries.sumOf { kEntry -> - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal() - .apply { - key = kEntry.key - value = kEntry.value - } - ._size + com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal().apply { + key = kEntry.key + value = kEntry.value + } + ._size } } - if (presenceMask[3]) { - __result += optionalBoolWrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 201, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[3]) { + __result += optionalBoolWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(201, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[4]) { - __result += optionalInt32Wrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 202, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[4]) { + __result += optionalInt32Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(202, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[5]) { - __result += optionalInt64Wrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 203, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[5]) { + __result += optionalInt64Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(203, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[6]) { - __result += optionalUint32Wrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 204, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[6]) { + __result += optionalUint32Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(204, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[7]) { - __result += optionalUint64Wrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 205, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[7]) { + __result += optionalUint64Wrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(205, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[8]) { - __result += optionalFloatWrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 206, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[8]) { + __result += optionalFloatWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(206, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[9]) { - __result += optionalDoubleWrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 207, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[9]) { + __result += optionalDoubleWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(207, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[10]) { - __result += optionalStringWrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 208, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[10]) { + __result += optionalStringWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(208, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[11]) { - __result += optionalBytesWrapper.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 209, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[11]) { + __result += optionalBytesWrapper.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(209, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (repeatedBoolWrapper.isNotEmpty()) { - __result += repeatedBoolWrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 211, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedBoolWrapper.isNotEmpty()) { + __result += repeatedBoolWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(211, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedInt32Wrapper.isNotEmpty()) { - __result += repeatedInt32Wrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 212, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedInt32Wrapper.isNotEmpty()) { + __result += repeatedInt32Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(212, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedInt64Wrapper.isNotEmpty()) { - __result += repeatedInt64Wrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 213, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedInt64Wrapper.isNotEmpty()) { + __result += repeatedInt64Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(213, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedUint32Wrapper.isNotEmpty()) { - __result += repeatedUint32Wrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 214, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedUint32Wrapper.isNotEmpty()) { + __result += repeatedUint32Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(214, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedUint64Wrapper.isNotEmpty()) { - __result += repeatedUint64Wrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 215, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedUint64Wrapper.isNotEmpty()) { + __result += repeatedUint64Wrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(215, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedFloatWrapper.isNotEmpty()) { - __result += repeatedFloatWrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 216, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedFloatWrapper.isNotEmpty()) { + __result += repeatedFloatWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(216, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedDoubleWrapper.isNotEmpty()) { - __result += repeatedDoubleWrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 217, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedDoubleWrapper.isNotEmpty()) { + __result += repeatedDoubleWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(217, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedStringWrapper.isNotEmpty()) { - __result += repeatedStringWrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 218, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedStringWrapper.isNotEmpty()) { + __result += repeatedStringWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(218, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedBytesWrapper.isNotEmpty()) { - __result += repeatedBytesWrapper.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 219, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedBytesWrapper.isNotEmpty()) { + __result += repeatedBytesWrapper.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(219, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (presenceMask[12]) { - __result += optionalDuration.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 301, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[12]) { + __result += optionalDuration.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(301, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[13]) { - __result += optionalTimestamp.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 302, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[13]) { + __result += optionalTimestamp.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(302, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[14]) { - __result += optionalFieldMask.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 303, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[14]) { + __result += optionalFieldMask.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(303, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[15]) { - __result += optionalStruct.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 304, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[15]) { + __result += optionalStruct.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(304, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[16]) { - __result += optionalAny.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 305, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[16]) { + __result += optionalAny.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(305, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[17]) { - __result += optionalValue.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 306, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[17]) { + __result += optionalValue.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(306, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 307, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNullValue.number)) + if (optionalNullValue != com.google.protobuf.kotlin.NullValue.NULL_VALUE) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(307, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(optionalNullValue.number)) } - if (repeatedDuration.isNotEmpty()) { - __result += repeatedDuration.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 311, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedDuration.isNotEmpty()) { + __result += repeatedDuration.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(311, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedTimestamp.isNotEmpty()) { - __result += repeatedTimestamp.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 312, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedTimestamp.isNotEmpty()) { + __result += repeatedTimestamp.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(312, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedFieldmask.isNotEmpty()) { - __result += repeatedFieldmask.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 313, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedFieldmask.isNotEmpty()) { + __result += repeatedFieldmask.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(313, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedStruct.isNotEmpty()) { - __result += repeatedStruct.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 324, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedStruct.isNotEmpty()) { + __result += repeatedStruct.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(324, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedAny.isNotEmpty()) { - __result += repeatedAny.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 315, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedAny.isNotEmpty()) { + __result += repeatedAny.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(315, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedValue.isNotEmpty()) { - __result += repeatedValue.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 316, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedValue.isNotEmpty()) { + __result += repeatedValue.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(316, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (repeatedListValue.isNotEmpty()) { - __result += repeatedListValue.sumOf { - it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag( - 317, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) - } + if (repeatedListValue.isNotEmpty()) { + __result += repeatedListValue.sumOf { it.asInternal()._size + kotlinx.rpc.protobuf.internal.WireSize.tag(317, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) } } - if (fieldname1 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 401, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldname1)) + if (fieldname1 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(401, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldname1)) } - if (fieldName2 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 402, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName2)) + if (fieldName2 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(402, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName2)) } - if (FieldName3 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 403, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName3)) + if (FieldName3 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(403, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName3)) } - if (field_Name4_ != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 404, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name4_)) + if (field_Name4_ != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(404, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name4_)) } - if (field0name5 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 405, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field0name5)) + if (field0name5 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(405, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field0name5)) } - if (field_0Name6 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 406, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_0Name6)) + if (field_0Name6 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(406, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_0Name6)) } - if (fieldName7 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 407, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName7)) + if (fieldName7 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(407, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName7)) } - if (FieldName8 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 408, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName8)) + if (FieldName8 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(408, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName8)) } - if (field_Name9 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 409, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name9)) + if (field_Name9 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(409, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name9)) } - if (Field_Name10 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 410, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(Field_Name10)) + if (Field_Name10 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(410, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(Field_Name10)) } - if (FIELD_NAME11 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 411, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELD_NAME11)) + if (FIELD_NAME11 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(411, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELD_NAME11)) } - if (FIELDName12 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 412, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELDName12)) + if (FIELDName12 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(412, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FIELDName12)) } - if (_FieldName13 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 413, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(_FieldName13)) + if (_FieldName13 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(413, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(_FieldName13)) } - if (__FieldName14 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 414, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(__FieldName14)) + if (__FieldName14 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(414, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(__FieldName14)) } - if (field_Name15 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 415, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name15)) + if (field_Name15 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(415, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field_Name15)) } - if (field__Name16 != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 416, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(field__Name16)) + if (field__Name16 != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(416, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(field__Name16)) } - if (fieldName17__ != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 417, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName17__)) + if (fieldName17__ != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(417, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(fieldName17__)) } - if (FieldName18__ != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 418, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName18__)) + if (FieldName18__ != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(418, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(FieldName18__)) } - oneofField?.also { - when (val value = it) { - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 111, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value.value)) + oneofField?.also { + when (val value = it) { + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint32 -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(111, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value.value)) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { - __result += value.value.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 112, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNestedMessage -> { + __result += value.value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(112, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofString -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 113, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofString -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(113, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 114, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBytes -> { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value.value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(114, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBool -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 115, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(value.value)) + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofBool -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(115, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(value.value)) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 116, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value.value)) + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofUint64 -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(116, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value.value)) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 117, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.float(value.value)) + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofFloat -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(117, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(value.value)) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 118, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.double(value.value)) + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofDouble -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(118, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(value.value)) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 119, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofEnum -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(119, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) } - is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 120, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) + is com.google.protobuf_test_messages.proto3.TestAllTypesProto3.OneofField.OneofNullValue -> { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(120, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.value.number)) } } } @@ -4183,37 +3326,33 @@ private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal. } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal { - return this as? com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal { + return this as? com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (c != 0) { +fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (c != 0) { encoder.writeInt32(fieldNr = 1, value = c) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.ForeignMessageInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.ForeignMessageInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.c = decoder.readInt32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4224,44 +3363,37 @@ fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.Companion.de } } -private fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.ForeignMessageInternal.computeSize(): Int { var __result = 0 - if (c != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(c)) + if (c != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(c)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.ForeignMessage.asInternal(): com.google.protobuf_test_messages.proto3.ForeignMessageInternal { - return this as? com.google.protobuf_test_messages.proto3.ForeignMessageInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.proto3.ForeignMessage.asInternal(): com.google.protobuf_test_messages.proto3.ForeignMessageInternal { + return this as? com.google.protobuf_test_messages.proto3.ForeignMessageInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { +fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { // no fields to encode } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + when { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4272,37 +3404,33 @@ fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.Compan } } -private fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal.computeSize(): Int { var __result = 0 return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3.asInternal(): com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal { - return this as? com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.proto3.NullHypothesisProto3.asInternal(): com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal { + return this as? com.google.protobuf_test_messages.proto3.NullHypothesisProto3Internal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { +fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { // no fields to encode } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + when { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4313,61 +3441,54 @@ fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.Companion.de } } -private fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal.computeSize(): Int { var __result = 0 return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3.asInternal(): com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal { - return this as? com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3.asInternal(): com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal { + return this as? com.google.protobuf_test_messages.proto3.EnumOnlyProto3Internal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { corecursive.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (a != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (a != 0) { encoder.writeInt32(fieldNr = 1, value = a) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = corecursive.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.a = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { msg.corecursive = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal() } - decoder.readMessage( - msg.corecursive.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal::decodeWith - ) + decoder.readMessage(msg.corecursive.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal::decodeWith) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4378,67 +3499,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMe } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal.computeSize(): Int { var __result = 0 - if (a != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(a)) + if (a != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(a)) } - if (presenceMask[0]) { - __result += corecursive.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += corecursive.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal { - return this as? com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal - ?: error("Message ${this::class.simpleName} is a non-internal message type.") +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal { + return this as? com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal ?: error("Message ${this::class.simpleName} is a non-internal message type.") } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeInt32(fieldNr = 1, value = key) } - if (value != 0) { + if (value != 0) { encoder.writeInt32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readInt32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4449,64 +3558,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32 } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) } - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32Int32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0L) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0L) { encoder.writeInt64(fieldNr = 1, value = key) } - if (value != 0L) { + if (value != 0L) { encoder.writeInt64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readInt64() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4517,64 +3617,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64 } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int64(key)) + if (key != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(key)) } - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt64Int64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0u) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0u) { encoder.writeUInt32(fieldNr = 1, value = key) } - if (value != 0u) { + if (value != 0u) { encoder.writeUInt32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readUInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readUInt32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4585,64 +3676,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint3 } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(key)) + if (key != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(key)) } - if (value != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value)) + if (value != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint32Uint32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0uL) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0uL) { encoder.writeUInt64(fieldNr = 1, value = key) } - if (value != 0uL) { + if (value != 0uL) { encoder.writeUInt64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readUInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readUInt64() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4653,64 +3735,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint6 } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(key)) + if (key != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(key)) } - if (value != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value)) + if (value != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.uInt64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapUint64Uint64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeSInt32(fieldNr = 1, value = key) } - if (value != 0) { + if (value != 0) { encoder.writeSInt32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readSInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readSInt32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4721,64 +3794,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint3 } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(key)) } - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint32Sint32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0L) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0L) { encoder.writeSInt64(fieldNr = 1, value = key) } - if (value != 0L) { + if (value != 0L) { encoder.writeSInt64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readSInt64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readSInt64() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4789,66 +3853,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint6 } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(key)) + if (key != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(key)) } - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.sInt64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSint64Sint64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0u) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0u) { encoder.writeFixed32(fieldNr = 1, value = key) } - if (value != 0u) { + if (value != 0u) { encoder.writeFixed32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.key = decoder.readFixed32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readFixed32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4859,66 +3912,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(key)) + if (key != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(key)) } - if (value != 0u) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(value)) + if (value != 0u) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.fixed32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed32Fixed32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0uL) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0uL) { encoder.writeFixed64(fieldNr = 1, value = key) } - if (value != 0uL) { + if (value != 0uL) { encoder.writeFixed64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.key = decoder.readFixed64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readFixed64() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4929,66 +3971,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(key)) + if (key != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(key)) } - if (value != 0uL) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(value)) + if (value != 0uL) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.fixed64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapFixed64Fixed64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeSFixed32(fieldNr = 1, value = key) } - if (value != 0) { + if (value != 0) { encoder.writeSFixed32(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.key = decoder.readSFixed32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readSFixed32() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -4999,66 +4030,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixe } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(key)) } - if (value != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(value)) + if (value != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.sFixed32(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed32Sfixed32EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key != 0L) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0L) { encoder.writeSFixed64(fieldNr = 1, value = key) } - if (value != 0L) { + if (value != 0L) { encoder.writeSFixed64(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.key = decoder.readSFixed64() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readSFixed64() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5069,64 +4089,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixe } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.computeSize(): Int { var __result = 0 - if (key != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(key)) + if (key != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(key)) } - if (value != 0L) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(value)) + if (value != 0L) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.sFixed64(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapSfixed64Sfixed64EntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeInt32(fieldNr = 1, value = key) } - if (value != 0.0f) { + if (value != 0.0f) { encoder.writeFloat(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED32 -> { msg.value = decoder.readFloat() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5137,64 +4148,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32 } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) } - if (value != 0.0f) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.FIXED32 - ) + kotlinx.rpc.protobuf.internal.WireSize.float(value)) + if (value != 0.0f) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED32) + kotlinx.rpc.protobuf.internal.WireSize.float(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32FloatEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != 0) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != 0) { encoder.writeInt32(fieldNr = 1, value = key) } - if (value != 0.0) { + if (value != 0.0) { encoder.writeDouble(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readInt32() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.FIXED64 -> { msg.value = decoder.readDouble() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5205,64 +4207,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32 } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.computeSize(): Int { var __result = 0 - if (key != 0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) + if (key != 0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.int32(key)) } - if (value != 0.0) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.FIXED64 - ) + kotlinx.rpc.protobuf.internal.WireSize.double(value)) + if (value != 0.0) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.FIXED64) + kotlinx.rpc.protobuf.internal.WireSize.double(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapInt32DoubleEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key != false) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key != false) { encoder.writeBool(fieldNr = 1, value = key) } - if (value != false) { + if (value != false) { encoder.writeBool(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.key = decoder.readBool() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = decoder.readBool() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5273,64 +4266,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolB } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.computeSize(): Int { var __result = 0 - if (key != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(key)) + if (key != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(key)) } - if (value != false) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.bool(value)) + if (value != false) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.bool(value)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapBoolBoolEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value.isNotEmpty()) { + if (value.isNotEmpty()) { encoder.writeString(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readString() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5341,68 +4325,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringStringEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value.isNotEmpty()) { + if (value.isNotEmpty()) { encoder.writeBytes(fieldNr = 2, value = value) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.value = decoder.readBytes() } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5413,81 +4384,62 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (value.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (value.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.bytes(value).let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringBytesEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { value.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = value.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { - msg.value = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { + msg.value = com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal() } - decoder.readMessage( - msg.value.asInternal(), - com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith - ) + decoder.readMessage(msg.value.asInternal(), com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.NestedMessageInternal::decodeWith) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5498,80 +4450,62 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[0]) { - __result += value.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedMessageEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.checkRequiredFields() { // no required fields to check - if (presenceMask[0]) { + if (presenceMask[0]) { value.asInternal().checkRequiredFields() } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (presenceMask[0]) { + if (presenceMask[0]) { encoder.writeMessage(fieldNr = 2, value = value.asInternal()) { encodeWith(it) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { - if (!msg.presenceMask[0]) { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + if (!msg.presenceMask[0]) { msg.value = com.google.protobuf_test_messages.proto3.ForeignMessageInternal() } - decoder.readMessage( - msg.value.asInternal(), - com.google.protobuf_test_messages.proto3.ForeignMessageInternal::decodeWith - ) + decoder.readMessage(msg.value.asInternal(), com.google.protobuf_test_messages.proto3.ForeignMessageInternal::decodeWith) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5582,71 +4516,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (presenceMask[0]) { - __result += value.asInternal()._size.let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (presenceMask[0]) { + __result += value.asInternal()._size.let { kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignMessageEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { + if (value != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { encoder.writeEnum(fieldNr = 2, value = value.number) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { - msg.value = - com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + msg.value = com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.fromNumber(decoder.readEnum()) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5657,68 +4575,55 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (value != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) + if (value != com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringNestedEnumEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.checkRequiredFields() { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.checkRequiredFields() { // no required fields to check } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.encodeWith( - encoder: kotlinx.rpc.protobuf.internal.WireEncoder, -) { - if (key.isNotEmpty()) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.encodeWith(encoder: kotlinx.rpc.protobuf.internal.WireEncoder) { + if (key.isNotEmpty()) { encoder.writeString(fieldNr = 1, value = key) } - if (value != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { + if (value != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { encoder.writeEnum(fieldNr = 2, value = value.number) } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.Companion.decodeWith( - msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal, - decoder: kotlinx.rpc.protobuf.internal.WireDecoder, -) { - while (true) { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.Companion.decodeWith(msg: com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal, decoder: kotlinx.rpc.protobuf.internal.WireDecoder) { + while (true) { val tag = decoder.readTag() ?: break // EOF, we read the whole message - when { - tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { + when { + tag.fieldNr == 1 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED -> { msg.key = decoder.readString() } - tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { + tag.fieldNr == 2 && tag.wireType == kotlinx.rpc.protobuf.internal.WireType.VARINT -> { msg.value = com.google.protobuf_test_messages.proto3.ForeignEnum.fromNumber(decoder.readEnum()) } - else -> { - if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { + else -> { + if (tag.wireType == kotlinx.rpc.protobuf.internal.WireType.END_GROUP) { throw kotlinx.rpc.protobuf.internal.ProtobufDecodingException("Unexpected END_GROUP tag.") } @@ -5729,111 +4634,103 @@ fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStrin } } -private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.computeSize(): Int { +private fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.computeSize(): Int { var __result = 0 - if (key.isNotEmpty()) { - __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { - kotlinx.rpc.protobuf.internal.WireSize.tag( - 1, - kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED - ) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it - } + if (key.isNotEmpty()) { + __result += kotlinx.rpc.protobuf.internal.WireSize.string(key).let { kotlinx.rpc.protobuf.internal.WireSize.tag(1, kotlinx.rpc.protobuf.internal.WireType.LENGTH_DELIMITED) + kotlinx.rpc.protobuf.internal.WireSize.int32(it) + it } } - if (value != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { - __result += (kotlinx.rpc.protobuf.internal.WireSize.tag( - 2, - kotlinx.rpc.protobuf.internal.WireType.VARINT - ) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) + if (value != com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO) { + __result += (kotlinx.rpc.protobuf.internal.WireSize.tag(2, kotlinx.rpc.protobuf.internal.WireType.VARINT) + kotlinx.rpc.protobuf.internal.WireSize.enum(value.number)) } return __result } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal.asInternal(): com.google.protobuf_test_messages.proto3.TestAllTypesProto3Internal.MapStringForeignEnumEntryInternal { return this } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.ForeignEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.ForeignEnum { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.proto3.ForeignEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.ForeignEnum { + return when (number) { + 0 -> { com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_FOO } - 1 -> { + 1 -> { com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_BAR } - 2 -> { + 2 -> { com.google.protobuf_test_messages.proto3.ForeignEnum.FOREIGN_BAZ } - else -> { + else -> { com.google.protobuf_test_messages.proto3.ForeignEnum.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum { + return when (number) { + 0 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.FOO } - 1 -> { + 1 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.BAR } - 2 -> { + 2 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.BAZ } - -1 -> { + -1 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.NEG } - else -> { + else -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum { + return when (number) { + 0 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_FOO } - 1 -> { + 1 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_BAR } - 2 -> { + 2 -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.ALIAS_BAZ } - else -> { + else -> { com.google.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum.UNRECOGNIZED(number) } } } @kotlinx.rpc.internal.utils.InternalRpcApi -fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool { - return when (number) { - 0 -> { +fun com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool.Companion.fromNumber(number: Int): com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool { + return when (number) { + 0 -> { com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool.kFalse } - 1 -> { + 1 -> { com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool.kTrue } - else -> { + else -> { com.google.protobuf_test_messages.proto3.EnumOnlyProto3.Bool.UNRECOGNIZED(number) } } From ab7abb104c127541d5c64d76ca07acdb3bcbe8f9 Mon Sep 17 00:00:00 2001 From: Johannes Zottele Date: Wed, 10 Sep 2025 14:55:21 +0200 Subject: [PATCH 7/7] pb: Remove copyright headers Signed-off-by: Johannes Zottele --- .../com/google/protobuf/kotlin/_rpc_internal/Any.kt | 4 ---- .../com/google/protobuf/kotlin/_rpc_internal/Api.kt | 4 ---- .../com/google/protobuf/kotlin/_rpc_internal/Duration.kt | 4 ---- .../com/google/protobuf/kotlin/_rpc_internal/Empty.kt | 4 ---- .../com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt | 4 ---- .../com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt | 4 ---- .../com/google/protobuf/kotlin/_rpc_internal/Struct.kt | 4 ---- .../com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt | 4 ---- .../com/google/protobuf/kotlin/_rpc_internal/Type.kt | 4 ---- .../com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt | 4 ---- .../google/protobuf/conformance/_rpc_internal/Conformance.kt | 4 ---- .../proto3/_rpc_internal/TestMessagesProto3Editions.kt | 4 ---- .../proto3/_rpc_internal/TestMessagesProto3.kt | 4 ---- 13 files changed, 52 deletions(-) diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt index d32f57974..f900fabf0 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Any.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) package com.google.protobuf.kotlin diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt index bdbc68018..f1cc4a6b9 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Api.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) package com.google.protobuf.kotlin diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt index 4ae2dd14e..11effb913 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Duration.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) package com.google.protobuf.kotlin diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt index 249a856c7..9bb601255 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Empty.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) package com.google.protobuf.kotlin diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt index b566f984e..b7e8411cb 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/FieldMask.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) package com.google.protobuf.kotlin diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt index 6bd658673..6b4c60a32 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/SourceContext.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) package com.google.protobuf.kotlin diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt index b5a691a17..a0cf20b59 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Struct.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) package com.google.protobuf.kotlin diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt index 23c2d3f19..1a78799e5 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Timestamp.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) package com.google.protobuf.kotlin diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt index 6d78cc0a6..d688524dc 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Type.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) package com.google.protobuf.kotlin diff --git a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt index ea1f793e0..f50f6c53f 100644 --- a/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt +++ b/protobuf/protobuf-core/src/commonMain/generated-code/kotlin-multiplatform/com/google/protobuf/kotlin/_rpc_internal/Wrappers.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) package com.google.protobuf.kotlin diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt index 8c75d8a79..0756143b7 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf/conformance/_rpc_internal/Conformance.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) package com.google.protobuf.conformance diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt index 727a46840..fb1f82144 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/editions/proto3/_rpc_internal/TestMessagesProto3Editions.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) package com.google.protobuf_test_messages.editions.proto3 diff --git a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt index efd65c26c..3def5c591 100644 --- a/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt +++ b/tests/protobuf-conformance/src/main/generated-code/kotlin-multiplatform/com/google/protobuf_test_messages/proto3/_rpc_internal/TestMessagesProto3.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - @file:OptIn(ExperimentalRpcApi::class, kotlinx.rpc.internal.utils.InternalRpcApi::class) package com.google.protobuf_test_messages.proto3