commonMain.aws.sdk.kotlin.services.applicationdiscoveryservice.serde.BatchDeleteConfigurationTaskDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of applicationdiscoveryservice-jvm Show documentation
Show all versions of applicationdiscoveryservice-jvm Show documentation
The AWS SDK for Kotlin client for Application Discovery Service
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.applicationdiscoveryservice.serde
import aws.sdk.kotlin.services.applicationdiscoveryservice.model.BatchDeleteConfigurationTask
import aws.sdk.kotlin.services.applicationdiscoveryservice.model.BatchDeleteConfigurationTaskStatus
import aws.sdk.kotlin.services.applicationdiscoveryservice.model.DeletionConfigurationItemType
import aws.sdk.kotlin.services.applicationdiscoveryservice.model.DeletionWarning
import aws.sdk.kotlin.services.applicationdiscoveryservice.model.FailedConfiguration
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
import kotlin.collections.mutableListOf
internal fun deserializeBatchDeleteConfigurationTaskDocument(deserializer: Deserializer): BatchDeleteConfigurationTask {
val builder = BatchDeleteConfigurationTask.Builder()
val CONFIGURATIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("configurationType"))
val DELETEDCONFIGURATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("deletedConfigurations"))
val DELETIONWARNINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("deletionWarnings"))
val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("endTime"))
val FAILEDCONFIGURATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("failedConfigurations"))
val REQUESTEDCONFIGURATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("requestedConfigurations"))
val STARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("startTime"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("status"))
val TASKID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("taskId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CONFIGURATIONTYPE_DESCRIPTOR)
field(DELETEDCONFIGURATIONS_DESCRIPTOR)
field(DELETIONWARNINGS_DESCRIPTOR)
field(ENDTIME_DESCRIPTOR)
field(FAILEDCONFIGURATIONS_DESCRIPTOR)
field(REQUESTEDCONFIGURATIONS_DESCRIPTOR)
field(STARTTIME_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(TASKID_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CONFIGURATIONTYPE_DESCRIPTOR.index -> builder.configurationType = deserializeString().let { DeletionConfigurationItemType.fromValue(it) }
DELETEDCONFIGURATIONS_DESCRIPTOR.index -> builder.deletedConfigurations =
deserializer.deserializeList(DELETEDCONFIGURATIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
DELETIONWARNINGS_DESCRIPTOR.index -> builder.deletionWarnings =
deserializer.deserializeList(DELETIONWARNINGS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeDeletionWarningDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
FAILEDCONFIGURATIONS_DESCRIPTOR.index -> builder.failedConfigurations =
deserializer.deserializeList(FAILEDCONFIGURATIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeFailedConfigurationDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
REQUESTEDCONFIGURATIONS_DESCRIPTOR.index -> builder.requestedConfigurations =
deserializer.deserializeList(REQUESTEDCONFIGURATIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
STARTTIME_DESCRIPTOR.index -> builder.startTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { BatchDeleteConfigurationTaskStatus.fromValue(it) }
TASKID_DESCRIPTOR.index -> builder.taskId = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}