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

commonMain.aws.sdk.kotlin.services.configservice.serde.ConfigurationAggregatorDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.configservice.serde

import aws.sdk.kotlin.services.configservice.model.AccountAggregationSource
import aws.sdk.kotlin.services.configservice.model.ConfigurationAggregator
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 kotlin.collections.mutableListOf

internal fun deserializeConfigurationAggregatorDocument(deserializer: Deserializer): ConfigurationAggregator {
    val builder = ConfigurationAggregator.Builder()
    val ACCOUNTAGGREGATIONSOURCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AccountAggregationSources"))
    val CONFIGURATIONAGGREGATORARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConfigurationAggregatorArn"))
    val CONFIGURATIONAGGREGATORNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConfigurationAggregatorName"))
    val CREATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CreatedBy"))
    val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTime"))
    val LASTUPDATEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastUpdatedTime"))
    val ORGANIZATIONAGGREGATIONSOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("OrganizationAggregationSource"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACCOUNTAGGREGATIONSOURCES_DESCRIPTOR)
        field(CONFIGURATIONAGGREGATORARN_DESCRIPTOR)
        field(CONFIGURATIONAGGREGATORNAME_DESCRIPTOR)
        field(CREATEDBY_DESCRIPTOR)
        field(CREATIONTIME_DESCRIPTOR)
        field(LASTUPDATEDTIME_DESCRIPTOR)
        field(ORGANIZATIONAGGREGATIONSOURCE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACCOUNTAGGREGATIONSOURCES_DESCRIPTOR.index -> builder.accountAggregationSources =
                    deserializer.deserializeList(ACCOUNTAGGREGATIONSOURCES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeAccountAggregationSourceDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                CONFIGURATIONAGGREGATORARN_DESCRIPTOR.index -> builder.configurationAggregatorArn = deserializeString()
                CONFIGURATIONAGGREGATORNAME_DESCRIPTOR.index -> builder.configurationAggregatorName = deserializeString()
                CREATEDBY_DESCRIPTOR.index -> builder.createdBy = deserializeString()
                CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                LASTUPDATEDTIME_DESCRIPTOR.index -> builder.lastUpdatedTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                ORGANIZATIONAGGREGATIONSOURCE_DESCRIPTOR.index -> builder.organizationAggregationSource = deserializeOrganizationAggregationSourceDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy