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

commonMain.aws.sdk.kotlin.services.proton.serde.ServiceTemplateVersionDocumentDeserializer.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.proton.serde

import aws.sdk.kotlin.services.proton.model.CompatibleEnvironmentTemplate
import aws.sdk.kotlin.services.proton.model.ServiceTemplateSupportedComponentSourceType
import aws.sdk.kotlin.services.proton.model.ServiceTemplateVersion
import aws.sdk.kotlin.services.proton.model.TemplateVersionStatus
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
import kotlin.collections.mutableListOf

internal fun deserializeServiceTemplateVersionDocument(deserializer: Deserializer): ServiceTemplateVersion {
    val builder = ServiceTemplateVersion.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val COMPATIBLEENVIRONMENTTEMPLATES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("compatibleEnvironmentTemplates"))
    val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("description"))
    val LASTMODIFIEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastModifiedAt"))
    val MAJORVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("majorVersion"))
    val MINORVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("minorVersion"))
    val RECOMMENDEDMINORVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("recommendedMinorVersion"))
    val SCHEMA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("schema"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
    val STATUSMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("statusMessage"))
    val SUPPORTEDCOMPONENTSOURCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("supportedComponentSources"))
    val TEMPLATENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("templateName"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(COMPATIBLEENVIRONMENTTEMPLATES_DESCRIPTOR)
        field(CREATEDAT_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(LASTMODIFIEDAT_DESCRIPTOR)
        field(MAJORVERSION_DESCRIPTOR)
        field(MINORVERSION_DESCRIPTOR)
        field(RECOMMENDEDMINORVERSION_DESCRIPTOR)
        field(SCHEMA_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(STATUSMESSAGE_DESCRIPTOR)
        field(SUPPORTEDCOMPONENTSOURCES_DESCRIPTOR)
        field(TEMPLATENAME_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                COMPATIBLEENVIRONMENTTEMPLATES_DESCRIPTOR.index -> builder.compatibleEnvironmentTemplates =
                    deserializer.deserializeList(COMPATIBLEENVIRONMENTTEMPLATES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeCompatibleEnvironmentTemplateDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                LASTMODIFIEDAT_DESCRIPTOR.index -> builder.lastModifiedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                MAJORVERSION_DESCRIPTOR.index -> builder.majorVersion = deserializeString()
                MINORVERSION_DESCRIPTOR.index -> builder.minorVersion = deserializeString()
                RECOMMENDEDMINORVERSION_DESCRIPTOR.index -> builder.recommendedMinorVersion = deserializeString()
                SCHEMA_DESCRIPTOR.index -> builder.schema = deserializeString()
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { TemplateVersionStatus.fromValue(it) }
                STATUSMESSAGE_DESCRIPTOR.index -> builder.statusMessage = deserializeString()
                SUPPORTEDCOMPONENTSOURCES_DESCRIPTOR.index -> builder.supportedComponentSources =
                    deserializer.deserializeList(SUPPORTEDCOMPONENTSOURCES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { ServiceTemplateSupportedComponentSourceType.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                TEMPLATENAME_DESCRIPTOR.index -> builder.templateName = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy