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

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

The 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.RateBasedStatementCustomKey
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

internal fun deserializeRateBasedStatementCustomKeyDocument(deserializer: Deserializer): RateBasedStatementCustomKey {
    val builder = RateBasedStatementCustomKey.Builder()
    val COOKIE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Cookie"))
    val FORWARDEDIP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ForwardedIP"))
    val HTTPMETHOD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("HTTPMethod"))
    val HEADER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Header"))
    val IP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("IP"))
    val LABELNAMESPACE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("LabelNamespace"))
    val QUERYARGUMENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("QueryArgument"))
    val QUERYSTRING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("QueryString"))
    val URIPATH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("UriPath"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(COOKIE_DESCRIPTOR)
        field(FORWARDEDIP_DESCRIPTOR)
        field(HTTPMETHOD_DESCRIPTOR)
        field(HEADER_DESCRIPTOR)
        field(IP_DESCRIPTOR)
        field(LABELNAMESPACE_DESCRIPTOR)
        field(QUERYARGUMENT_DESCRIPTOR)
        field(QUERYSTRING_DESCRIPTOR)
        field(URIPATH_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                COOKIE_DESCRIPTOR.index -> builder.cookie = deserializeRateLimitCookieDocument(deserializer)
                FORWARDEDIP_DESCRIPTOR.index -> builder.forwardedIp = deserializeRateLimitForwardedIpDocument(deserializer)
                HTTPMETHOD_DESCRIPTOR.index -> builder.httpMethod = deserializeRateLimitHttpMethodDocument(deserializer)
                HEADER_DESCRIPTOR.index -> builder.header = deserializeRateLimitHeaderDocument(deserializer)
                IP_DESCRIPTOR.index -> builder.ip = deserializeRateLimitIpDocument(deserializer)
                LABELNAMESPACE_DESCRIPTOR.index -> builder.labelNamespace = deserializeRateLimitLabelNamespaceDocument(deserializer)
                QUERYARGUMENT_DESCRIPTOR.index -> builder.queryArgument = deserializeRateLimitQueryArgumentDocument(deserializer)
                QUERYSTRING_DESCRIPTOR.index -> builder.queryString = deserializeRateLimitQueryStringDocument(deserializer)
                URIPATH_DESCRIPTOR.index -> builder.uriPath = deserializeRateLimitUriPathDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy