commonMain.aws.sdk.kotlin.services.resiliencehub.serde.ComplianceDriftDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resiliencehub-jvm Show documentation
Show all versions of resiliencehub-jvm Show documentation
The AWS SDK for Kotlin client for resiliencehub
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.resiliencehub.serde
import aws.sdk.kotlin.services.resiliencehub.model.ComplianceDrift
import aws.sdk.kotlin.services.resiliencehub.model.DifferenceType
import aws.sdk.kotlin.services.resiliencehub.model.DisruptionCompliance
import aws.sdk.kotlin.services.resiliencehub.model.DisruptionType
import aws.sdk.kotlin.services.resiliencehub.model.DriftType
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 deserializeComplianceDriftDocument(deserializer: Deserializer): ComplianceDrift {
val builder = ComplianceDrift.Builder()
val ACTUALREFERENCEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("actualReferenceId"))
val ACTUALVALUE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("actualValue"))
val APPID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("appId"))
val APPVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("appVersion"))
val DIFFTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("diffType"))
val DRIFTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("driftType"))
val ENTITYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("entityId"))
val ENTITYTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("entityType"))
val EXPECTEDREFERENCEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("expectedReferenceId"))
val EXPECTEDVALUE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("expectedValue"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACTUALREFERENCEID_DESCRIPTOR)
field(ACTUALVALUE_DESCRIPTOR)
field(APPID_DESCRIPTOR)
field(APPVERSION_DESCRIPTOR)
field(DIFFTYPE_DESCRIPTOR)
field(DRIFTTYPE_DESCRIPTOR)
field(ENTITYID_DESCRIPTOR)
field(ENTITYTYPE_DESCRIPTOR)
field(EXPECTEDREFERENCEID_DESCRIPTOR)
field(EXPECTEDVALUE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ACTUALREFERENCEID_DESCRIPTOR.index -> builder.actualReferenceId = deserializeString()
ACTUALVALUE_DESCRIPTOR.index -> builder.actualValue =
deserializer.deserializeMap(ACTUALVALUE_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = DisruptionType.fromValue(key())
val v0 = if (nextHasValue()) { deserializeDisruptionComplianceDocument(deserializer) } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
APPID_DESCRIPTOR.index -> builder.appId = deserializeString()
APPVERSION_DESCRIPTOR.index -> builder.appVersion = deserializeString()
DIFFTYPE_DESCRIPTOR.index -> builder.diffType = deserializeString().let { DifferenceType.fromValue(it) }
DRIFTTYPE_DESCRIPTOR.index -> builder.driftType = deserializeString().let { DriftType.fromValue(it) }
ENTITYID_DESCRIPTOR.index -> builder.entityId = deserializeString()
ENTITYTYPE_DESCRIPTOR.index -> builder.entityType = deserializeString()
EXPECTEDREFERENCEID_DESCRIPTOR.index -> builder.expectedReferenceId = deserializeString()
EXPECTEDVALUE_DESCRIPTOR.index -> builder.expectedValue =
deserializer.deserializeMap(EXPECTEDVALUE_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = DisruptionType.fromValue(key())
val v0 = if (nextHasValue()) { deserializeDisruptionComplianceDocument(deserializer) } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}