commonMain.aws.sdk.kotlin.services.databrew.serde.RuleDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of databrew-jvm Show documentation
Show all versions of databrew-jvm Show documentation
The AWS Kotlin client for DataBrew
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.databrew.serde
import aws.sdk.kotlin.services.databrew.model.ColumnSelector
import aws.sdk.kotlin.services.databrew.model.Rule
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
import kotlin.collections.mutableMapOf
internal fun deserializeRuleDocument(deserializer: Deserializer): Rule {
val builder = Rule.Builder()
val CHECKEXPRESSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CheckExpression"))
val COLUMNSELECTORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ColumnSelectors"))
val DISABLED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("Disabled"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val SUBSTITUTIONMAP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("SubstitutionMap"))
val THRESHOLD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Threshold"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CHECKEXPRESSION_DESCRIPTOR)
field(COLUMNSELECTORS_DESCRIPTOR)
field(DISABLED_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(SUBSTITUTIONMAP_DESCRIPTOR)
field(THRESHOLD_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CHECKEXPRESSION_DESCRIPTOR.index -> builder.checkExpression = deserializeString()
COLUMNSELECTORS_DESCRIPTOR.index -> builder.columnSelectors =
deserializer.deserializeList(COLUMNSELECTORS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeColumnSelectorDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
DISABLED_DESCRIPTOR.index -> builder.disabled = deserializeBoolean()
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
SUBSTITUTIONMAP_DESCRIPTOR.index -> builder.substitutionMap =
deserializer.deserializeMap(SUBSTITUTIONMAP_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
THRESHOLD_DESCRIPTOR.index -> builder.threshold = deserializeThresholdDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy