commonMain.aws.sdk.kotlin.services.configservice.serde.ConfigurationItemDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of configservice-jvm Show documentation
Show all versions of configservice-jvm Show documentation
The AWS Kotlin client for Config Service
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.configservice.serde
import aws.sdk.kotlin.services.configservice.model.ConfigurationItem
import aws.sdk.kotlin.services.configservice.model.ConfigurationItemStatus
import aws.sdk.kotlin.services.configservice.model.Relationship
import aws.sdk.kotlin.services.configservice.model.ResourceType
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
import kotlin.collections.mutableMapOf
internal fun deserializeConfigurationItemDocument(deserializer: Deserializer): ConfigurationItem {
val builder = ConfigurationItem.Builder()
val ACCOUNTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("accountId"))
val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
val AVAILABILITYZONE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("availabilityZone"))
val AWSREGION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("awsRegion"))
val CONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("configuration"))
val CONFIGURATIONITEMCAPTURETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("configurationItemCaptureTime"))
val CONFIGURATIONITEMMD5HASH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("configurationItemMD5Hash"))
val CONFIGURATIONITEMSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("configurationItemStatus"))
val CONFIGURATIONSTATEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("configurationStateId"))
val RELATEDEVENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("relatedEvents"))
val RELATIONSHIPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("relationships"))
val RESOURCECREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("resourceCreationTime"))
val RESOURCEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("resourceId"))
val RESOURCENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("resourceName"))
val RESOURCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("resourceType"))
val SUPPLEMENTARYCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("supplementaryConfiguration"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("tags"))
val VERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("version"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACCOUNTID_DESCRIPTOR)
field(ARN_DESCRIPTOR)
field(AVAILABILITYZONE_DESCRIPTOR)
field(AWSREGION_DESCRIPTOR)
field(CONFIGURATION_DESCRIPTOR)
field(CONFIGURATIONITEMCAPTURETIME_DESCRIPTOR)
field(CONFIGURATIONITEMMD5HASH_DESCRIPTOR)
field(CONFIGURATIONITEMSTATUS_DESCRIPTOR)
field(CONFIGURATIONSTATEID_DESCRIPTOR)
field(RELATEDEVENTS_DESCRIPTOR)
field(RELATIONSHIPS_DESCRIPTOR)
field(RESOURCECREATIONTIME_DESCRIPTOR)
field(RESOURCEID_DESCRIPTOR)
field(RESOURCENAME_DESCRIPTOR)
field(RESOURCETYPE_DESCRIPTOR)
field(SUPPLEMENTARYCONFIGURATION_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(VERSION_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ACCOUNTID_DESCRIPTOR.index -> builder.accountId = deserializeString()
ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
AVAILABILITYZONE_DESCRIPTOR.index -> builder.availabilityZone = deserializeString()
AWSREGION_DESCRIPTOR.index -> builder.awsRegion = deserializeString()
CONFIGURATION_DESCRIPTOR.index -> builder.configuration = deserializeString()
CONFIGURATIONITEMCAPTURETIME_DESCRIPTOR.index -> builder.configurationItemCaptureTime = deserializeString().let { Instant.fromEpochSeconds(it) }
CONFIGURATIONITEMMD5HASH_DESCRIPTOR.index -> builder.configurationItemMd5Hash = deserializeString()
CONFIGURATIONITEMSTATUS_DESCRIPTOR.index -> builder.configurationItemStatus = deserializeString().let { ConfigurationItemStatus.fromValue(it) }
CONFIGURATIONSTATEID_DESCRIPTOR.index -> builder.configurationStateId = deserializeString()
RELATEDEVENTS_DESCRIPTOR.index -> builder.relatedEvents =
deserializer.deserializeList(RELATEDEVENTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
RELATIONSHIPS_DESCRIPTOR.index -> builder.relationships =
deserializer.deserializeList(RELATIONSHIPS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeRelationshipDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
RESOURCECREATIONTIME_DESCRIPTOR.index -> builder.resourceCreationTime = deserializeString().let { Instant.fromEpochSeconds(it) }
RESOURCEID_DESCRIPTOR.index -> builder.resourceId = deserializeString()
RESOURCENAME_DESCRIPTOR.index -> builder.resourceName = deserializeString()
RESOURCETYPE_DESCRIPTOR.index -> builder.resourceType = deserializeString().let { ResourceType.fromValue(it) }
SUPPLEMENTARYCONFIGURATION_DESCRIPTOR.index -> builder.supplementaryConfiguration =
deserializer.deserializeMap(SUPPLEMENTARYCONFIGURATION_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
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
}
VERSION_DESCRIPTOR.index -> builder.version = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy