commonMain.aws.sdk.kotlin.services.polly.serde.LexiconAttributesDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of polly-jvm Show documentation
Show all versions of polly-jvm Show documentation
The AWS SDK for Kotlin client for Polly
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.polly.serde
import aws.sdk.kotlin.services.polly.model.LanguageCode
import aws.sdk.kotlin.services.polly.model.LexiconAttributes
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
internal fun deserializeLexiconAttributesDocument(deserializer: Deserializer): LexiconAttributes {
val builder = LexiconAttributes.Builder()
val ALPHABET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Alphabet"))
val LANGUAGECODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("LanguageCode"))
val LASTMODIFIED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastModified"))
val LEXEMESCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("LexemesCount"))
val LEXICONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LexiconArn"))
val SIZE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Size"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ALPHABET_DESCRIPTOR)
field(LANGUAGECODE_DESCRIPTOR)
field(LASTMODIFIED_DESCRIPTOR)
field(LEXEMESCOUNT_DESCRIPTOR)
field(LEXICONARN_DESCRIPTOR)
field(SIZE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ALPHABET_DESCRIPTOR.index -> builder.alphabet = deserializeString()
LANGUAGECODE_DESCRIPTOR.index -> builder.languageCode = deserializeString().let { LanguageCode.fromValue(it) }
LASTMODIFIED_DESCRIPTOR.index -> builder.lastModified = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
LEXEMESCOUNT_DESCRIPTOR.index -> builder.lexemesCount = deserializeInt()
LEXICONARN_DESCRIPTOR.index -> builder.lexiconArn = deserializeString()
SIZE_DESCRIPTOR.index -> builder.size = deserializeInt()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}