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

commonMain.aws.sdk.kotlin.services.appconfig.serde.DeploymentStrategyDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.appconfig.serde

import aws.sdk.kotlin.services.appconfig.model.DeploymentStrategy
import aws.sdk.kotlin.services.appconfig.model.GrowthType
import aws.sdk.kotlin.services.appconfig.model.ReplicateTo
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 deserializeDeploymentStrategyDocument(deserializer: Deserializer): DeploymentStrategy {
    val builder = DeploymentStrategy.Builder()
    val DEPLOYMENTDURATIONINMINUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("DeploymentDurationInMinutes"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
    val FINALBAKETIMEINMINUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("FinalBakeTimeInMinutes"))
    val GROWTHFACTOR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Float, JsonSerialName("GrowthFactor"))
    val GROWTHTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("GrowthType"))
    val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Id"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val REPLICATETO_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ReplicateTo"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DEPLOYMENTDURATIONINMINUTES_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(FINALBAKETIMEINMINUTES_DESCRIPTOR)
        field(GROWTHFACTOR_DESCRIPTOR)
        field(GROWTHTYPE_DESCRIPTOR)
        field(ID_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(REPLICATETO_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DEPLOYMENTDURATIONINMINUTES_DESCRIPTOR.index -> builder.deploymentDurationInMinutes = deserializeInt()
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                FINALBAKETIMEINMINUTES_DESCRIPTOR.index -> builder.finalBakeTimeInMinutes = deserializeInt()
                GROWTHFACTOR_DESCRIPTOR.index -> builder.growthFactor = deserializeFloat()
                GROWTHTYPE_DESCRIPTOR.index -> builder.growthType = deserializeString().let { GrowthType.fromValue(it) }
                ID_DESCRIPTOR.index -> builder.id = deserializeString()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                REPLICATETO_DESCRIPTOR.index -> builder.replicateTo = deserializeString().let { ReplicateTo.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy