commonMain.aws.sdk.kotlin.services.cloudsearch.serde.OptionStatusDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudsearch-jvm Show documentation
Show all versions of cloudsearch-jvm Show documentation
The AWS SDK for Kotlin client for CloudSearch
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cloudsearch.serde
import aws.sdk.kotlin.services.cloudsearch.model.OptionState
import aws.sdk.kotlin.services.cloudsearch.model.OptionStatus
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.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import aws.smithy.kotlin.runtime.serde.xml.XmlDeserializer
import aws.smithy.kotlin.runtime.serde.xml.XmlNamespace
import aws.smithy.kotlin.runtime.serde.xml.XmlSerialName
import aws.smithy.kotlin.runtime.time.Instant
internal fun deserializeOptionStatusDocument(deserializer: Deserializer): OptionStatus {
val builder = OptionStatus.Builder()
val CREATIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, XmlSerialName("CreationDate"))
val PENDINGDELETION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, XmlSerialName("PendingDeletion"))
val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, XmlSerialName("State"))
val UPDATEDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, XmlSerialName("UpdateDate"))
val UPDATEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("UpdateVersion"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
trait(XmlSerialName("OptionStatus"))
trait(XmlNamespace("http://cloudsearch.amazonaws.com/doc/2013-01-01/"))
field(CREATIONDATE_DESCRIPTOR)
field(PENDINGDELETION_DESCRIPTOR)
field(STATE_DESCRIPTOR)
field(UPDATEDATE_DESCRIPTOR)
field(UPDATEVERSION_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CREATIONDATE_DESCRIPTOR.index -> builder.creationDate = deserializeString().let { Instant.fromIso8601(it) }
PENDINGDELETION_DESCRIPTOR.index -> builder.pendingDeletion = deserializeBoolean()
STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { OptionState.fromValue(it) }
UPDATEDATE_DESCRIPTOR.index -> builder.updateDate = deserializeString().let { Instant.fromIso8601(it) }
UPDATEVERSION_DESCRIPTOR.index -> builder.updateVersion = deserializeInt()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy