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

commonMain.aws.sdk.kotlin.services.datazone.serde.DataSourceRunActivityDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.datazone.serde

import aws.sdk.kotlin.services.datazone.model.DataAssetActivityStatus
import aws.sdk.kotlin.services.datazone.model.DataSourceRunActivity
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

internal fun deserializeDataSourceRunActivityDocument(deserializer: Deserializer): DataSourceRunActivity {
    val builder = DataSourceRunActivity.Builder()
    val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
    val DATAASSETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("dataAssetId"))
    val DATAASSETSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("dataAssetStatus"))
    val DATASOURCERUNID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("dataSourceRunId"))
    val DATABASE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("database"))
    val ERRORMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("errorMessage"))
    val PROJECTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("projectId"))
    val TECHNICALDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("technicalDescription"))
    val TECHNICALNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("technicalName"))
    val UPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("updatedAt"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CREATEDAT_DESCRIPTOR)
        field(DATAASSETID_DESCRIPTOR)
        field(DATAASSETSTATUS_DESCRIPTOR)
        field(DATASOURCERUNID_DESCRIPTOR)
        field(DATABASE_DESCRIPTOR)
        field(ERRORMESSAGE_DESCRIPTOR)
        field(PROJECTID_DESCRIPTOR)
        field(TECHNICALDESCRIPTION_DESCRIPTOR)
        field(TECHNICALNAME_DESCRIPTOR)
        field(UPDATEDAT_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.ISO_8601)
                DATAASSETID_DESCRIPTOR.index -> builder.dataAssetId = deserializeString()
                DATAASSETSTATUS_DESCRIPTOR.index -> builder.dataAssetStatus = deserializeString().let { DataAssetActivityStatus.fromValue(it) }
                DATASOURCERUNID_DESCRIPTOR.index -> builder.dataSourceRunId = deserializeString()
                DATABASE_DESCRIPTOR.index -> builder.database = deserializeString()
                ERRORMESSAGE_DESCRIPTOR.index -> builder.errorMessage = deserializeDataSourceErrorMessageDocument(deserializer)
                PROJECTID_DESCRIPTOR.index -> builder.projectId = deserializeString()
                TECHNICALDESCRIPTION_DESCRIPTOR.index -> builder.technicalDescription = deserializeString()
                TECHNICALNAME_DESCRIPTOR.index -> builder.technicalName = deserializeString()
                UPDATEDAT_DESCRIPTOR.index -> builder.updatedAt = deserializeInstant(TimestampFormat.ISO_8601)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy