commonMain.aws.sdk.kotlin.services.autoscaling.serde.PredictiveScalingMetricSpecificationDocumentDeserializer.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.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()
}