commonMain.aws.sdk.kotlin.services.codedeploy.serde.DeploymentConfigInfoDocumentDeserializer.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.ComputePlatform
import aws.sdk.kotlin.services.codedeploy.model.DeploymentConfigInfo
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 aws.smithy.kotlin.runtime.time.TimestampFormat
internal fun deserializeDeploymentConfigInfoDocument(deserializer: Deserializer): DeploymentConfigInfo {
val builder = DeploymentConfigInfo.Builder()
val COMPUTEPLATFORM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("computePlatform"))
val CREATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createTime"))
val DEPLOYMENTCONFIGID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("deploymentConfigId"))
val DEPLOYMENTCONFIGNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("deploymentConfigName"))
val MINIMUMHEALTHYHOSTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("minimumHealthyHosts"))
val TRAFFICROUTINGCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("trafficRoutingConfig"))
val ZONALCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("zonalConfig"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(COMPUTEPLATFORM_DESCRIPTOR)
field(CREATETIME_DESCRIPTOR)
field(DEPLOYMENTCONFIGID_DESCRIPTOR)
field(DEPLOYMENTCONFIGNAME_DESCRIPTOR)
field(MINIMUMHEALTHYHOSTS_DESCRIPTOR)
field(TRAFFICROUTINGCONFIG_DESCRIPTOR)
field(ZONALCONFIG_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
COMPUTEPLATFORM_DESCRIPTOR.index -> builder.computePlatform = deserializeString().let { ComputePlatform.fromValue(it) }
CREATETIME_DESCRIPTOR.index -> builder.createTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
DEPLOYMENTCONFIGID_DESCRIPTOR.index -> builder.deploymentConfigId = deserializeString()
DEPLOYMENTCONFIGNAME_DESCRIPTOR.index -> builder.deploymentConfigName = deserializeString()
MINIMUMHEALTHYHOSTS_DESCRIPTOR.index -> builder.minimumHealthyHosts = deserializeMinimumHealthyHostsDocument(deserializer)
TRAFFICROUTINGCONFIG_DESCRIPTOR.index -> builder.trafficRoutingConfig = deserializeTrafficRoutingConfigDocument(deserializer)
ZONALCONFIG_DESCRIPTOR.index -> builder.zonalConfig = deserializeZonalConfigDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}