
commonMain.aws.sdk.kotlin.services.rekognition.serde.ProjectDescriptionDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.rekognition.serde
import aws.sdk.kotlin.services.rekognition.model.CustomizationFeature
import aws.sdk.kotlin.services.rekognition.model.DatasetMetadata
import aws.sdk.kotlin.services.rekognition.model.ProjectAutoUpdate
import aws.sdk.kotlin.services.rekognition.model.ProjectDescription
import aws.sdk.kotlin.services.rekognition.model.ProjectStatus
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 deserializeProjectDescriptionDocument(deserializer: Deserializer): ProjectDescription {
val builder = ProjectDescription.Builder()
val AUTOUPDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("AutoUpdate"))
val CREATIONTIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTimestamp"))
val DATASETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Datasets"))
val FEATURE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Feature"))
val PROJECTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ProjectArn"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(AUTOUPDATE_DESCRIPTOR)
field(CREATIONTIMESTAMP_DESCRIPTOR)
field(DATASETS_DESCRIPTOR)
field(FEATURE_DESCRIPTOR)
field(PROJECTARN_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
AUTOUPDATE_DESCRIPTOR.index -> builder.autoUpdate = deserializeString().let { ProjectAutoUpdate.fromValue(it) }
CREATIONTIMESTAMP_DESCRIPTOR.index -> builder.creationTimestamp = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
DATASETS_DESCRIPTOR.index -> builder.datasets =
deserializer.deserializeList(DATASETS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeDatasetMetadataDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
FEATURE_DESCRIPTOR.index -> builder.feature = deserializeString().let { CustomizationFeature.fromValue(it) }
PROJECTARN_DESCRIPTOR.index -> builder.projectArn = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { ProjectStatus.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy