commonMain.aws.sdk.kotlin.services.glue.serde.BlueprintRunDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glue-jvm Show documentation
Show all versions of glue-jvm Show documentation
The AWS SDK for Kotlin client for Glue
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.serde
import aws.sdk.kotlin.services.glue.model.BlueprintRun
import aws.sdk.kotlin.services.glue.model.BlueprintRunState
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 deserializeBlueprintRunDocument(deserializer: Deserializer): BlueprintRun {
val builder = BlueprintRun.Builder()
val BLUEPRINTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("BlueprintName"))
val COMPLETEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CompletedOn"))
val ERRORMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ErrorMessage"))
val PARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Parameters"))
val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RoleArn"))
val ROLLBACKERRORMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RollbackErrorMessage"))
val RUNID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RunId"))
val STARTEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("StartedOn"))
val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("State"))
val WORKFLOWNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("WorkflowName"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(BLUEPRINTNAME_DESCRIPTOR)
field(COMPLETEDON_DESCRIPTOR)
field(ERRORMESSAGE_DESCRIPTOR)
field(PARAMETERS_DESCRIPTOR)
field(ROLEARN_DESCRIPTOR)
field(ROLLBACKERRORMESSAGE_DESCRIPTOR)
field(RUNID_DESCRIPTOR)
field(STARTEDON_DESCRIPTOR)
field(STATE_DESCRIPTOR)
field(WORKFLOWNAME_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
BLUEPRINTNAME_DESCRIPTOR.index -> builder.blueprintName = deserializeString()
COMPLETEDON_DESCRIPTOR.index -> builder.completedOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
ERRORMESSAGE_DESCRIPTOR.index -> builder.errorMessage = deserializeString()
PARAMETERS_DESCRIPTOR.index -> builder.parameters = deserializeString()
ROLEARN_DESCRIPTOR.index -> builder.roleArn = deserializeString()
ROLLBACKERRORMESSAGE_DESCRIPTOR.index -> builder.rollbackErrorMessage = deserializeString()
RUNID_DESCRIPTOR.index -> builder.runId = deserializeString()
STARTEDON_DESCRIPTOR.index -> builder.startedOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { BlueprintRunState.fromValue(it) }
WORKFLOWNAME_DESCRIPTOR.index -> builder.workflowName = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}