All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.autoscaling.serde.InstanceRefreshDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.99
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.autoscaling.serde

import aws.sdk.kotlin.services.autoscaling.model.InstanceRefresh
import aws.sdk.kotlin.services.autoscaling.model.InstanceRefreshStatus
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.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import aws.smithy.kotlin.runtime.serde.xml.XmlDeserializer
import aws.smithy.kotlin.runtime.serde.xml.XmlNamespace
import aws.smithy.kotlin.runtime.serde.xml.XmlSerialName
import aws.smithy.kotlin.runtime.time.Instant

internal fun deserializeInstanceRefreshDocument(deserializer: Deserializer): InstanceRefresh {
    val builder = InstanceRefresh.Builder()
    val AUTOSCALINGGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("AutoScalingGroupName"))
    val DESIREDCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("DesiredConfiguration"))
    val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, XmlSerialName("EndTime"))
    val INSTANCEREFRESHID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("InstanceRefreshId"))
    val INSTANCESTOUPDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("InstancesToUpdate"))
    val PERCENTAGECOMPLETE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("PercentageComplete"))
    val PREFERENCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("Preferences"))
    val PROGRESSDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("ProgressDetails"))
    val ROLLBACKDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("RollbackDetails"))
    val STARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, XmlSerialName("StartTime"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, XmlSerialName("Status"))
    val STATUSREASON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("StatusReason"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        trait(XmlSerialName("InstanceRefresh"))
        trait(XmlNamespace("http://autoscaling.amazonaws.com/doc/2011-01-01/"))
        field(AUTOSCALINGGROUPNAME_DESCRIPTOR)
        field(DESIREDCONFIGURATION_DESCRIPTOR)
        field(ENDTIME_DESCRIPTOR)
        field(INSTANCEREFRESHID_DESCRIPTOR)
        field(INSTANCESTOUPDATE_DESCRIPTOR)
        field(PERCENTAGECOMPLETE_DESCRIPTOR)
        field(PREFERENCES_DESCRIPTOR)
        field(PROGRESSDETAILS_DESCRIPTOR)
        field(ROLLBACKDETAILS_DESCRIPTOR)
        field(STARTTIME_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(STATUSREASON_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AUTOSCALINGGROUPNAME_DESCRIPTOR.index -> builder.autoScalingGroupName = deserializeString()
                DESIREDCONFIGURATION_DESCRIPTOR.index -> builder.desiredConfiguration = deserializeDesiredConfigurationDocument(deserializer)
                ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeString().let { Instant.fromIso8601(it) }
                INSTANCEREFRESHID_DESCRIPTOR.index -> builder.instanceRefreshId = deserializeString()
                INSTANCESTOUPDATE_DESCRIPTOR.index -> builder.instancesToUpdate = deserializeInt()
                PERCENTAGECOMPLETE_DESCRIPTOR.index -> builder.percentageComplete = deserializeInt()
                PREFERENCES_DESCRIPTOR.index -> builder.preferences = deserializeRefreshPreferencesDocument(deserializer)
                PROGRESSDETAILS_DESCRIPTOR.index -> builder.progressDetails = deserializeInstanceRefreshProgressDetailsDocument(deserializer)
                ROLLBACKDETAILS_DESCRIPTOR.index -> builder.rollbackDetails = deserializeRollbackDetailsDocument(deserializer)
                STARTTIME_DESCRIPTOR.index -> builder.startTime = deserializeString().let { Instant.fromIso8601(it) }
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { InstanceRefreshStatus.fromValue(it) }
                STATUSREASON_DESCRIPTOR.index -> builder.statusReason = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy