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

commonMain.aws.sdk.kotlin.services.redshiftserverless.serde.ScheduledActionResponseDocumentDeserializer.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.redshiftserverless.serde

import aws.sdk.kotlin.services.redshiftserverless.model.ScheduledActionResponse
import aws.sdk.kotlin.services.redshiftserverless.model.State
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 deserializeScheduledActionResponseDocument(deserializer: Deserializer): ScheduledActionResponse {
    val builder = ScheduledActionResponse.Builder()
    val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("endTime"))
    val NAMESPACENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("namespaceName"))
    val NEXTINVOCATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("nextInvocations"))
    val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("roleArn"))
    val SCHEDULE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("schedule"))
    val SCHEDULEDACTIONDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("scheduledActionDescription"))
    val SCHEDULEDACTIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("scheduledActionName"))
    val SCHEDULEDACTIONUUID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("scheduledActionUuid"))
    val STARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("startTime"))
    val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("state"))
    val TARGETACTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("targetAction"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ENDTIME_DESCRIPTOR)
        field(NAMESPACENAME_DESCRIPTOR)
        field(NEXTINVOCATIONS_DESCRIPTOR)
        field(ROLEARN_DESCRIPTOR)
        field(SCHEDULE_DESCRIPTOR)
        field(SCHEDULEDACTIONDESCRIPTION_DESCRIPTOR)
        field(SCHEDULEDACTIONNAME_DESCRIPTOR)
        field(SCHEDULEDACTIONUUID_DESCRIPTOR)
        field(STARTTIME_DESCRIPTOR)
        field(STATE_DESCRIPTOR)
        field(TARGETACTION_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                NAMESPACENAME_DESCRIPTOR.index -> builder.namespaceName = deserializeString()
                NEXTINVOCATIONS_DESCRIPTOR.index -> builder.nextInvocations =
                    deserializer.deserializeList(NEXTINVOCATIONS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeInstant(TimestampFormat.EPOCH_SECONDS) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                ROLEARN_DESCRIPTOR.index -> builder.roleArn = deserializeString()
                SCHEDULE_DESCRIPTOR.index -> builder.schedule = deserializeScheduleDocument(deserializer)
                SCHEDULEDACTIONDESCRIPTION_DESCRIPTOR.index -> builder.scheduledActionDescription = deserializeString()
                SCHEDULEDACTIONNAME_DESCRIPTOR.index -> builder.scheduledActionName = deserializeString()
                SCHEDULEDACTIONUUID_DESCRIPTOR.index -> builder.scheduledActionUuid = deserializeString()
                STARTTIME_DESCRIPTOR.index -> builder.startTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { State.fromValue(it) }
                TARGETACTION_DESCRIPTOR.index -> builder.targetAction = deserializeTargetActionDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy