commonMain.aws.sdk.kotlin.services.backupgateway.serde.HypervisorDetailsDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of backupgateway-jvm Show documentation
Show all versions of backupgateway-jvm Show documentation
The AWS Kotlin client for Backup Gateway
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.backupgateway.serde
import aws.sdk.kotlin.services.backupgateway.model.HypervisorDetails
import aws.sdk.kotlin.services.backupgateway.model.HypervisorState
import aws.sdk.kotlin.services.backupgateway.model.SyncMetadataStatus
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 deserializeHypervisorDetailsDocument(deserializer: Deserializer): HypervisorDetails {
val builder = HypervisorDetails.Builder()
val HOST_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Host"))
val HYPERVISORARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("HypervisorArn"))
val KMSKEYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("KmsKeyArn"))
val LASTSUCCESSFULMETADATASYNCTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastSuccessfulMetadataSyncTime"))
val LATESTMETADATASYNCSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LatestMetadataSyncStatus"))
val LATESTMETADATASYNCSTATUSMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LatestMetadataSyncStatusMessage"))
val LOGGROUPARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LogGroupArn"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("State"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(HOST_DESCRIPTOR)
field(HYPERVISORARN_DESCRIPTOR)
field(KMSKEYARN_DESCRIPTOR)
field(LASTSUCCESSFULMETADATASYNCTIME_DESCRIPTOR)
field(LATESTMETADATASYNCSTATUS_DESCRIPTOR)
field(LATESTMETADATASYNCSTATUSMESSAGE_DESCRIPTOR)
field(LOGGROUPARN_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(STATE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
HOST_DESCRIPTOR.index -> builder.host = deserializeString()
HYPERVISORARN_DESCRIPTOR.index -> builder.hypervisorArn = deserializeString()
KMSKEYARN_DESCRIPTOR.index -> builder.kmsKeyArn = deserializeString()
LASTSUCCESSFULMETADATASYNCTIME_DESCRIPTOR.index -> builder.lastSuccessfulMetadataSyncTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
LATESTMETADATASYNCSTATUS_DESCRIPTOR.index -> builder.latestMetadataSyncStatus = deserializeString().let { SyncMetadataStatus.fromValue(it) }
LATESTMETADATASYNCSTATUSMESSAGE_DESCRIPTOR.index -> builder.latestMetadataSyncStatusMessage = deserializeString()
LOGGROUPARN_DESCRIPTOR.index -> builder.logGroupArn = deserializeString()
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { HypervisorState.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy