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

commonMain.aws.sdk.kotlin.services.appflow.serde.ScheduledTriggerPropertiesDocumentDeserializer.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.appflow.serde

import aws.sdk.kotlin.services.appflow.model.DataPullMode
import aws.sdk.kotlin.services.appflow.model.ScheduledTriggerProperties
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 deserializeScheduledTriggerPropertiesDocument(deserializer: Deserializer): ScheduledTriggerProperties {
    val builder = ScheduledTriggerProperties.Builder()
    val DATAPULLMODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("dataPullMode"))
    val FIRSTEXECUTIONFROM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("firstExecutionFrom"))
    val FLOWERRORDEACTIVATIONTHRESHOLD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("flowErrorDeactivationThreshold"))
    val SCHEDULEENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("scheduleEndTime"))
    val SCHEDULEEXPRESSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("scheduleExpression"))
    val SCHEDULEOFFSET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("scheduleOffset"))
    val SCHEDULESTARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("scheduleStartTime"))
    val TIMEZONE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("timezone"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DATAPULLMODE_DESCRIPTOR)
        field(FIRSTEXECUTIONFROM_DESCRIPTOR)
        field(FLOWERRORDEACTIVATIONTHRESHOLD_DESCRIPTOR)
        field(SCHEDULEENDTIME_DESCRIPTOR)
        field(SCHEDULEEXPRESSION_DESCRIPTOR)
        field(SCHEDULEOFFSET_DESCRIPTOR)
        field(SCHEDULESTARTTIME_DESCRIPTOR)
        field(TIMEZONE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DATAPULLMODE_DESCRIPTOR.index -> builder.dataPullMode = deserializeString().let { DataPullMode.fromValue(it) }
                FIRSTEXECUTIONFROM_DESCRIPTOR.index -> builder.firstExecutionFrom = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                FLOWERRORDEACTIVATIONTHRESHOLD_DESCRIPTOR.index -> builder.flowErrorDeactivationThreshold = deserializeInt()
                SCHEDULEENDTIME_DESCRIPTOR.index -> builder.scheduleEndTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                SCHEDULEEXPRESSION_DESCRIPTOR.index -> builder.scheduleExpression = deserializeString()
                SCHEDULEOFFSET_DESCRIPTOR.index -> builder.scheduleOffset = deserializeLong()
                SCHEDULESTARTTIME_DESCRIPTOR.index -> builder.scheduleStartTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                TIMEZONE_DESCRIPTOR.index -> builder.timezone = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy