commonMain.aws.sdk.kotlin.services.route53.serde.CloudWatchAlarmConfigurationDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of route53-jvm Show documentation
Show all versions of route53-jvm Show documentation
The AWS SDK for Kotlin client for Route 53
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.route53.serde
import aws.sdk.kotlin.services.route53.model.CloudWatchAlarmConfiguration
import aws.sdk.kotlin.services.route53.model.ComparisonOperator
import aws.sdk.kotlin.services.route53.model.Statistic
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parse
import aws.smithy.kotlin.runtime.serde.parseDouble
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 deserializeCloudWatchAlarmConfigurationDocument(reader: XmlTagReader): CloudWatchAlarmConfiguration {
val builder = CloudWatchAlarmConfiguration.Builder()
loop@while (true) {
val curr = reader.nextTag() ?: break@loop
when (curr.tagName) {
// EvaluationPeriods com.amazonaws.route53#CloudWatchAlarmConfiguration$EvaluationPeriods
"EvaluationPeriods" -> builder.evaluationPeriods = curr.tryData()
.parseInt()
.getOrDeserializeErr { "expected (integer: `com.amazonaws.route53#EvaluationPeriods`)" }
// Threshold com.amazonaws.route53#CloudWatchAlarmConfiguration$Threshold
"Threshold" -> builder.threshold = curr.tryData()
.parseDouble()
.getOrDeserializeErr { "expected (double: `com.amazonaws.route53#Threshold`)" }
// ComparisonOperator com.amazonaws.route53#CloudWatchAlarmConfiguration$ComparisonOperator
"ComparisonOperator" -> builder.comparisonOperator = curr.tryData()
.parse { ComparisonOperator.fromValue(it) }
.getOrDeserializeErr { "expected (enum: `com.amazonaws.route53#ComparisonOperator`)" }
// Period com.amazonaws.route53#CloudWatchAlarmConfiguration$Period
"Period" -> builder.period = curr.tryData()
.parseInt()
.getOrDeserializeErr { "expected (integer: `com.amazonaws.route53#Period`)" }
// MetricName com.amazonaws.route53#CloudWatchAlarmConfiguration$MetricName
"MetricName" -> builder.metricName = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.route53#MetricName`)" }
// Namespace com.amazonaws.route53#CloudWatchAlarmConfiguration$Namespace
"Namespace" -> builder.namespace = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.route53#Namespace`)" }
// Statistic com.amazonaws.route53#CloudWatchAlarmConfiguration$Statistic
"Statistic" -> builder.statistic = curr.tryData()
.parse { Statistic.fromValue(it) }
.getOrDeserializeErr { "expected (enum: `com.amazonaws.route53#Statistic`)" }
// Dimensions com.amazonaws.route53#CloudWatchAlarmConfiguration$Dimensions
"Dimensions" -> builder.dimensions = deserializeDimensionListShape(curr)
else -> {}
}
curr.drop()
}
builder.correctErrors()
return builder.build()
}