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

commonMain.aws.sdk.kotlin.services.apprunner.serde.AutoScalingConfigurationSummaryDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.apprunner.serde

import aws.sdk.kotlin.services.apprunner.model.AutoScalingConfigurationStatus
import aws.sdk.kotlin.services.apprunner.model.AutoScalingConfigurationSummary
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 deserializeAutoScalingConfigurationSummaryDocument(deserializer: Deserializer): AutoScalingConfigurationSummary {
    val builder = AutoScalingConfigurationSummary.Builder()
    val AUTOSCALINGCONFIGURATIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AutoScalingConfigurationArn"))
    val AUTOSCALINGCONFIGURATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AutoScalingConfigurationName"))
    val AUTOSCALINGCONFIGURATIONREVISION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("AutoScalingConfigurationRevision"))
    val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreatedAt"))
    val HASASSOCIATEDSERVICE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("HasAssociatedService"))
    val ISDEFAULT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("IsDefault"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AUTOSCALINGCONFIGURATIONARN_DESCRIPTOR)
        field(AUTOSCALINGCONFIGURATIONNAME_DESCRIPTOR)
        field(AUTOSCALINGCONFIGURATIONREVISION_DESCRIPTOR)
        field(CREATEDAT_DESCRIPTOR)
        field(HASASSOCIATEDSERVICE_DESCRIPTOR)
        field(ISDEFAULT_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AUTOSCALINGCONFIGURATIONARN_DESCRIPTOR.index -> builder.autoScalingConfigurationArn = deserializeString()
                AUTOSCALINGCONFIGURATIONNAME_DESCRIPTOR.index -> builder.autoScalingConfigurationName = deserializeString()
                AUTOSCALINGCONFIGURATIONREVISION_DESCRIPTOR.index -> builder.autoScalingConfigurationRevision = deserializeInt()
                CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                HASASSOCIATEDSERVICE_DESCRIPTOR.index -> builder.hasAssociatedService = deserializeBoolean()
                ISDEFAULT_DESCRIPTOR.index -> builder.isDefault = deserializeBoolean()
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { AutoScalingConfigurationStatus.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy