commonMain.aws.sdk.kotlin.services.glue.serde.ViewValidationDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.serde
import aws.sdk.kotlin.services.glue.model.ResourceState
import aws.sdk.kotlin.services.glue.model.ViewDialect
import aws.sdk.kotlin.services.glue.model.ViewValidation
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 deserializeViewValidationDocument(deserializer: Deserializer): ViewValidation {
val builder = ViewValidation.Builder()
val DIALECT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Dialect"))
val DIALECTVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DialectVersion"))
val ERROR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Error"))
val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("State"))
val UPDATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("UpdateTime"))
val VIEWVALIDATIONTEXT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ViewValidationText"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DIALECT_DESCRIPTOR)
field(DIALECTVERSION_DESCRIPTOR)
field(ERROR_DESCRIPTOR)
field(STATE_DESCRIPTOR)
field(UPDATETIME_DESCRIPTOR)
field(VIEWVALIDATIONTEXT_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
DIALECT_DESCRIPTOR.index -> builder.dialect = deserializeString().let { ViewDialect.fromValue(it) }
DIALECTVERSION_DESCRIPTOR.index -> builder.dialectVersion = deserializeString()
ERROR_DESCRIPTOR.index -> builder.error = deserializeErrorDetailDocument(deserializer)
STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { ResourceState.fromValue(it) }
UPDATETIME_DESCRIPTOR.index -> builder.updateTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
VIEWVALIDATIONTEXT_DESCRIPTOR.index -> builder.viewValidationText = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}