
commonMain.aws.sdk.kotlin.services.directconnect.serde.MacSecKeyDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.directconnect.serde
import aws.sdk.kotlin.services.directconnect.model.MacSecKey
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 deserializeMacSecKeyDocument(deserializer: Deserializer): MacSecKey {
val builder = MacSecKey.Builder()
val CKN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ckn"))
val SECRETARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("secretARN"))
val STARTON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("startOn"))
val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("state"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CKN_DESCRIPTOR)
field(SECRETARN_DESCRIPTOR)
field(STARTON_DESCRIPTOR)
field(STATE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CKN_DESCRIPTOR.index -> builder.ckn = deserializeString()
SECRETARN_DESCRIPTOR.index -> builder.secretArn = deserializeString()
STARTON_DESCRIPTOR.index -> builder.startOn = deserializeString()
STATE_DESCRIPTOR.index -> builder.state = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy