commonMain.aws.sdk.kotlin.services.backup.serde.FrameworkDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.backup.serde
import aws.sdk.kotlin.services.backup.model.Framework
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
internal fun deserializeFrameworkDocument(deserializer: Deserializer): Framework {
val builder = Framework.Builder()
val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTime"))
val DEPLOYMENTSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DeploymentStatus"))
val FRAMEWORKARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FrameworkArn"))
val FRAMEWORKDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FrameworkDescription"))
val FRAMEWORKNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FrameworkName"))
val NUMBEROFCONTROLS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("NumberOfControls"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CREATIONTIME_DESCRIPTOR)
field(DEPLOYMENTSTATUS_DESCRIPTOR)
field(FRAMEWORKARN_DESCRIPTOR)
field(FRAMEWORKDESCRIPTION_DESCRIPTOR)
field(FRAMEWORKNAME_DESCRIPTOR)
field(NUMBEROFCONTROLS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeString().let { Instant.fromEpochSeconds(it) }
DEPLOYMENTSTATUS_DESCRIPTOR.index -> builder.deploymentStatus = deserializeString()
FRAMEWORKARN_DESCRIPTOR.index -> builder.frameworkArn = deserializeString()
FRAMEWORKDESCRIPTION_DESCRIPTOR.index -> builder.frameworkDescription = deserializeString()
FRAMEWORKNAME_DESCRIPTOR.index -> builder.frameworkName = deserializeString()
NUMBEROFCONTROLS_DESCRIPTOR.index -> builder.numberOfControls = deserializeInt()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}