commonMain.aws.sdk.kotlin.services.codedeploy.serde.EcsTaskSetDocumentDeserializer.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.EcsTaskSet
import aws.sdk.kotlin.services.codedeploy.model.TargetLabel
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 deserializeEcsTaskSetDocument(deserializer: Deserializer): EcsTaskSet {
val builder = EcsTaskSet.Builder()
val DESIREDCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("desiredCount"))
val IDENTIFER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("identifer"))
val PENDINGCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("pendingCount"))
val RUNNINGCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("runningCount"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
val TARGETGROUP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("targetGroup"))
val TASKSETLABEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("taskSetLabel"))
val TRAFFICWEIGHT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("trafficWeight"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DESIREDCOUNT_DESCRIPTOR)
field(IDENTIFER_DESCRIPTOR)
field(PENDINGCOUNT_DESCRIPTOR)
field(RUNNINGCOUNT_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(TARGETGROUP_DESCRIPTOR)
field(TASKSETLABEL_DESCRIPTOR)
field(TRAFFICWEIGHT_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
DESIREDCOUNT_DESCRIPTOR.index -> builder.desiredCount = deserializeLong()
IDENTIFER_DESCRIPTOR.index -> builder.identifer = deserializeString()
PENDINGCOUNT_DESCRIPTOR.index -> builder.pendingCount = deserializeLong()
RUNNINGCOUNT_DESCRIPTOR.index -> builder.runningCount = deserializeLong()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString()
TARGETGROUP_DESCRIPTOR.index -> builder.targetGroup = deserializeTargetGroupInfoDocument(deserializer)
TASKSETLABEL_DESCRIPTOR.index -> builder.taskSetLabel = deserializeString().let { TargetLabel.fromValue(it) }
TRAFFICWEIGHT_DESCRIPTOR.index -> builder.trafficWeight = deserializeDouble()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}