commonMain.aws.sdk.kotlin.services.wafv2.serde.RuleDocumentSerializer.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.Rule
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.Serializer
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
internal fun serializeRuleDocument(serializer: Serializer, input: Rule) {
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)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
field(NAME_DESCRIPTOR, input.name)
field(PRIORITY_DESCRIPTOR, input.priority)
input.statement?.let { field(STATEMENT_DESCRIPTOR, it, ::serializeStatementDocument) }
input.action?.let { field(ACTION_DESCRIPTOR, it, ::serializeRuleActionDocument) }
input.overrideAction?.let { field(OVERRIDEACTION_DESCRIPTOR, it, ::serializeOverrideActionDocument) }
if (input.ruleLabels != null) {
listField(RULELABELS_DESCRIPTOR) {
for (el0 in input.ruleLabels) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeLabelDocument))
}
}
}
input.visibilityConfig?.let { field(VISIBILITYCONFIG_DESCRIPTOR, it, ::serializeVisibilityConfigDocument) }
input.captchaConfig?.let { field(CAPTCHACONFIG_DESCRIPTOR, it, ::serializeCaptchaConfigDocument) }
input.challengeConfig?.let { field(CHALLENGECONFIG_DESCRIPTOR, it, ::serializeChallengeConfigDocument) }
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy