commonMain.aws.sdk.kotlin.services.backup.serde.ConditionsDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.backup.serde
import aws.sdk.kotlin.services.backup.model.ConditionParameter
import aws.sdk.kotlin.services.backup.model.Conditions
import aws.smithy.kotlin.runtime.serde.Deserializer
import aws.smithy.kotlin.runtime.serde.SdkFieldDescriptor
import aws.smithy.kotlin.runtime.serde.SdkObjectDescriptor
import aws.smithy.kotlin.runtime.serde.SerialKind
import aws.smithy.kotlin.runtime.serde.asSdkSerializable
import aws.smithy.kotlin.runtime.serde.deserializeList
import aws.smithy.kotlin.runtime.serde.deserializeMap
import aws.smithy.kotlin.runtime.serde.deserializeStruct
import aws.smithy.kotlin.runtime.serde.field
import aws.smithy.kotlin.runtime.serde.json.JsonDeserializer
import aws.smithy.kotlin.runtime.serde.json.JsonSerialName
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import kotlin.collections.mutableListOf
internal fun deserializeConditionsDocument(deserializer: Deserializer): Conditions {
val builder = Conditions.Builder()
val STRINGEQUALS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("StringEquals"))
val STRINGLIKE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("StringLike"))
val STRINGNOTEQUALS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("StringNotEquals"))
val STRINGNOTLIKE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("StringNotLike"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(STRINGEQUALS_DESCRIPTOR)
field(STRINGLIKE_DESCRIPTOR)
field(STRINGNOTEQUALS_DESCRIPTOR)
field(STRINGNOTLIKE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
STRINGEQUALS_DESCRIPTOR.index -> builder.stringEquals =
deserializer.deserializeList(STRINGEQUALS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeConditionParameterDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
STRINGLIKE_DESCRIPTOR.index -> builder.stringLike =
deserializer.deserializeList(STRINGLIKE_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeConditionParameterDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
STRINGNOTEQUALS_DESCRIPTOR.index -> builder.stringNotEquals =
deserializer.deserializeList(STRINGNOTEQUALS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeConditionParameterDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
STRINGNOTLIKE_DESCRIPTOR.index -> builder.stringNotLike =
deserializer.deserializeList(STRINGNOTLIKE_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeConditionParameterDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}