commonMain.aws.sdk.kotlin.services.route53recoverycontrolconfig.serde.GatingRuleDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of route53recoverycontrolconfig-jvm Show documentation
Show all versions of route53recoverycontrolconfig-jvm Show documentation
The AWS Kotlin client for Route53 Recovery Control Config
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.route53recoverycontrolconfig.serde
import aws.sdk.kotlin.services.route53recoverycontrolconfig.model.GatingRule
import aws.sdk.kotlin.services.route53recoverycontrolconfig.model.Status
import aws.smithy.kotlin.runtime.serde.Deserializer
import aws.smithy.kotlin.runtime.serde.SdkFieldDescriptor
import aws.smithy.kotlin.runtime.serde.SdkObjectDescriptor
import aws.smithy.kotlin.runtime.serde.SerialKind
import aws.smithy.kotlin.runtime.serde.asSdkSerializable
import aws.smithy.kotlin.runtime.serde.deserializeList
import aws.smithy.kotlin.runtime.serde.deserializeMap
import aws.smithy.kotlin.runtime.serde.deserializeStruct
import aws.smithy.kotlin.runtime.serde.field
import aws.smithy.kotlin.runtime.serde.json.JsonDeserializer
import aws.smithy.kotlin.runtime.serde.json.JsonSerialName
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import kotlin.collections.mutableListOf
internal fun deserializeGatingRuleDocument(deserializer: Deserializer): GatingRule {
val builder = GatingRule.Builder()
val CONTROLPANELARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ControlPanelArn"))
val GATINGCONTROLS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("GatingControls"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val OWNER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Owner"))
val RULECONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("RuleConfig"))
val SAFETYRULEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SafetyRuleArn"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
val TARGETCONTROLS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("TargetControls"))
val WAITPERIODMS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("WaitPeriodMs"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CONTROLPANELARN_DESCRIPTOR)
field(GATINGCONTROLS_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(OWNER_DESCRIPTOR)
field(RULECONFIG_DESCRIPTOR)
field(SAFETYRULEARN_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(TARGETCONTROLS_DESCRIPTOR)
field(WAITPERIODMS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CONTROLPANELARN_DESCRIPTOR.index -> builder.controlPanelArn = deserializeString()
GATINGCONTROLS_DESCRIPTOR.index -> builder.gatingControls =
deserializer.deserializeList(GATINGCONTROLS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
OWNER_DESCRIPTOR.index -> builder.owner = deserializeString()
RULECONFIG_DESCRIPTOR.index -> builder.ruleConfig = deserializeRuleConfigDocument(deserializer)
SAFETYRULEARN_DESCRIPTOR.index -> builder.safetyRuleArn = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { Status.fromValue(it) }
TARGETCONTROLS_DESCRIPTOR.index -> builder.targetControls =
deserializer.deserializeList(TARGETCONTROLS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
WAITPERIODMS_DESCRIPTOR.index -> builder.waitPeriodMs = deserializeInt()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy