commonMain.aws.sdk.kotlin.services.autoscaling.serde.AutoScalingGroupDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.autoscaling.serde
import aws.sdk.kotlin.services.autoscaling.model.AutoScalingGroup
import aws.sdk.kotlin.services.autoscaling.model.EnabledMetric
import aws.sdk.kotlin.services.autoscaling.model.Instance
import aws.sdk.kotlin.services.autoscaling.model.SuspendedProcess
import aws.sdk.kotlin.services.autoscaling.model.TagDescription
import aws.sdk.kotlin.services.autoscaling.model.TrafficSourceIdentifier
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
import kotlin.collections.mutableListOf
internal fun deserializeAutoScalingGroupDocument(deserializer: Deserializer): AutoScalingGroup {
val builder = AutoScalingGroup.Builder()
val AUTOSCALINGGROUPARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("AutoScalingGroupARN"))
val AUTOSCALINGGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("AutoScalingGroupName"))
val AVAILABILITYZONES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("AvailabilityZones"))
val CAPACITYREBALANCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, XmlSerialName("CapacityRebalance"))
val CONTEXT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("Context"))
val CREATEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, XmlSerialName("CreatedTime"))
val DEFAULTCOOLDOWN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("DefaultCooldown"))
val DEFAULTINSTANCEWARMUP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("DefaultInstanceWarmup"))
val DESIREDCAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("DesiredCapacity"))
val DESIREDCAPACITYTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("DesiredCapacityType"))
val ENABLEDMETRICS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("EnabledMetrics"))
val HEALTHCHECKGRACEPERIOD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("HealthCheckGracePeriod"))
val HEALTHCHECKTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("HealthCheckType"))
val INSTANCEMAINTENANCEPOLICY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("InstanceMaintenancePolicy"))
val INSTANCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("Instances"))
val LAUNCHCONFIGURATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("LaunchConfigurationName"))
val LAUNCHTEMPLATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("LaunchTemplate"))
val LOADBALANCERNAMES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("LoadBalancerNames"))
val MAXINSTANCELIFETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("MaxInstanceLifetime"))
val MAXSIZE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("MaxSize"))
val MINSIZE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("MinSize"))
val MIXEDINSTANCESPOLICY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("MixedInstancesPolicy"))
val NEWINSTANCESPROTECTEDFROMSCALEIN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, XmlSerialName("NewInstancesProtectedFromScaleIn"))
val PLACEMENTGROUP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("PlacementGroup"))
val PREDICTEDCAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("PredictedCapacity"))
val SERVICELINKEDROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("ServiceLinkedRoleARN"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("Status"))
val SUSPENDEDPROCESSES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("SuspendedProcesses"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("Tags"))
val TARGETGROUPARNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("TargetGroupARNs"))
val TERMINATIONPOLICIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("TerminationPolicies"))
val TRAFFICSOURCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("TrafficSources"))
val VPCZONEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("VPCZoneIdentifier"))
val WARMPOOLCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("WarmPoolConfiguration"))
val WARMPOOLSIZE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("WarmPoolSize"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
trait(XmlSerialName("AutoScalingGroup"))
trait(XmlNamespace("http://autoscaling.amazonaws.com/doc/2011-01-01/"))
field(AUTOSCALINGGROUPARN_DESCRIPTOR)
field(AUTOSCALINGGROUPNAME_DESCRIPTOR)
field(AVAILABILITYZONES_DESCRIPTOR)
field(CAPACITYREBALANCE_DESCRIPTOR)
field(CONTEXT_DESCRIPTOR)
field(CREATEDTIME_DESCRIPTOR)
field(DEFAULTCOOLDOWN_DESCRIPTOR)
field(DEFAULTINSTANCEWARMUP_DESCRIPTOR)
field(DESIREDCAPACITY_DESCRIPTOR)
field(DESIREDCAPACITYTYPE_DESCRIPTOR)
field(ENABLEDMETRICS_DESCRIPTOR)
field(HEALTHCHECKGRACEPERIOD_DESCRIPTOR)
field(HEALTHCHECKTYPE_DESCRIPTOR)
field(INSTANCEMAINTENANCEPOLICY_DESCRIPTOR)
field(INSTANCES_DESCRIPTOR)
field(LAUNCHCONFIGURATIONNAME_DESCRIPTOR)
field(LAUNCHTEMPLATE_DESCRIPTOR)
field(LOADBALANCERNAMES_DESCRIPTOR)
field(MAXINSTANCELIFETIME_DESCRIPTOR)
field(MAXSIZE_DESCRIPTOR)
field(MINSIZE_DESCRIPTOR)
field(MIXEDINSTANCESPOLICY_DESCRIPTOR)
field(NEWINSTANCESPROTECTEDFROMSCALEIN_DESCRIPTOR)
field(PLACEMENTGROUP_DESCRIPTOR)
field(PREDICTEDCAPACITY_DESCRIPTOR)
field(SERVICELINKEDROLEARN_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(SUSPENDEDPROCESSES_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(TARGETGROUPARNS_DESCRIPTOR)
field(TERMINATIONPOLICIES_DESCRIPTOR)
field(TRAFFICSOURCES_DESCRIPTOR)
field(VPCZONEIDENTIFIER_DESCRIPTOR)
field(WARMPOOLCONFIGURATION_DESCRIPTOR)
field(WARMPOOLSIZE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
AUTOSCALINGGROUPARN_DESCRIPTOR.index -> builder.autoScalingGroupArn = deserializeString()
AUTOSCALINGGROUPNAME_DESCRIPTOR.index -> builder.autoScalingGroupName = deserializeString()
AVAILABILITYZONES_DESCRIPTOR.index -> builder.availabilityZones =
deserializer.deserializeList(AVAILABILITYZONES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
CAPACITYREBALANCE_DESCRIPTOR.index -> builder.capacityRebalance = deserializeBoolean()
CONTEXT_DESCRIPTOR.index -> builder.context = deserializeString()
CREATEDTIME_DESCRIPTOR.index -> builder.createdTime = deserializeString().let { Instant.fromIso8601(it) }
DEFAULTCOOLDOWN_DESCRIPTOR.index -> builder.defaultCooldown = deserializeInt()
DEFAULTINSTANCEWARMUP_DESCRIPTOR.index -> builder.defaultInstanceWarmup = deserializeInt()
DESIREDCAPACITY_DESCRIPTOR.index -> builder.desiredCapacity = deserializeInt()
DESIREDCAPACITYTYPE_DESCRIPTOR.index -> builder.desiredCapacityType = deserializeString()
ENABLEDMETRICS_DESCRIPTOR.index -> builder.enabledMetrics =
deserializer.deserializeList(ENABLEDMETRICS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeEnabledMetricDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
HEALTHCHECKGRACEPERIOD_DESCRIPTOR.index -> builder.healthCheckGracePeriod = deserializeInt()
HEALTHCHECKTYPE_DESCRIPTOR.index -> builder.healthCheckType = deserializeString()
INSTANCEMAINTENANCEPOLICY_DESCRIPTOR.index -> builder.instanceMaintenancePolicy = deserializeInstanceMaintenancePolicyDocument(deserializer)
INSTANCES_DESCRIPTOR.index -> builder.instances =
deserializer.deserializeList(INSTANCES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeInstanceDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
LAUNCHCONFIGURATIONNAME_DESCRIPTOR.index -> builder.launchConfigurationName = deserializeString()
LAUNCHTEMPLATE_DESCRIPTOR.index -> builder.launchTemplate = deserializeLaunchTemplateSpecificationDocument(deserializer)
LOADBALANCERNAMES_DESCRIPTOR.index -> builder.loadBalancerNames =
deserializer.deserializeList(LOADBALANCERNAMES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
MAXINSTANCELIFETIME_DESCRIPTOR.index -> builder.maxInstanceLifetime = deserializeInt()
MAXSIZE_DESCRIPTOR.index -> builder.maxSize = deserializeInt()
MINSIZE_DESCRIPTOR.index -> builder.minSize = deserializeInt()
MIXEDINSTANCESPOLICY_DESCRIPTOR.index -> builder.mixedInstancesPolicy = deserializeMixedInstancesPolicyDocument(deserializer)
NEWINSTANCESPROTECTEDFROMSCALEIN_DESCRIPTOR.index -> builder.newInstancesProtectedFromScaleIn = deserializeBoolean()
PLACEMENTGROUP_DESCRIPTOR.index -> builder.placementGroup = deserializeString()
PREDICTEDCAPACITY_DESCRIPTOR.index -> builder.predictedCapacity = deserializeInt()
SERVICELINKEDROLEARN_DESCRIPTOR.index -> builder.serviceLinkedRoleArn = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString()
SUSPENDEDPROCESSES_DESCRIPTOR.index -> builder.suspendedProcesses =
deserializer.deserializeList(SUSPENDEDPROCESSES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeSuspendedProcessDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
TAGS_DESCRIPTOR.index -> builder.tags =
deserializer.deserializeList(TAGS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeTagDescriptionDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
TARGETGROUPARNS_DESCRIPTOR.index -> builder.targetGroupArns =
deserializer.deserializeList(TARGETGROUPARNS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
TERMINATIONPOLICIES_DESCRIPTOR.index -> builder.terminationPolicies =
deserializer.deserializeList(TERMINATIONPOLICIES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
TRAFFICSOURCES_DESCRIPTOR.index -> builder.trafficSources =
deserializer.deserializeList(TRAFFICSOURCES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeTrafficSourceIdentifierDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
VPCZONEIDENTIFIER_DESCRIPTOR.index -> builder.vpcZoneIdentifier = deserializeString()
WARMPOOLCONFIGURATION_DESCRIPTOR.index -> builder.warmPoolConfiguration = deserializeWarmPoolConfigurationDocument(deserializer)
WARMPOOLSIZE_DESCRIPTOR.index -> builder.warmPoolSize = deserializeInt()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy