commonMain.aws.sdk.kotlin.services.wafv2.serde.SampledHttpRequestDocumentDeserializer.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.HttpHeader
import aws.sdk.kotlin.services.wafv2.model.Label
import aws.sdk.kotlin.services.wafv2.model.SampledHttpRequest
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
import kotlin.collections.mutableListOf
internal fun deserializeSampledHttpRequestDocument(deserializer: Deserializer): SampledHttpRequest {
val builder = SampledHttpRequest.Builder()
val ACTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Action"))
val CAPTCHARESPONSE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("CaptchaResponse"))
val CHALLENGERESPONSE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ChallengeResponse"))
val LABELS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Labels"))
val OVERRIDDENACTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OverriddenAction"))
val REQUEST_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Request"))
val REQUESTHEADERSINSERTED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("RequestHeadersInserted"))
val RESPONSECODESENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("ResponseCodeSent"))
val RULENAMEWITHINRULEGROUP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RuleNameWithinRuleGroup"))
val TIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("Timestamp"))
val WEIGHT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("Weight"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACTION_DESCRIPTOR)
field(CAPTCHARESPONSE_DESCRIPTOR)
field(CHALLENGERESPONSE_DESCRIPTOR)
field(LABELS_DESCRIPTOR)
field(OVERRIDDENACTION_DESCRIPTOR)
field(REQUEST_DESCRIPTOR)
field(REQUESTHEADERSINSERTED_DESCRIPTOR)
field(RESPONSECODESENT_DESCRIPTOR)
field(RULENAMEWITHINRULEGROUP_DESCRIPTOR)
field(TIMESTAMP_DESCRIPTOR)
field(WEIGHT_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ACTION_DESCRIPTOR.index -> builder.action = deserializeString()
CAPTCHARESPONSE_DESCRIPTOR.index -> builder.captchaResponse = deserializeCaptchaResponseDocument(deserializer)
CHALLENGERESPONSE_DESCRIPTOR.index -> builder.challengeResponse = deserializeChallengeResponseDocument(deserializer)
LABELS_DESCRIPTOR.index -> builder.labels =
deserializer.deserializeList(LABELS_DESCRIPTOR) {
val col0 = mutableListOf
© 2015 - 2025 Weber Informatics LLC | Privacy Policy