commonMain.aws.sdk.kotlin.services.configservice.serde.ConfigRuleDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.configservice.serde
import aws.sdk.kotlin.services.configservice.model.ConfigRule
import aws.sdk.kotlin.services.configservice.model.ConfigRuleState
import aws.sdk.kotlin.services.configservice.model.EvaluationModeConfiguration
import aws.sdk.kotlin.services.configservice.model.MaximumExecutionFrequency
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 deserializeConfigRuleDocument(deserializer: Deserializer): ConfigRule {
val builder = ConfigRule.Builder()
val CONFIGRULEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConfigRuleArn"))
val CONFIGRULEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConfigRuleId"))
val CONFIGRULENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConfigRuleName"))
val CONFIGRULESTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ConfigRuleState"))
val CREATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CreatedBy"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val EVALUATIONMODES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("EvaluationModes"))
val INPUTPARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("InputParameters"))
val MAXIMUMEXECUTIONFREQUENCY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("MaximumExecutionFrequency"))
val SCOPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Scope"))
val SOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Source"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CONFIGRULEARN_DESCRIPTOR)
field(CONFIGRULEID_DESCRIPTOR)
field(CONFIGRULENAME_DESCRIPTOR)
field(CONFIGRULESTATE_DESCRIPTOR)
field(CREATEDBY_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(EVALUATIONMODES_DESCRIPTOR)
field(INPUTPARAMETERS_DESCRIPTOR)
field(MAXIMUMEXECUTIONFREQUENCY_DESCRIPTOR)
field(SCOPE_DESCRIPTOR)
field(SOURCE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CONFIGRULEARN_DESCRIPTOR.index -> builder.configRuleArn = deserializeString()
CONFIGRULEID_DESCRIPTOR.index -> builder.configRuleId = deserializeString()
CONFIGRULENAME_DESCRIPTOR.index -> builder.configRuleName = deserializeString()
CONFIGRULESTATE_DESCRIPTOR.index -> builder.configRuleState = deserializeString().let { ConfigRuleState.fromValue(it) }
CREATEDBY_DESCRIPTOR.index -> builder.createdBy = deserializeString()
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
EVALUATIONMODES_DESCRIPTOR.index -> builder.evaluationModes =
deserializer.deserializeList(EVALUATIONMODES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeEvaluationModeConfigurationDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
INPUTPARAMETERS_DESCRIPTOR.index -> builder.inputParameters = deserializeString()
MAXIMUMEXECUTIONFREQUENCY_DESCRIPTOR.index -> builder.maximumExecutionFrequency = deserializeString().let { MaximumExecutionFrequency.fromValue(it) }
SCOPE_DESCRIPTOR.index -> builder.scope = deserializeScopeDocument(deserializer)
SOURCE_DESCRIPTOR.index -> builder.source = deserializeSourceDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy