commonMain.aws.sdk.kotlin.services.codedeploy.serde.DeploymentOverviewDocumentDeserializer.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.DeploymentOverview
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 deserializeDeploymentOverviewDocument(deserializer: Deserializer): DeploymentOverview {
val builder = DeploymentOverview.Builder()
val FAILED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("Failed"))
val INPROGRESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("InProgress"))
val PENDING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("Pending"))
val READY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("Ready"))
val SKIPPED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("Skipped"))
val SUCCEEDED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("Succeeded"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(FAILED_DESCRIPTOR)
field(INPROGRESS_DESCRIPTOR)
field(PENDING_DESCRIPTOR)
field(READY_DESCRIPTOR)
field(SKIPPED_DESCRIPTOR)
field(SUCCEEDED_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
FAILED_DESCRIPTOR.index -> builder.failed = deserializeLong()
INPROGRESS_DESCRIPTOR.index -> builder.inProgress = deserializeLong()
PENDING_DESCRIPTOR.index -> builder.pending = deserializeLong()
READY_DESCRIPTOR.index -> builder.ready = deserializeLong()
SKIPPED_DESCRIPTOR.index -> builder.skipped = deserializeLong()
SUCCEEDED_DESCRIPTOR.index -> builder.succeeded = deserializeLong()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}