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

commonMain.aws.sdk.kotlin.services.datazone.serde.DataSourceSummaryDocumentDeserializer.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.DataSourceRunStatus
import aws.sdk.kotlin.services.datazone.model.DataSourceStatus
import aws.sdk.kotlin.services.datazone.model.DataSourceSummary
import aws.sdk.kotlin.services.datazone.model.EnableSetting
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 deserializeDataSourceSummaryDocument(deserializer: Deserializer): DataSourceSummary {
    val builder = DataSourceSummary.Builder()
    val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
    val DATASOURCEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("dataSourceId"))
    val DOMAINID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("domainId"))
    val ENABLESETTING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("enableSetting"))
    val ENVIRONMENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("environmentId"))
    val LASTRUNASSETCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("lastRunAssetCount"))
    val LASTRUNAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastRunAt"))
    val LASTRUNERRORMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("lastRunErrorMessage"))
    val LASTRUNSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("lastRunStatus"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    val SCHEDULE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("schedule"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("status"))
    val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("type"))
    val UPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("updatedAt"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CREATEDAT_DESCRIPTOR)
        field(DATASOURCEID_DESCRIPTOR)
        field(DOMAINID_DESCRIPTOR)
        field(ENABLESETTING_DESCRIPTOR)
        field(ENVIRONMENTID_DESCRIPTOR)
        field(LASTRUNASSETCOUNT_DESCRIPTOR)
        field(LASTRUNAT_DESCRIPTOR)
        field(LASTRUNERRORMESSAGE_DESCRIPTOR)
        field(LASTRUNSTATUS_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(SCHEDULE_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(TYPE_DESCRIPTOR)
        field(UPDATEDAT_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.ISO_8601)
                DATASOURCEID_DESCRIPTOR.index -> builder.dataSourceId = deserializeString()
                DOMAINID_DESCRIPTOR.index -> builder.domainId = deserializeString()
                ENABLESETTING_DESCRIPTOR.index -> builder.enableSetting = deserializeString().let { EnableSetting.fromValue(it) }
                ENVIRONMENTID_DESCRIPTOR.index -> builder.environmentId = deserializeString()
                LASTRUNASSETCOUNT_DESCRIPTOR.index -> builder.lastRunAssetCount = deserializeInt()
                LASTRUNAT_DESCRIPTOR.index -> builder.lastRunAt = deserializeInstant(TimestampFormat.ISO_8601)
                LASTRUNERRORMESSAGE_DESCRIPTOR.index -> builder.lastRunErrorMessage = deserializeDataSourceErrorMessageDocument(deserializer)
                LASTRUNSTATUS_DESCRIPTOR.index -> builder.lastRunStatus = deserializeString().let { DataSourceRunStatus.fromValue(it) }
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                SCHEDULE_DESCRIPTOR.index -> builder.schedule = deserializeScheduleConfigurationDocument(deserializer)
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { DataSourceStatus.fromValue(it) }
                TYPE_DESCRIPTOR.index -> builder.type = 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