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

commonMain.aws.sdk.kotlin.services.autoscaling.serde.ActivityDocumentDeserializer.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.Activity
import aws.sdk.kotlin.services.autoscaling.model.ScalingActivityStatusCode
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 deserializeActivityDocument(deserializer: Deserializer): Activity {
    val builder = Activity.Builder()
    val ACTIVITYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("ActivityId"))
    val AUTOSCALINGGROUPARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("AutoScalingGroupARN"))
    val AUTOSCALINGGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("AutoScalingGroupName"))
    val AUTOSCALINGGROUPSTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("AutoScalingGroupState"))
    val CAUSE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("Cause"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("Description"))
    val DETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("Details"))
    val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, XmlSerialName("EndTime"))
    val PROGRESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("Progress"))
    val STARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, XmlSerialName("StartTime"))
    val STATUSCODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, XmlSerialName("StatusCode"))
    val STATUSMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("StatusMessage"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        trait(XmlSerialName("Activity"))
        trait(XmlNamespace("http://autoscaling.amazonaws.com/doc/2011-01-01/"))
        field(ACTIVITYID_DESCRIPTOR)
        field(AUTOSCALINGGROUPARN_DESCRIPTOR)
        field(AUTOSCALINGGROUPNAME_DESCRIPTOR)
        field(AUTOSCALINGGROUPSTATE_DESCRIPTOR)
        field(CAUSE_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(DETAILS_DESCRIPTOR)
        field(ENDTIME_DESCRIPTOR)
        field(PROGRESS_DESCRIPTOR)
        field(STARTTIME_DESCRIPTOR)
        field(STATUSCODE_DESCRIPTOR)
        field(STATUSMESSAGE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACTIVITYID_DESCRIPTOR.index -> builder.activityId = deserializeString()
                AUTOSCALINGGROUPARN_DESCRIPTOR.index -> builder.autoScalingGroupArn = deserializeString()
                AUTOSCALINGGROUPNAME_DESCRIPTOR.index -> builder.autoScalingGroupName = deserializeString()
                AUTOSCALINGGROUPSTATE_DESCRIPTOR.index -> builder.autoScalingGroupState = deserializeString()
                CAUSE_DESCRIPTOR.index -> builder.cause = deserializeString()
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                DETAILS_DESCRIPTOR.index -> builder.details = deserializeString()
                ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeString().let { Instant.fromIso8601(it) }
                PROGRESS_DESCRIPTOR.index -> builder.progress = deserializeInt()
                STARTTIME_DESCRIPTOR.index -> builder.startTime = deserializeString().let { Instant.fromIso8601(it) }
                STATUSCODE_DESCRIPTOR.index -> builder.statusCode = deserializeString().let { ScalingActivityStatusCode.fromValue(it) }
                STATUSMESSAGE_DESCRIPTOR.index -> builder.statusMessage = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy