commonMain.aws.sdk.kotlin.services.wisdom.serde.ImportJobSummaryDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wisdom-jvm Show documentation
Show all versions of wisdom-jvm Show documentation
The AWS SDK for Kotlin client for Wisdom
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.wisdom.serde
import aws.sdk.kotlin.services.wisdom.model.ImportJobStatus
import aws.sdk.kotlin.services.wisdom.model.ImportJobSummary
import aws.sdk.kotlin.services.wisdom.model.ImportJobType
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.mutableMapOf
internal fun deserializeImportJobSummaryDocument(deserializer: Deserializer): ImportJobSummary {
val builder = ImportJobSummary.Builder()
val CREATEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdTime"))
val EXTERNALSOURCECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("externalSourceConfiguration"))
val IMPORTJOBID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("importJobId"))
val IMPORTJOBTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("importJobType"))
val KNOWLEDGEBASEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("knowledgeBaseArn"))
val KNOWLEDGEBASEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("knowledgeBaseId"))
val LASTMODIFIEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastModifiedTime"))
val METADATA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("metadata"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
val UPLOADID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("uploadId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CREATEDTIME_DESCRIPTOR)
field(EXTERNALSOURCECONFIGURATION_DESCRIPTOR)
field(IMPORTJOBID_DESCRIPTOR)
field(IMPORTJOBTYPE_DESCRIPTOR)
field(KNOWLEDGEBASEARN_DESCRIPTOR)
field(KNOWLEDGEBASEID_DESCRIPTOR)
field(LASTMODIFIEDTIME_DESCRIPTOR)
field(METADATA_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(UPLOADID_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CREATEDTIME_DESCRIPTOR.index -> builder.createdTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
EXTERNALSOURCECONFIGURATION_DESCRIPTOR.index -> builder.externalSourceConfiguration = deserializeExternalSourceConfigurationDocument(deserializer)
IMPORTJOBID_DESCRIPTOR.index -> builder.importJobId = deserializeString()
IMPORTJOBTYPE_DESCRIPTOR.index -> builder.importJobType = deserializeString().let { ImportJobType.fromValue(it) }
KNOWLEDGEBASEARN_DESCRIPTOR.index -> builder.knowledgeBaseArn = deserializeString()
KNOWLEDGEBASEID_DESCRIPTOR.index -> builder.knowledgeBaseId = deserializeString()
LASTMODIFIEDTIME_DESCRIPTOR.index -> builder.lastModifiedTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
METADATA_DESCRIPTOR.index -> builder.metadata =
deserializer.deserializeMap(METADATA_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { ImportJobStatus.fromValue(it) }
UPLOADID_DESCRIPTOR.index -> builder.uploadId = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}