commonMain.aws.sdk.kotlin.services.shield.transform.AttackPropertyDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.shield.transform
import aws.sdk.kotlin.services.shield.model.AttackLayer
import aws.sdk.kotlin.services.shield.model.AttackProperty
import aws.sdk.kotlin.services.shield.model.AttackPropertyIdentifier
import aws.sdk.kotlin.services.shield.model.Contributor
import aws.sdk.kotlin.services.shield.model.ShieldUnit
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
internal fun deserializeAttackPropertyDocument(deserializer: Deserializer): AttackProperty {
val builder = AttackProperty.Builder()
val ATTACKLAYER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AttackLayer"))
val ATTACKPROPERTYIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AttackPropertyIdentifier"))
val TOPCONTRIBUTORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("TopContributors"))
val TOTAL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("Total"))
val UNIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Unit"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ATTACKLAYER_DESCRIPTOR)
field(ATTACKPROPERTYIDENTIFIER_DESCRIPTOR)
field(TOPCONTRIBUTORS_DESCRIPTOR)
field(TOTAL_DESCRIPTOR)
field(UNIT_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ATTACKLAYER_DESCRIPTOR.index -> builder.attackLayer = deserializeString().let { AttackLayer.fromValue(it) }
ATTACKPROPERTYIDENTIFIER_DESCRIPTOR.index -> builder.attackPropertyIdentifier = deserializeString().let { AttackPropertyIdentifier.fromValue(it) }
TOPCONTRIBUTORS_DESCRIPTOR.index -> builder.topContributors =
deserializer.deserializeList(TOPCONTRIBUTORS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeContributorDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
TOTAL_DESCRIPTOR.index -> builder.total = deserializeLong()
UNIT_DESCRIPTOR.index -> builder.unit = deserializeString().let { ShieldUnit.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy