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

commonMain.aws.sdk.kotlin.services.configservice.serde.OrganizationManagedRuleMetadataDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.99
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.configservice.serde

import aws.sdk.kotlin.services.configservice.model.MaximumExecutionFrequency
import aws.sdk.kotlin.services.configservice.model.OrganizationManagedRuleMetadata
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 deserializeOrganizationManagedRuleMetadataDocument(deserializer: Deserializer): OrganizationManagedRuleMetadata {
    val builder = OrganizationManagedRuleMetadata.Builder()
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
    val INPUTPARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("InputParameters"))
    val MAXIMUMEXECUTIONFREQUENCY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("MaximumExecutionFrequency"))
    val RESOURCEIDSCOPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceIdScope"))
    val RESOURCETYPESSCOPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ResourceTypesScope"))
    val RULEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RuleIdentifier"))
    val TAGKEYSCOPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TagKeyScope"))
    val TAGVALUESCOPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TagValueScope"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DESCRIPTION_DESCRIPTOR)
        field(INPUTPARAMETERS_DESCRIPTOR)
        field(MAXIMUMEXECUTIONFREQUENCY_DESCRIPTOR)
        field(RESOURCEIDSCOPE_DESCRIPTOR)
        field(RESOURCETYPESSCOPE_DESCRIPTOR)
        field(RULEIDENTIFIER_DESCRIPTOR)
        field(TAGKEYSCOPE_DESCRIPTOR)
        field(TAGVALUESCOPE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                INPUTPARAMETERS_DESCRIPTOR.index -> builder.inputParameters = deserializeString()
                MAXIMUMEXECUTIONFREQUENCY_DESCRIPTOR.index -> builder.maximumExecutionFrequency = deserializeString().let { MaximumExecutionFrequency.fromValue(it) }
                RESOURCEIDSCOPE_DESCRIPTOR.index -> builder.resourceIdScope = deserializeString()
                RESOURCETYPESSCOPE_DESCRIPTOR.index -> builder.resourceTypesScope =
                    deserializer.deserializeList(RESOURCETYPESSCOPE_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                RULEIDENTIFIER_DESCRIPTOR.index -> builder.ruleIdentifier = deserializeString()
                TAGKEYSCOPE_DESCRIPTOR.index -> builder.tagKeyScope = deserializeString()
                TAGVALUESCOPE_DESCRIPTOR.index -> builder.tagValueScope = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy