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

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

There is a newer version: 1.3.37
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.RemediationConfiguration
import aws.sdk.kotlin.services.configservice.model.RemediationParameterValue
import aws.sdk.kotlin.services.configservice.model.RemediationTargetType
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.mutableMapOf

internal fun deserializeRemediationConfigurationDocument(deserializer: Deserializer): RemediationConfiguration {
    val builder = RemediationConfiguration.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Arn"))
    val AUTOMATIC_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("Automatic"))
    val CONFIGRULENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConfigRuleName"))
    val CREATEDBYSERVICE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CreatedByService"))
    val EXECUTIONCONTROLS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ExecutionControls"))
    val MAXIMUMAUTOMATICATTEMPTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaximumAutomaticAttempts"))
    val PARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("Parameters"))
    val RESOURCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceType"))
    val RETRYATTEMPTSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("RetryAttemptSeconds"))
    val TARGETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TargetId"))
    val TARGETTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("TargetType"))
    val TARGETVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TargetVersion"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(AUTOMATIC_DESCRIPTOR)
        field(CONFIGRULENAME_DESCRIPTOR)
        field(CREATEDBYSERVICE_DESCRIPTOR)
        field(EXECUTIONCONTROLS_DESCRIPTOR)
        field(MAXIMUMAUTOMATICATTEMPTS_DESCRIPTOR)
        field(PARAMETERS_DESCRIPTOR)
        field(RESOURCETYPE_DESCRIPTOR)
        field(RETRYATTEMPTSECONDS_DESCRIPTOR)
        field(TARGETID_DESCRIPTOR)
        field(TARGETTYPE_DESCRIPTOR)
        field(TARGETVERSION_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                AUTOMATIC_DESCRIPTOR.index -> builder.automatic = deserializeBoolean()
                CONFIGRULENAME_DESCRIPTOR.index -> builder.configRuleName = deserializeString()
                CREATEDBYSERVICE_DESCRIPTOR.index -> builder.createdByService = deserializeString()
                EXECUTIONCONTROLS_DESCRIPTOR.index -> builder.executionControls = deserializeExecutionControlsDocument(deserializer)
                MAXIMUMAUTOMATICATTEMPTS_DESCRIPTOR.index -> builder.maximumAutomaticAttempts = deserializeInt()
                PARAMETERS_DESCRIPTOR.index -> builder.parameters =
                    deserializer.deserializeMap(PARAMETERS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeRemediationParameterValueDocument(deserializer) } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                RESOURCETYPE_DESCRIPTOR.index -> builder.resourceType = deserializeString()
                RETRYATTEMPTSECONDS_DESCRIPTOR.index -> builder.retryAttemptSeconds = deserializeLong()
                TARGETID_DESCRIPTOR.index -> builder.targetId = deserializeString()
                TARGETTYPE_DESCRIPTOR.index -> builder.targetType = deserializeString().let { RemediationTargetType.fromValue(it) }
                TARGETVERSION_DESCRIPTOR.index -> builder.targetVersion = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy