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

commonMain.aws.sdk.kotlin.services.rum.serde.AppMonitorConfigurationDocumentDeserializer.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.rum.serde

import aws.sdk.kotlin.services.rum.model.AppMonitorConfiguration
import aws.sdk.kotlin.services.rum.model.Telemetry
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 deserializeAppMonitorConfigurationDocument(deserializer: Deserializer): AppMonitorConfiguration {
    val builder = AppMonitorConfiguration.Builder()
    val ALLOWCOOKIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("AllowCookies"))
    val ENABLEXRAY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("EnableXRay"))
    val EXCLUDEDPAGES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ExcludedPages"))
    val FAVORITEPAGES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("FavoritePages"))
    val GUESTROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("GuestRoleArn"))
    val IDENTITYPOOLID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("IdentityPoolId"))
    val INCLUDEDPAGES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("IncludedPages"))
    val SESSIONSAMPLERATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("SessionSampleRate"))
    val TELEMETRIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Telemetries"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ALLOWCOOKIES_DESCRIPTOR)
        field(ENABLEXRAY_DESCRIPTOR)
        field(EXCLUDEDPAGES_DESCRIPTOR)
        field(FAVORITEPAGES_DESCRIPTOR)
        field(GUESTROLEARN_DESCRIPTOR)
        field(IDENTITYPOOLID_DESCRIPTOR)
        field(INCLUDEDPAGES_DESCRIPTOR)
        field(SESSIONSAMPLERATE_DESCRIPTOR)
        field(TELEMETRIES_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ALLOWCOOKIES_DESCRIPTOR.index -> builder.allowCookies = deserializeBoolean()
                ENABLEXRAY_DESCRIPTOR.index -> builder.enableXRay = deserializeBoolean()
                EXCLUDEDPAGES_DESCRIPTOR.index -> builder.excludedPages =
                    deserializer.deserializeList(EXCLUDEDPAGES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                FAVORITEPAGES_DESCRIPTOR.index -> builder.favoritePages =
                    deserializer.deserializeList(FAVORITEPAGES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                GUESTROLEARN_DESCRIPTOR.index -> builder.guestRoleArn = deserializeString()
                IDENTITYPOOLID_DESCRIPTOR.index -> builder.identityPoolId = deserializeString()
                INCLUDEDPAGES_DESCRIPTOR.index -> builder.includedPages =
                    deserializer.deserializeList(INCLUDEDPAGES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SESSIONSAMPLERATE_DESCRIPTOR.index -> builder.sessionSampleRate = deserializeDouble()
                TELEMETRIES_DESCRIPTOR.index -> builder.telemetries =
                    deserializer.deserializeList(TELEMETRIES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { Telemetry.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy