All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.wafv2.serde.RuleDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.wafv2.serde

import aws.sdk.kotlin.services.wafv2.model.Label
import aws.sdk.kotlin.services.wafv2.model.Rule
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 deserializeRuleDocument(deserializer: Deserializer): Rule {
    val builder = Rule.Builder()
    val ACTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Action"))
    val CAPTCHACONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("CaptchaConfig"))
    val CHALLENGECONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ChallengeConfig"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val OVERRIDEACTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("OverrideAction"))
    val PRIORITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Priority"))
    val RULELABELS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("RuleLabels"))
    val STATEMENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Statement"))
    val VISIBILITYCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("VisibilityConfig"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACTION_DESCRIPTOR)
        field(CAPTCHACONFIG_DESCRIPTOR)
        field(CHALLENGECONFIG_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(OVERRIDEACTION_DESCRIPTOR)
        field(PRIORITY_DESCRIPTOR)
        field(RULELABELS_DESCRIPTOR)
        field(STATEMENT_DESCRIPTOR)
        field(VISIBILITYCONFIG_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACTION_DESCRIPTOR.index -> builder.action = deserializeRuleActionDocument(deserializer)
                CAPTCHACONFIG_DESCRIPTOR.index -> builder.captchaConfig = deserializeCaptchaConfigDocument(deserializer)
                CHALLENGECONFIG_DESCRIPTOR.index -> builder.challengeConfig = deserializeChallengeConfigDocument(deserializer)
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                OVERRIDEACTION_DESCRIPTOR.index -> builder.overrideAction = deserializeOverrideActionDocument(deserializer)
                PRIORITY_DESCRIPTOR.index -> builder.priority = deserializeInt()
                RULELABELS_DESCRIPTOR.index -> builder.ruleLabels =
                    deserializer.deserializeList(RULELABELS_DESCRIPTOR) {
                        val col0 = mutableListOf




© 2015 - 2025 Weber Informatics LLC | Privacy Policy