commonMain.aws.sdk.kotlin.services.redshiftserverless.serde.ScheduledActionResponseDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redshiftserverless-jvm Show documentation
Show all versions of redshiftserverless-jvm Show documentation
The AWS SDK for Kotlin client for Redshift Serverless
// 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()
}