commonMain.aws.sdk.kotlin.services.wafv2.serde.WebAclDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wafv2-jvm Show documentation
Show all versions of wafv2-jvm Show documentation
The AWS Kotlin client for WAFV2
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.wafv2.serde
import aws.sdk.kotlin.services.wafv2.model.CustomResponseBody
import aws.sdk.kotlin.services.wafv2.model.FirewallManagerRuleGroup
import aws.sdk.kotlin.services.wafv2.model.Rule
import aws.sdk.kotlin.services.wafv2.model.WebAcl
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
import kotlin.collections.mutableMapOf
internal fun deserializeWebAclDocument(deserializer: Deserializer): WebAcl {
val builder = WebAcl.Builder()
val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ARN"))
val ASSOCIATIONCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("AssociationConfig"))
val CAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("Capacity"))
val CAPTCHACONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("CaptchaConfig"))
val CHALLENGECONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ChallengeConfig"))
val CUSTOMRESPONSEBODIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("CustomResponseBodies"))
val DEFAULTACTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DefaultAction"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Id"))
val LABELNAMESPACE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LabelNamespace"))
val MANAGEDBYFIREWALLMANAGER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("ManagedByFirewallManager"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val POSTPROCESSFIREWALLMANAGERRULEGROUPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("PostProcessFirewallManagerRuleGroups"))
val PREPROCESSFIREWALLMANAGERRULEGROUPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("PreProcessFirewallManagerRuleGroups"))
val RULES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Rules"))
val TOKENDOMAINS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("TokenDomains"))
val VISIBILITYCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("VisibilityConfig"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ARN_DESCRIPTOR)
field(ASSOCIATIONCONFIG_DESCRIPTOR)
field(CAPACITY_DESCRIPTOR)
field(CAPTCHACONFIG_DESCRIPTOR)
field(CHALLENGECONFIG_DESCRIPTOR)
field(CUSTOMRESPONSEBODIES_DESCRIPTOR)
field(DEFAULTACTION_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(ID_DESCRIPTOR)
field(LABELNAMESPACE_DESCRIPTOR)
field(MANAGEDBYFIREWALLMANAGER_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(POSTPROCESSFIREWALLMANAGERRULEGROUPS_DESCRIPTOR)
field(PREPROCESSFIREWALLMANAGERRULEGROUPS_DESCRIPTOR)
field(RULES_DESCRIPTOR)
field(TOKENDOMAINS_DESCRIPTOR)
field(VISIBILITYCONFIG_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
ASSOCIATIONCONFIG_DESCRIPTOR.index -> builder.associationConfig = deserializeAssociationConfigDocument(deserializer)
CAPACITY_DESCRIPTOR.index -> builder.capacity = deserializeLong()
CAPTCHACONFIG_DESCRIPTOR.index -> builder.captchaConfig = deserializeCaptchaConfigDocument(deserializer)
CHALLENGECONFIG_DESCRIPTOR.index -> builder.challengeConfig = deserializeChallengeConfigDocument(deserializer)
CUSTOMRESPONSEBODIES_DESCRIPTOR.index -> builder.customResponseBodies =
deserializer.deserializeMap(CUSTOMRESPONSEBODIES_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeCustomResponseBodyDocument(deserializer) } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
DEFAULTACTION_DESCRIPTOR.index -> builder.defaultAction = deserializeDefaultActionDocument(deserializer)
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
ID_DESCRIPTOR.index -> builder.id = deserializeString()
LABELNAMESPACE_DESCRIPTOR.index -> builder.labelNamespace = deserializeString()
MANAGEDBYFIREWALLMANAGER_DESCRIPTOR.index -> builder.managedByFirewallManager = deserializeBoolean()
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
POSTPROCESSFIREWALLMANAGERRULEGROUPS_DESCRIPTOR.index -> builder.postProcessFirewallManagerRuleGroups =
deserializer.deserializeList(POSTPROCESSFIREWALLMANAGERRULEGROUPS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeFirewallManagerRuleGroupDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
PREPROCESSFIREWALLMANAGERRULEGROUPS_DESCRIPTOR.index -> builder.preProcessFirewallManagerRuleGroups =
deserializer.deserializeList(PREPROCESSFIREWALLMANAGERRULEGROUPS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeFirewallManagerRuleGroupDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
RULES_DESCRIPTOR.index -> builder.rules =
deserializer.deserializeList(RULES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeRuleDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
TOKENDOMAINS_DESCRIPTOR.index -> builder.tokenDomains =
deserializer.deserializeList(TOKENDOMAINS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
VISIBILITYCONFIG_DESCRIPTOR.index -> builder.visibilityConfig = deserializeVisibilityConfigDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy