commonMain.aws.sdk.kotlin.services.appflow.serde.FlowDefinitionDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appflow-jvm Show documentation
Show all versions of appflow-jvm Show documentation
The AWS SDK for Kotlin client for Appflow
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.ConnectorType
import aws.sdk.kotlin.services.appflow.model.FlowDefinition
import aws.sdk.kotlin.services.appflow.model.FlowStatus
import aws.sdk.kotlin.services.appflow.model.TriggerType
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.mutableMapOf
internal fun deserializeFlowDefinitionDocument(deserializer: Deserializer): FlowDefinition {
val builder = FlowDefinition.Builder()
val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
val CREATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("createdBy"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("description"))
val DESTINATIONCONNECTORLABEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("destinationConnectorLabel"))
val DESTINATIONCONNECTORTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("destinationConnectorType"))
val FLOWARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("flowArn"))
val FLOWNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("flowName"))
val FLOWSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("flowStatus"))
val LASTRUNEXECUTIONDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("lastRunExecutionDetails"))
val LASTUPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastUpdatedAt"))
val LASTUPDATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("lastUpdatedBy"))
val SOURCECONNECTORLABEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("sourceConnectorLabel"))
val SOURCECONNECTORTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("sourceConnectorType"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("tags"))
val TRIGGERTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("triggerType"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CREATEDAT_DESCRIPTOR)
field(CREATEDBY_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(DESTINATIONCONNECTORLABEL_DESCRIPTOR)
field(DESTINATIONCONNECTORTYPE_DESCRIPTOR)
field(FLOWARN_DESCRIPTOR)
field(FLOWNAME_DESCRIPTOR)
field(FLOWSTATUS_DESCRIPTOR)
field(LASTRUNEXECUTIONDETAILS_DESCRIPTOR)
field(LASTUPDATEDAT_DESCRIPTOR)
field(LASTUPDATEDBY_DESCRIPTOR)
field(SOURCECONNECTORLABEL_DESCRIPTOR)
field(SOURCECONNECTORTYPE_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(TRIGGERTYPE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
CREATEDBY_DESCRIPTOR.index -> builder.createdBy = deserializeString()
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
DESTINATIONCONNECTORLABEL_DESCRIPTOR.index -> builder.destinationConnectorLabel = deserializeString()
DESTINATIONCONNECTORTYPE_DESCRIPTOR.index -> builder.destinationConnectorType = deserializeString().let { ConnectorType.fromValue(it) }
FLOWARN_DESCRIPTOR.index -> builder.flowArn = deserializeString()
FLOWNAME_DESCRIPTOR.index -> builder.flowName = deserializeString()
FLOWSTATUS_DESCRIPTOR.index -> builder.flowStatus = deserializeString().let { FlowStatus.fromValue(it) }
LASTRUNEXECUTIONDETAILS_DESCRIPTOR.index -> builder.lastRunExecutionDetails = deserializeExecutionDetailsDocument(deserializer)
LASTUPDATEDAT_DESCRIPTOR.index -> builder.lastUpdatedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
LASTUPDATEDBY_DESCRIPTOR.index -> builder.lastUpdatedBy = deserializeString()
SOURCECONNECTORLABEL_DESCRIPTOR.index -> builder.sourceConnectorLabel = deserializeString()
SOURCECONNECTORTYPE_DESCRIPTOR.index -> builder.sourceConnectorType = deserializeString().let { ConnectorType.fromValue(it) }
TAGS_DESCRIPTOR.index -> builder.tags =
deserializer.deserializeMap(TAGS_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
TRIGGERTYPE_DESCRIPTOR.index -> builder.triggerType = deserializeString().let { TriggerType.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}