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

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

There is a newer version: 1.3.76
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.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()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy