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

commonMain.aws.sdk.kotlin.services.translate.serde.TextTranslationJobPropertiesDocumentDeserializer.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.JobStatus
import aws.sdk.kotlin.services.translate.model.TextTranslationJobProperties
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 deserializeTextTranslationJobPropertiesDocument(deserializer: Deserializer): TextTranslationJobProperties {
    val builder = TextTranslationJobProperties.Builder()
    val DATAACCESSROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DataAccessRoleArn"))
    val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("EndTime"))
    val INPUTDATACONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("InputDataConfig"))
    val JOBDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("JobDetails"))
    val JOBID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("JobId"))
    val JOBNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("JobName"))
    val JOBSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("JobStatus"))
    val MESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Message"))
    val OUTPUTDATACONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("OutputDataConfig"))
    val PARALLELDATANAMES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ParallelDataNames"))
    val SETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Settings"))
    val SOURCELANGUAGECODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SourceLanguageCode"))
    val SUBMITTEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("SubmittedTime"))
    val TARGETLANGUAGECODES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("TargetLanguageCodes"))
    val TERMINOLOGYNAMES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("TerminologyNames"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DATAACCESSROLEARN_DESCRIPTOR)
        field(ENDTIME_DESCRIPTOR)
        field(INPUTDATACONFIG_DESCRIPTOR)
        field(JOBDETAILS_DESCRIPTOR)
        field(JOBID_DESCRIPTOR)
        field(JOBNAME_DESCRIPTOR)
        field(JOBSTATUS_DESCRIPTOR)
        field(MESSAGE_DESCRIPTOR)
        field(OUTPUTDATACONFIG_DESCRIPTOR)
        field(PARALLELDATANAMES_DESCRIPTOR)
        field(SETTINGS_DESCRIPTOR)
        field(SOURCELANGUAGECODE_DESCRIPTOR)
        field(SUBMITTEDTIME_DESCRIPTOR)
        field(TARGETLANGUAGECODES_DESCRIPTOR)
        field(TERMINOLOGYNAMES_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DATAACCESSROLEARN_DESCRIPTOR.index -> builder.dataAccessRoleArn = deserializeString()
                ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                INPUTDATACONFIG_DESCRIPTOR.index -> builder.inputDataConfig = deserializeInputDataConfigDocument(deserializer)
                JOBDETAILS_DESCRIPTOR.index -> builder.jobDetails = deserializeJobDetailsDocument(deserializer)
                JOBID_DESCRIPTOR.index -> builder.jobId = deserializeString()
                JOBNAME_DESCRIPTOR.index -> builder.jobName = deserializeString()
                JOBSTATUS_DESCRIPTOR.index -> builder.jobStatus = deserializeString().let { JobStatus.fromValue(it) }
                MESSAGE_DESCRIPTOR.index -> builder.message = deserializeString()
                OUTPUTDATACONFIG_DESCRIPTOR.index -> builder.outputDataConfig = deserializeOutputDataConfigDocument(deserializer)
                PARALLELDATANAMES_DESCRIPTOR.index -> builder.parallelDataNames =
                    deserializer.deserializeList(PARALLELDATANAMES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SETTINGS_DESCRIPTOR.index -> builder.settings = deserializeTranslationSettingsDocument(deserializer)
                SOURCELANGUAGECODE_DESCRIPTOR.index -> builder.sourceLanguageCode = deserializeString()
                SUBMITTEDTIME_DESCRIPTOR.index -> builder.submittedTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                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
                    }
                TERMINOLOGYNAMES_DESCRIPTOR.index -> builder.terminologyNames =
                    deserializer.deserializeList(TERMINOLOGYNAMES_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