commonMain.aws.sdk.kotlin.services.autoscaling.serde.ScalingPolicyDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of autoscaling-jvm Show documentation
Show all versions of autoscaling-jvm Show documentation
The AWS SDK for Kotlin client for Auto Scaling
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.autoscaling.serde
import aws.sdk.kotlin.services.autoscaling.model.ScalingPolicy
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parseBoolean
import aws.smithy.kotlin.runtime.serde.parseInt
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData
internal fun deserializeScalingPolicyDocument(reader: XmlTagReader): ScalingPolicy {
val builder = ScalingPolicy.Builder()
loop@while (true) {
val curr = reader.nextTag() ?: break@loop
when (curr.tagName) {
// AutoScalingGroupName com.amazonaws.autoscaling#ScalingPolicy$AutoScalingGroupName
"AutoScalingGroupName" -> builder.autoScalingGroupName = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen255`)" }
// PolicyName com.amazonaws.autoscaling#ScalingPolicy$PolicyName
"PolicyName" -> builder.policyName = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen255`)" }
// PolicyARN com.amazonaws.autoscaling#ScalingPolicy$PolicyARN
"PolicyARN" -> builder.policyArn = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#ResourceName`)" }
// PolicyType com.amazonaws.autoscaling#ScalingPolicy$PolicyType
"PolicyType" -> builder.policyType = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen64`)" }
// AdjustmentType com.amazonaws.autoscaling#ScalingPolicy$AdjustmentType
"AdjustmentType" -> builder.adjustmentType = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen255`)" }
// MinAdjustmentStep com.amazonaws.autoscaling#ScalingPolicy$MinAdjustmentStep
"MinAdjustmentStep" -> builder.minAdjustmentStep = curr.tryData()
.parseInt()
.getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#MinAdjustmentStep`)" }
// MinAdjustmentMagnitude com.amazonaws.autoscaling#ScalingPolicy$MinAdjustmentMagnitude
"MinAdjustmentMagnitude" -> builder.minAdjustmentMagnitude = curr.tryData()
.parseInt()
.getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#MinAdjustmentMagnitude`)" }
// ScalingAdjustment com.amazonaws.autoscaling#ScalingPolicy$ScalingAdjustment
"ScalingAdjustment" -> builder.scalingAdjustment = curr.tryData()
.parseInt()
.getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#PolicyIncrement`)" }
// Cooldown com.amazonaws.autoscaling#ScalingPolicy$Cooldown
"Cooldown" -> builder.cooldown = curr.tryData()
.parseInt()
.getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#Cooldown`)" }
// StepAdjustments com.amazonaws.autoscaling#ScalingPolicy$StepAdjustments
"StepAdjustments" -> builder.stepAdjustments = deserializeStepAdjustmentsShape(curr)
// MetricAggregationType com.amazonaws.autoscaling#ScalingPolicy$MetricAggregationType
"MetricAggregationType" -> builder.metricAggregationType = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen32`)" }
// EstimatedInstanceWarmup com.amazonaws.autoscaling#ScalingPolicy$EstimatedInstanceWarmup
"EstimatedInstanceWarmup" -> builder.estimatedInstanceWarmup = curr.tryData()
.parseInt()
.getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#EstimatedInstanceWarmup`)" }
// Alarms com.amazonaws.autoscaling#ScalingPolicy$Alarms
"Alarms" -> builder.alarms = deserializeAlarmsShape(curr)
// TargetTrackingConfiguration com.amazonaws.autoscaling#ScalingPolicy$TargetTrackingConfiguration
"TargetTrackingConfiguration" -> builder.targetTrackingConfiguration = deserializeTargetTrackingConfigurationDocument(curr)
// Enabled com.amazonaws.autoscaling#ScalingPolicy$Enabled
"Enabled" -> builder.enabled = curr.tryData()
.parseBoolean()
.getOrDeserializeErr { "expected (boolean: `com.amazonaws.autoscaling#ScalingPolicyEnabled`)" }
// PredictiveScalingConfiguration com.amazonaws.autoscaling#ScalingPolicy$PredictiveScalingConfiguration
"PredictiveScalingConfiguration" -> builder.predictiveScalingConfiguration = deserializePredictiveScalingConfigurationDocument(curr)
else -> {}
}
curr.drop()
}
builder.correctErrors()
return builder.build()
}