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

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

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

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

import aws.sdk.kotlin.services.appconfig.model.DeploymentState
import aws.sdk.kotlin.services.appconfig.model.DeploymentSummary
import aws.sdk.kotlin.services.appconfig.model.GrowthType
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat

internal fun deserializeDeploymentSummaryDocument(deserializer: Deserializer): DeploymentSummary {
    val builder = DeploymentSummary.Builder()
    val COMPLETEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CompletedAt"))
    val CONFIGURATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConfigurationName"))
    val CONFIGURATIONVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConfigurationVersion"))
    val DEPLOYMENTDURATIONINMINUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("DeploymentDurationInMinutes"))
    val DEPLOYMENTNUMBER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("DeploymentNumber"))
    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 PERCENTAGECOMPLETE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Float, JsonSerialName("PercentageComplete"))
    val STARTEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("StartedAt"))
    val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("State"))
    val VERSIONLABEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("VersionLabel"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(COMPLETEDAT_DESCRIPTOR)
        field(CONFIGURATIONNAME_DESCRIPTOR)
        field(CONFIGURATIONVERSION_DESCRIPTOR)
        field(DEPLOYMENTDURATIONINMINUTES_DESCRIPTOR)
        field(DEPLOYMENTNUMBER_DESCRIPTOR)
        field(FINALBAKETIMEINMINUTES_DESCRIPTOR)
        field(GROWTHFACTOR_DESCRIPTOR)
        field(GROWTHTYPE_DESCRIPTOR)
        field(PERCENTAGECOMPLETE_DESCRIPTOR)
        field(STARTEDAT_DESCRIPTOR)
        field(STATE_DESCRIPTOR)
        field(VERSIONLABEL_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                COMPLETEDAT_DESCRIPTOR.index -> builder.completedAt = deserializeInstant(TimestampFormat.ISO_8601)
                CONFIGURATIONNAME_DESCRIPTOR.index -> builder.configurationName = deserializeString()
                CONFIGURATIONVERSION_DESCRIPTOR.index -> builder.configurationVersion = deserializeString()
                DEPLOYMENTDURATIONINMINUTES_DESCRIPTOR.index -> builder.deploymentDurationInMinutes = deserializeInt()
                DEPLOYMENTNUMBER_DESCRIPTOR.index -> builder.deploymentNumber = deserializeInt()
                FINALBAKETIMEINMINUTES_DESCRIPTOR.index -> builder.finalBakeTimeInMinutes = deserializeInt()
                GROWTHFACTOR_DESCRIPTOR.index -> builder.growthFactor = deserializeFloat()
                GROWTHTYPE_DESCRIPTOR.index -> builder.growthType = deserializeString().let { GrowthType.fromValue(it) }
                PERCENTAGECOMPLETE_DESCRIPTOR.index -> builder.percentageComplete = deserializeFloat()
                STARTEDAT_DESCRIPTOR.index -> builder.startedAt = deserializeInstant(TimestampFormat.ISO_8601)
                STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { DeploymentState.fromValue(it) }
                VERSIONLABEL_DESCRIPTOR.index -> builder.versionLabel = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy