commonMain.aws.sdk.kotlin.services.codedeploy.serde.DeploymentTargetDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codedeploy-jvm Show documentation
Show all versions of codedeploy-jvm Show documentation
The AWS SDK for Kotlin client for CodeDeploy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codedeploy.serde
import aws.sdk.kotlin.services.codedeploy.model.DeploymentTarget
import aws.sdk.kotlin.services.codedeploy.model.DeploymentTargetType
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 deserializeDeploymentTargetDocument(deserializer: Deserializer): DeploymentTarget {
val builder = DeploymentTarget.Builder()
val CLOUDFORMATIONTARGET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("cloudFormationTarget"))
val DEPLOYMENTTARGETTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("deploymentTargetType"))
val ECSTARGET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ecsTarget"))
val INSTANCETARGET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("instanceTarget"))
val LAMBDATARGET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("lambdaTarget"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CLOUDFORMATIONTARGET_DESCRIPTOR)
field(DEPLOYMENTTARGETTYPE_DESCRIPTOR)
field(ECSTARGET_DESCRIPTOR)
field(INSTANCETARGET_DESCRIPTOR)
field(LAMBDATARGET_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CLOUDFORMATIONTARGET_DESCRIPTOR.index -> builder.cloudFormationTarget = deserializeCloudFormationTargetDocument(deserializer)
DEPLOYMENTTARGETTYPE_DESCRIPTOR.index -> builder.deploymentTargetType = deserializeString().let { DeploymentTargetType.fromValue(it) }
ECSTARGET_DESCRIPTOR.index -> builder.ecsTarget = deserializeEcsTargetDocument(deserializer)
INSTANCETARGET_DESCRIPTOR.index -> builder.instanceTarget = deserializeInstanceTargetDocument(deserializer)
LAMBDATARGET_DESCRIPTOR.index -> builder.lambdaTarget = deserializeLambdaTargetDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}