commonMain.aws.sdk.kotlin.services.backup.serde.RecoveryPointByResourceDocumentDeserializer.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.RecoveryPointByResource
import aws.sdk.kotlin.services.backup.model.RecoveryPointStatus
import aws.sdk.kotlin.services.backup.model.VaultType
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 deserializeRecoveryPointByResourceDocument(deserializer: Deserializer): RecoveryPointByResource {
val builder = RecoveryPointByResource.Builder()
val BACKUPSIZEBYTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("BackupSizeBytes"))
val BACKUPVAULTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("BackupVaultName"))
val CREATIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationDate"))
val ENCRYPTIONKEYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EncryptionKeyArn"))
val ISPARENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("IsParent"))
val PARENTRECOVERYPOINTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ParentRecoveryPointArn"))
val RECOVERYPOINTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RecoveryPointArn"))
val RESOURCENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceName"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
val STATUSMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StatusMessage"))
val VAULTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("VaultType"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(BACKUPSIZEBYTES_DESCRIPTOR)
field(BACKUPVAULTNAME_DESCRIPTOR)
field(CREATIONDATE_DESCRIPTOR)
field(ENCRYPTIONKEYARN_DESCRIPTOR)
field(ISPARENT_DESCRIPTOR)
field(PARENTRECOVERYPOINTARN_DESCRIPTOR)
field(RECOVERYPOINTARN_DESCRIPTOR)
field(RESOURCENAME_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(STATUSMESSAGE_DESCRIPTOR)
field(VAULTTYPE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
BACKUPSIZEBYTES_DESCRIPTOR.index -> builder.backupSizeBytes = deserializeLong()
BACKUPVAULTNAME_DESCRIPTOR.index -> builder.backupVaultName = deserializeString()
CREATIONDATE_DESCRIPTOR.index -> builder.creationDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
ENCRYPTIONKEYARN_DESCRIPTOR.index -> builder.encryptionKeyArn = deserializeString()
ISPARENT_DESCRIPTOR.index -> builder.isParent = deserializeBoolean()
PARENTRECOVERYPOINTARN_DESCRIPTOR.index -> builder.parentRecoveryPointArn = deserializeString()
RECOVERYPOINTARN_DESCRIPTOR.index -> builder.recoveryPointArn = deserializeString()
RESOURCENAME_DESCRIPTOR.index -> builder.resourceName = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { RecoveryPointStatus.fromValue(it) }
STATUSMESSAGE_DESCRIPTOR.index -> builder.statusMessage = deserializeString()
VAULTTYPE_DESCRIPTOR.index -> builder.vaultType = deserializeString().let { VaultType.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}