
commonMain.aws.sdk.kotlin.services.kendra.serde.DocumentAttributeConditionDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.kendra.serde
import aws.sdk.kotlin.services.kendra.model.ConditionOperator
import aws.sdk.kotlin.services.kendra.model.DocumentAttributeCondition
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
internal fun deserializeDocumentAttributeConditionDocument(deserializer: Deserializer): DocumentAttributeCondition {
val builder = DocumentAttributeCondition.Builder()
val CONDITIONDOCUMENTATTRIBUTEKEY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConditionDocumentAttributeKey"))
val CONDITIONONVALUE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ConditionOnValue"))
val OPERATOR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Operator"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CONDITIONDOCUMENTATTRIBUTEKEY_DESCRIPTOR)
field(CONDITIONONVALUE_DESCRIPTOR)
field(OPERATOR_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CONDITIONDOCUMENTATTRIBUTEKEY_DESCRIPTOR.index -> builder.conditionDocumentAttributeKey = deserializeString()
CONDITIONONVALUE_DESCRIPTOR.index -> builder.conditionOnValue = deserializeDocumentAttributeValueDocument(deserializer)
OPERATOR_DESCRIPTOR.index -> builder.operator = deserializeString().let { ConditionOperator.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy