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

commonMain.aws.sdk.kotlin.services.autoscaling.serde.PredictiveScalingMetricSpecificationDocumentDeserializer.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.PredictiveScalingMetricSpecification
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parseDouble
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData

internal fun deserializePredictiveScalingMetricSpecificationDocument(reader: XmlTagReader): PredictiveScalingMetricSpecification {
    val builder = PredictiveScalingMetricSpecification.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // TargetValue com.amazonaws.autoscaling#PredictiveScalingMetricSpecification$TargetValue
            "TargetValue" -> builder.targetValue = curr.tryData()
                .parseDouble()
                .getOrDeserializeErr { "expected (double: `com.amazonaws.autoscaling#MetricScale`)" }
            // PredefinedMetricPairSpecification com.amazonaws.autoscaling#PredictiveScalingMetricSpecification$PredefinedMetricPairSpecification
            "PredefinedMetricPairSpecification" -> builder.predefinedMetricPairSpecification = deserializePredictiveScalingPredefinedMetricPairDocument(curr)
            // PredefinedScalingMetricSpecification com.amazonaws.autoscaling#PredictiveScalingMetricSpecification$PredefinedScalingMetricSpecification
            "PredefinedScalingMetricSpecification" -> builder.predefinedScalingMetricSpecification = deserializePredictiveScalingPredefinedScalingMetricDocument(curr)
            // PredefinedLoadMetricSpecification com.amazonaws.autoscaling#PredictiveScalingMetricSpecification$PredefinedLoadMetricSpecification
            "PredefinedLoadMetricSpecification" -> builder.predefinedLoadMetricSpecification = deserializePredictiveScalingPredefinedLoadMetricDocument(curr)
            // CustomizedScalingMetricSpecification com.amazonaws.autoscaling#PredictiveScalingMetricSpecification$CustomizedScalingMetricSpecification
            "CustomizedScalingMetricSpecification" -> builder.customizedScalingMetricSpecification = deserializePredictiveScalingCustomizedScalingMetricDocument(curr)
            // CustomizedLoadMetricSpecification com.amazonaws.autoscaling#PredictiveScalingMetricSpecification$CustomizedLoadMetricSpecification
            "CustomizedLoadMetricSpecification" -> builder.customizedLoadMetricSpecification = deserializePredictiveScalingCustomizedLoadMetricDocument(curr)
            // CustomizedCapacityMetricSpecification com.amazonaws.autoscaling#PredictiveScalingMetricSpecification$CustomizedCapacityMetricSpecification
            "CustomizedCapacityMetricSpecification" -> builder.customizedCapacityMetricSpecification = deserializePredictiveScalingCustomizedCapacityMetricDocument(curr)
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy