commonMain.aws.sdk.kotlin.services.cloudwatch.serde.InsightRuleDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudwatch-jvm Show documentation
Show all versions of cloudwatch-jvm Show documentation
The AWS SDK for Kotlin client for CloudWatch
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cloudwatch.serde
import aws.sdk.kotlin.services.cloudwatch.model.InsightRule
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parseBoolean
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData
internal fun deserializeInsightRuleDocument(reader: XmlTagReader): InsightRule {
val builder = InsightRule.Builder()
loop@while (true) {
val curr = reader.nextTag() ?: break@loop
when (curr.tagName) {
// Name com.amazonaws.cloudwatch#InsightRule$Name
"Name" -> builder.name = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudwatch#InsightRuleName`)" }
// State com.amazonaws.cloudwatch#InsightRule$State
"State" -> builder.state = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudwatch#InsightRuleState`)" }
// Schema com.amazonaws.cloudwatch#InsightRule$Schema
"Schema" -> builder.schema = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudwatch#InsightRuleSchema`)" }
// Definition com.amazonaws.cloudwatch#InsightRule$Definition
"Definition" -> builder.definition = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudwatch#InsightRuleDefinition`)" }
// ManagedRule com.amazonaws.cloudwatch#InsightRule$ManagedRule
"ManagedRule" -> builder.managedRule = curr.tryData()
.parseBoolean()
.getOrDeserializeErr { "expected (boolean: `com.amazonaws.cloudwatch#InsightRuleIsManaged`)" }
else -> {}
}
curr.drop()
}
builder.correctErrors()
return builder.build()
}