commonMain.aws.sdk.kotlin.services.backupgateway.serde.GatewayDetailsDocumentDeserializer.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 SDK for 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.GatewayDetails
import aws.sdk.kotlin.services.backupgateway.model.GatewayType
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 deserializeGatewayDetailsDocument(deserializer: Deserializer): GatewayDetails {
val builder = GatewayDetails.Builder()
val GATEWAYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("GatewayArn"))
val GATEWAYDISPLAYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("GatewayDisplayName"))
val GATEWAYTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("GatewayType"))
val HYPERVISORID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("HypervisorId"))
val LASTSEENTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastSeenTime"))
val MAINTENANCESTARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("MaintenanceStartTime"))
val NEXTUPDATEAVAILABILITYTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("NextUpdateAvailabilityTime"))
val VPCENDPOINT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("VpcEndpoint"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(GATEWAYARN_DESCRIPTOR)
field(GATEWAYDISPLAYNAME_DESCRIPTOR)
field(GATEWAYTYPE_DESCRIPTOR)
field(HYPERVISORID_DESCRIPTOR)
field(LASTSEENTIME_DESCRIPTOR)
field(MAINTENANCESTARTTIME_DESCRIPTOR)
field(NEXTUPDATEAVAILABILITYTIME_DESCRIPTOR)
field(VPCENDPOINT_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
GATEWAYARN_DESCRIPTOR.index -> builder.gatewayArn = deserializeString()
GATEWAYDISPLAYNAME_DESCRIPTOR.index -> builder.gatewayDisplayName = deserializeString()
GATEWAYTYPE_DESCRIPTOR.index -> builder.gatewayType = deserializeString().let { GatewayType.fromValue(it) }
HYPERVISORID_DESCRIPTOR.index -> builder.hypervisorId = deserializeString()
LASTSEENTIME_DESCRIPTOR.index -> builder.lastSeenTime = deserializeString().let { Instant.fromEpochSeconds(it) }
MAINTENANCESTARTTIME_DESCRIPTOR.index -> builder.maintenanceStartTime = deserializeMaintenanceStartTimeDocument(deserializer)
NEXTUPDATEAVAILABILITYTIME_DESCRIPTOR.index -> builder.nextUpdateAvailabilityTime = deserializeString().let { Instant.fromEpochSeconds(it) }
VPCENDPOINT_DESCRIPTOR.index -> builder.vpcEndpoint = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}