commonMain.aws.sdk.kotlin.services.elasticsearchservice.transform.DomainPackageDetailsDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearchservice Show documentation
Show all versions of elasticsearchservice Show documentation
Amazon Elasticsearch Service
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.elasticsearchservice.transform
import aws.sdk.kotlin.services.elasticsearchservice.model.DomainPackageDetails
import aws.sdk.kotlin.services.elasticsearchservice.model.DomainPackageStatus
import aws.sdk.kotlin.services.elasticsearchservice.model.PackageType
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 deserializeDomainPackageDetailsDocument(deserializer: Deserializer): DomainPackageDetails {
val builder = DomainPackageDetails.Builder()
val DOMAINNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DomainName"))
val DOMAINPACKAGESTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("DomainPackageStatus"))
val ERRORDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ErrorDetails"))
val LASTUPDATED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastUpdated"))
val PACKAGEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PackageID"))
val PACKAGENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PackageName"))
val PACKAGETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("PackageType"))
val PACKAGEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PackageVersion"))
val REFERENCEPATH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReferencePath"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DOMAINNAME_DESCRIPTOR)
field(DOMAINPACKAGESTATUS_DESCRIPTOR)
field(ERRORDETAILS_DESCRIPTOR)
field(LASTUPDATED_DESCRIPTOR)
field(PACKAGEID_DESCRIPTOR)
field(PACKAGENAME_DESCRIPTOR)
field(PACKAGETYPE_DESCRIPTOR)
field(PACKAGEVERSION_DESCRIPTOR)
field(REFERENCEPATH_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
DOMAINNAME_DESCRIPTOR.index -> builder.domainName = deserializeString()
DOMAINPACKAGESTATUS_DESCRIPTOR.index -> builder.domainPackageStatus = deserializeString().let { DomainPackageStatus.fromValue(it) }
ERRORDETAILS_DESCRIPTOR.index -> builder.errorDetails = deserializeErrorDetailsDocument(deserializer)
LASTUPDATED_DESCRIPTOR.index -> builder.lastUpdated = deserializeString().let { Instant.fromEpochSeconds(it) }
PACKAGEID_DESCRIPTOR.index -> builder.packageId = deserializeString()
PACKAGENAME_DESCRIPTOR.index -> builder.packageName = deserializeString()
PACKAGETYPE_DESCRIPTOR.index -> builder.packageType = deserializeString().let { PackageType.fromValue(it) }
PACKAGEVERSION_DESCRIPTOR.index -> builder.packageVersion = deserializeString()
REFERENCEPATH_DESCRIPTOR.index -> builder.referencePath = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy