All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.translate.serde.ParallelDataPropertiesDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.78
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.translate.serde

import aws.sdk.kotlin.services.translate.model.ParallelDataProperties
import aws.sdk.kotlin.services.translate.model.ParallelDataStatus
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 deserializeParallelDataPropertiesDocument(deserializer: Deserializer): ParallelDataProperties {
    val builder = ParallelDataProperties.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Arn"))
    val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreatedAt"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
    val ENCRYPTIONKEY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("EncryptionKey"))
    val FAILEDRECORDCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("FailedRecordCount"))
    val IMPORTEDDATASIZE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("ImportedDataSize"))
    val IMPORTEDRECORDCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("ImportedRecordCount"))
    val LASTUPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastUpdatedAt"))
    val LATESTUPDATEATTEMPTAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LatestUpdateAttemptAt"))
    val LATESTUPDATEATTEMPTSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("LatestUpdateAttemptStatus"))
    val MESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Message"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val PARALLELDATACONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ParallelDataConfig"))
    val SKIPPEDRECORDCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("SkippedRecordCount"))
    val SOURCELANGUAGECODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SourceLanguageCode"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
    val TARGETLANGUAGECODES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("TargetLanguageCodes"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(CREATEDAT_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(ENCRYPTIONKEY_DESCRIPTOR)
        field(FAILEDRECORDCOUNT_DESCRIPTOR)
        field(IMPORTEDDATASIZE_DESCRIPTOR)
        field(IMPORTEDRECORDCOUNT_DESCRIPTOR)
        field(LASTUPDATEDAT_DESCRIPTOR)
        field(LATESTUPDATEATTEMPTAT_DESCRIPTOR)
        field(LATESTUPDATEATTEMPTSTATUS_DESCRIPTOR)
        field(MESSAGE_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(PARALLELDATACONFIG_DESCRIPTOR)
        field(SKIPPEDRECORDCOUNT_DESCRIPTOR)
        field(SOURCELANGUAGECODE_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(TARGETLANGUAGECODES_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                ENCRYPTIONKEY_DESCRIPTOR.index -> builder.encryptionKey = deserializeEncryptionKeyDocument(deserializer)
                FAILEDRECORDCOUNT_DESCRIPTOR.index -> builder.failedRecordCount = deserializeLong()
                IMPORTEDDATASIZE_DESCRIPTOR.index -> builder.importedDataSize = deserializeLong()
                IMPORTEDRECORDCOUNT_DESCRIPTOR.index -> builder.importedRecordCount = deserializeLong()
                LASTUPDATEDAT_DESCRIPTOR.index -> builder.lastUpdatedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                LATESTUPDATEATTEMPTAT_DESCRIPTOR.index -> builder.latestUpdateAttemptAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                LATESTUPDATEATTEMPTSTATUS_DESCRIPTOR.index -> builder.latestUpdateAttemptStatus = deserializeString().let { ParallelDataStatus.fromValue(it) }
                MESSAGE_DESCRIPTOR.index -> builder.message = deserializeString()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                PARALLELDATACONFIG_DESCRIPTOR.index -> builder.parallelDataConfig = deserializeParallelDataConfigDocument(deserializer)
                SKIPPEDRECORDCOUNT_DESCRIPTOR.index -> builder.skippedRecordCount = deserializeLong()
                SOURCELANGUAGECODE_DESCRIPTOR.index -> builder.sourceLanguageCode = deserializeString()
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { ParallelDataStatus.fromValue(it) }
                TARGETLANGUAGECODES_DESCRIPTOR.index -> builder.targetLanguageCodes =
                    deserializer.deserializeList(TARGETLANGUAGECODES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy