
commonMain.aws.sdk.kotlin.services.opensearch.serde.ServiceSoftwareOptionsDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.opensearch.serde
import aws.sdk.kotlin.services.opensearch.model.DeploymentStatus
import aws.sdk.kotlin.services.opensearch.model.ServiceSoftwareOptions
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 deserializeServiceSoftwareOptionsDocument(deserializer: Deserializer): ServiceSoftwareOptions {
val builder = ServiceSoftwareOptions.Builder()
val AUTOMATEDUPDATEDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("AutomatedUpdateDate"))
val CANCELLABLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("Cancellable"))
val CURRENTVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CurrentVersion"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val NEWVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("NewVersion"))
val OPTIONALDEPLOYMENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("OptionalDeployment"))
val UPDATEAVAILABLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("UpdateAvailable"))
val UPDATESTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("UpdateStatus"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(AUTOMATEDUPDATEDATE_DESCRIPTOR)
field(CANCELLABLE_DESCRIPTOR)
field(CURRENTVERSION_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(NEWVERSION_DESCRIPTOR)
field(OPTIONALDEPLOYMENT_DESCRIPTOR)
field(UPDATEAVAILABLE_DESCRIPTOR)
field(UPDATESTATUS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
AUTOMATEDUPDATEDATE_DESCRIPTOR.index -> builder.automatedUpdateDate = deserializeString().let { Instant.fromEpochSeconds(it) }
CANCELLABLE_DESCRIPTOR.index -> builder.cancellable = deserializeBoolean()
CURRENTVERSION_DESCRIPTOR.index -> builder.currentVersion = deserializeString()
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
NEWVERSION_DESCRIPTOR.index -> builder.newVersion = deserializeString()
OPTIONALDEPLOYMENT_DESCRIPTOR.index -> builder.optionalDeployment = deserializeBoolean()
UPDATEAVAILABLE_DESCRIPTOR.index -> builder.updateAvailable = deserializeBoolean()
UPDATESTATUS_DESCRIPTOR.index -> builder.updateStatus = deserializeString().let { DeploymentStatus.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy