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

commonMain.aws.sdk.kotlin.services.outposts.serde.SiteDocumentDeserializer.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.outposts.serde

import aws.sdk.kotlin.services.outposts.model.Site
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 deserializeSiteDocument(deserializer: Deserializer): Site {
    val builder = Site.Builder()
    val ACCOUNTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AccountId"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val NOTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Notes"))
    val OPERATINGADDRESSCITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OperatingAddressCity"))
    val OPERATINGADDRESSCOUNTRYCODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OperatingAddressCountryCode"))
    val OPERATINGADDRESSSTATEORREGION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OperatingAddressStateOrRegion"))
    val RACKPHYSICALPROPERTIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("RackPhysicalProperties"))
    val SITEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SiteArn"))
    val SITEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SiteId"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("Tags"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACCOUNTID_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(NOTES_DESCRIPTOR)
        field(OPERATINGADDRESSCITY_DESCRIPTOR)
        field(OPERATINGADDRESSCOUNTRYCODE_DESCRIPTOR)
        field(OPERATINGADDRESSSTATEORREGION_DESCRIPTOR)
        field(RACKPHYSICALPROPERTIES_DESCRIPTOR)
        field(SITEARN_DESCRIPTOR)
        field(SITEID_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACCOUNTID_DESCRIPTOR.index -> builder.accountId = deserializeString()
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                NOTES_DESCRIPTOR.index -> builder.notes = deserializeString()
                OPERATINGADDRESSCITY_DESCRIPTOR.index -> builder.operatingAddressCity = deserializeString()
                OPERATINGADDRESSCOUNTRYCODE_DESCRIPTOR.index -> builder.operatingAddressCountryCode = deserializeString()
                OPERATINGADDRESSSTATEORREGION_DESCRIPTOR.index -> builder.operatingAddressStateOrRegion = deserializeString()
                RACKPHYSICALPROPERTIES_DESCRIPTOR.index -> builder.rackPhysicalProperties = deserializeRackPhysicalPropertiesDocument(deserializer)
                SITEARN_DESCRIPTOR.index -> builder.siteArn = deserializeString()
                SITEID_DESCRIPTOR.index -> builder.siteId = deserializeString()
                TAGS_DESCRIPTOR.index -> builder.tags =
                    deserializer.deserializeMap(TAGS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy