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

commonMain.aws.sdk.kotlin.services.autoscaling.serde.RefreshPreferencesDocumentDeserializer.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.RefreshPreferences
import aws.sdk.kotlin.services.autoscaling.model.ScaleInProtectedInstances
import aws.sdk.kotlin.services.autoscaling.model.StandbyInstances
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parse
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 deserializeRefreshPreferencesDocument(reader: XmlTagReader): RefreshPreferences {
    val builder = RefreshPreferences.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // MinHealthyPercentage com.amazonaws.autoscaling#RefreshPreferences$MinHealthyPercentage
            "MinHealthyPercentage" -> builder.minHealthyPercentage = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#IntPercent`)" }
            // InstanceWarmup com.amazonaws.autoscaling#RefreshPreferences$InstanceWarmup
            "InstanceWarmup" -> builder.instanceWarmup = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#RefreshInstanceWarmup`)" }
            // CheckpointPercentages com.amazonaws.autoscaling#RefreshPreferences$CheckpointPercentages
            "CheckpointPercentages" -> builder.checkpointPercentages = deserializeCheckpointPercentagesShape(curr)
            // CheckpointDelay com.amazonaws.autoscaling#RefreshPreferences$CheckpointDelay
            "CheckpointDelay" -> builder.checkpointDelay = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#CheckpointDelay`)" }
            // SkipMatching com.amazonaws.autoscaling#RefreshPreferences$SkipMatching
            "SkipMatching" -> builder.skipMatching = curr.tryData()
                .parseBoolean()
                .getOrDeserializeErr { "expected (boolean: `com.amazonaws.autoscaling#SkipMatching`)" }
            // AutoRollback com.amazonaws.autoscaling#RefreshPreferences$AutoRollback
            "AutoRollback" -> builder.autoRollback = curr.tryData()
                .parseBoolean()
                .getOrDeserializeErr { "expected (boolean: `com.amazonaws.autoscaling#AutoRollback`)" }
            // ScaleInProtectedInstances com.amazonaws.autoscaling#RefreshPreferences$ScaleInProtectedInstances
            "ScaleInProtectedInstances" -> builder.scaleInProtectedInstances = curr.tryData()
                .parse { ScaleInProtectedInstances.fromValue(it) }
                .getOrDeserializeErr { "expected (enum: `com.amazonaws.autoscaling#ScaleInProtectedInstances`)" }
            // StandbyInstances com.amazonaws.autoscaling#RefreshPreferences$StandbyInstances
            "StandbyInstances" -> builder.standbyInstances = curr.tryData()
                .parse { StandbyInstances.fromValue(it) }
                .getOrDeserializeErr { "expected (enum: `com.amazonaws.autoscaling#StandbyInstances`)" }
            // AlarmSpecification com.amazonaws.autoscaling#RefreshPreferences$AlarmSpecification
            "AlarmSpecification" -> builder.alarmSpecification = deserializeAlarmSpecificationDocument(curr)
            // MaxHealthyPercentage com.amazonaws.autoscaling#RefreshPreferences$MaxHealthyPercentage
            "MaxHealthyPercentage" -> builder.maxHealthyPercentage = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#IntPercent100To200`)" }
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy