commonMain.aws.sdk.kotlin.services.backup.serde.RecoveryPointByBackupVaultDocumentDeserializer.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.RecoveryPointByBackupVault
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 deserializeRecoveryPointByBackupVaultDocument(deserializer: Deserializer): RecoveryPointByBackupVault {
val builder = RecoveryPointByBackupVault.Builder()
val BACKUPSIZEINBYTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("BackupSizeInBytes"))
val BACKUPVAULTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("BackupVaultArn"))
val BACKUPVAULTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("BackupVaultName"))
val CALCULATEDLIFECYCLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("CalculatedLifecycle"))
val COMPLETIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CompletionDate"))
val COMPOSITEMEMBERIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CompositeMemberIdentifier"))
val CREATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("CreatedBy"))
val CREATIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationDate"))
val ENCRYPTIONKEYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EncryptionKeyArn"))
val IAMROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("IamRoleArn"))
val ISENCRYPTED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("IsEncrypted"))
val ISPARENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("IsParent"))
val LASTRESTORETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastRestoreTime"))
val LIFECYCLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Lifecycle"))
val PARENTRECOVERYPOINTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ParentRecoveryPointArn"))
val RECOVERYPOINTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RecoveryPointArn"))
val RESOURCEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceArn"))
val RESOURCENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceName"))
val RESOURCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceType"))
val SOURCEBACKUPVAULTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SourceBackupVaultArn"))
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(BACKUPSIZEINBYTES_DESCRIPTOR)
field(BACKUPVAULTARN_DESCRIPTOR)
field(BACKUPVAULTNAME_DESCRIPTOR)
field(CALCULATEDLIFECYCLE_DESCRIPTOR)
field(COMPLETIONDATE_DESCRIPTOR)
field(COMPOSITEMEMBERIDENTIFIER_DESCRIPTOR)
field(CREATEDBY_DESCRIPTOR)
field(CREATIONDATE_DESCRIPTOR)
field(ENCRYPTIONKEYARN_DESCRIPTOR)
field(IAMROLEARN_DESCRIPTOR)
field(ISENCRYPTED_DESCRIPTOR)
field(ISPARENT_DESCRIPTOR)
field(LASTRESTORETIME_DESCRIPTOR)
field(LIFECYCLE_DESCRIPTOR)
field(PARENTRECOVERYPOINTARN_DESCRIPTOR)
field(RECOVERYPOINTARN_DESCRIPTOR)
field(RESOURCEARN_DESCRIPTOR)
field(RESOURCENAME_DESCRIPTOR)
field(RESOURCETYPE_DESCRIPTOR)
field(SOURCEBACKUPVAULTARN_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(STATUSMESSAGE_DESCRIPTOR)
field(VAULTTYPE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
BACKUPSIZEINBYTES_DESCRIPTOR.index -> builder.backupSizeInBytes = deserializeLong()
BACKUPVAULTARN_DESCRIPTOR.index -> builder.backupVaultArn = deserializeString()
BACKUPVAULTNAME_DESCRIPTOR.index -> builder.backupVaultName = deserializeString()
CALCULATEDLIFECYCLE_DESCRIPTOR.index -> builder.calculatedLifecycle = deserializeCalculatedLifecycleDocument(deserializer)
COMPLETIONDATE_DESCRIPTOR.index -> builder.completionDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
COMPOSITEMEMBERIDENTIFIER_DESCRIPTOR.index -> builder.compositeMemberIdentifier = deserializeString()
CREATEDBY_DESCRIPTOR.index -> builder.createdBy = deserializeRecoveryPointCreatorDocument(deserializer)
CREATIONDATE_DESCRIPTOR.index -> builder.creationDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
ENCRYPTIONKEYARN_DESCRIPTOR.index -> builder.encryptionKeyArn = deserializeString()
IAMROLEARN_DESCRIPTOR.index -> builder.iamRoleArn = deserializeString()
ISENCRYPTED_DESCRIPTOR.index -> builder.isEncrypted = deserializeBoolean()
ISPARENT_DESCRIPTOR.index -> builder.isParent = deserializeBoolean()
LASTRESTORETIME_DESCRIPTOR.index -> builder.lastRestoreTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
LIFECYCLE_DESCRIPTOR.index -> builder.lifecycle = deserializeLifecycleDocument(deserializer)
PARENTRECOVERYPOINTARN_DESCRIPTOR.index -> builder.parentRecoveryPointArn = deserializeString()
RECOVERYPOINTARN_DESCRIPTOR.index -> builder.recoveryPointArn = deserializeString()
RESOURCEARN_DESCRIPTOR.index -> builder.resourceArn = deserializeString()
RESOURCENAME_DESCRIPTOR.index -> builder.resourceName = deserializeString()
RESOURCETYPE_DESCRIPTOR.index -> builder.resourceType = deserializeString()
SOURCEBACKUPVAULTARN_DESCRIPTOR.index -> builder.sourceBackupVaultArn = 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()
}