commonMain.aws.sdk.kotlin.services.cloudwatch.serde.CompositeAlarmDocumentDeserializer.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.ActionsSuppressedBy
import aws.sdk.kotlin.services.cloudwatch.model.CompositeAlarm
import aws.sdk.kotlin.services.cloudwatch.model.StateValue
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.parseTimestamp
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData
import aws.smithy.kotlin.runtime.time.TimestampFormat
internal fun deserializeCompositeAlarmDocument(reader: XmlTagReader): CompositeAlarm {
val builder = CompositeAlarm.Builder()
loop@while (true) {
val curr = reader.nextTag() ?: break@loop
when (curr.tagName) {
// ActionsEnabled com.amazonaws.cloudwatch#CompositeAlarm$ActionsEnabled
"ActionsEnabled" -> builder.actionsEnabled = curr.tryData()
.parseBoolean()
.getOrDeserializeErr { "expected (boolean: `com.amazonaws.cloudwatch#ActionsEnabled`)" }
// AlarmActions com.amazonaws.cloudwatch#CompositeAlarm$AlarmActions
"AlarmActions" -> builder.alarmActions = deserializeResourceListShape(curr)
// AlarmArn com.amazonaws.cloudwatch#CompositeAlarm$AlarmArn
"AlarmArn" -> builder.alarmArn = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudwatch#AlarmArn`)" }
// AlarmConfigurationUpdatedTimestamp com.amazonaws.cloudwatch#CompositeAlarm$AlarmConfigurationUpdatedTimestamp
"AlarmConfigurationUpdatedTimestamp" -> builder.alarmConfigurationUpdatedTimestamp = curr.tryData()
.parseTimestamp(TimestampFormat.ISO_8601)
.getOrDeserializeErr { "expected (timestamp: `com.amazonaws.cloudwatch#Timestamp`)" }
// AlarmDescription com.amazonaws.cloudwatch#CompositeAlarm$AlarmDescription
"AlarmDescription" -> builder.alarmDescription = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudwatch#AlarmDescription`)" }
// AlarmName com.amazonaws.cloudwatch#CompositeAlarm$AlarmName
"AlarmName" -> builder.alarmName = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudwatch#AlarmName`)" }
// AlarmRule com.amazonaws.cloudwatch#CompositeAlarm$AlarmRule
"AlarmRule" -> builder.alarmRule = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudwatch#AlarmRule`)" }
// InsufficientDataActions com.amazonaws.cloudwatch#CompositeAlarm$InsufficientDataActions
"InsufficientDataActions" -> builder.insufficientDataActions = deserializeResourceListShape(curr)
// OKActions com.amazonaws.cloudwatch#CompositeAlarm$OKActions
"OKActions" -> builder.okActions = deserializeResourceListShape(curr)
// StateReason com.amazonaws.cloudwatch#CompositeAlarm$StateReason
"StateReason" -> builder.stateReason = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudwatch#StateReason`)" }
// StateReasonData com.amazonaws.cloudwatch#CompositeAlarm$StateReasonData
"StateReasonData" -> builder.stateReasonData = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudwatch#StateReasonData`)" }
// StateUpdatedTimestamp com.amazonaws.cloudwatch#CompositeAlarm$StateUpdatedTimestamp
"StateUpdatedTimestamp" -> builder.stateUpdatedTimestamp = curr.tryData()
.parseTimestamp(TimestampFormat.ISO_8601)
.getOrDeserializeErr { "expected (timestamp: `com.amazonaws.cloudwatch#Timestamp`)" }
// StateValue com.amazonaws.cloudwatch#CompositeAlarm$StateValue
"StateValue" -> builder.stateValue = curr.tryData()
.parse { StateValue.fromValue(it) }
.getOrDeserializeErr { "expected (enum: `com.amazonaws.cloudwatch#StateValue`)" }
// StateTransitionedTimestamp com.amazonaws.cloudwatch#CompositeAlarm$StateTransitionedTimestamp
"StateTransitionedTimestamp" -> builder.stateTransitionedTimestamp = curr.tryData()
.parseTimestamp(TimestampFormat.ISO_8601)
.getOrDeserializeErr { "expected (timestamp: `com.amazonaws.cloudwatch#Timestamp`)" }
// ActionsSuppressedBy com.amazonaws.cloudwatch#CompositeAlarm$ActionsSuppressedBy
"ActionsSuppressedBy" -> builder.actionsSuppressedBy = curr.tryData()
.parse { ActionsSuppressedBy.fromValue(it) }
.getOrDeserializeErr { "expected (enum: `com.amazonaws.cloudwatch#ActionsSuppressedBy`)" }
// ActionsSuppressedReason com.amazonaws.cloudwatch#CompositeAlarm$ActionsSuppressedReason
"ActionsSuppressedReason" -> builder.actionsSuppressedReason = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudwatch#ActionsSuppressedReason`)" }
// ActionsSuppressor com.amazonaws.cloudwatch#CompositeAlarm$ActionsSuppressor
"ActionsSuppressor" -> builder.actionsSuppressor = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudwatch#AlarmArn`)" }
// ActionsSuppressorWaitPeriod com.amazonaws.cloudwatch#CompositeAlarm$ActionsSuppressorWaitPeriod
"ActionsSuppressorWaitPeriod" -> builder.actionsSuppressorWaitPeriod = curr.tryData()
.parseInt()
.getOrDeserializeErr { "expected (integer: `com.amazonaws.cloudwatch#SuppressorPeriod`)" }
// ActionsSuppressorExtensionPeriod com.amazonaws.cloudwatch#CompositeAlarm$ActionsSuppressorExtensionPeriod
"ActionsSuppressorExtensionPeriod" -> builder.actionsSuppressorExtensionPeriod = curr.tryData()
.parseInt()
.getOrDeserializeErr { "expected (integer: `com.amazonaws.cloudwatch#SuppressorPeriod`)" }
else -> {}
}
curr.drop()
}
builder.correctErrors()
return builder.build()
}