commonMain.aws.sdk.kotlin.services.codecatalyst.serde.WorkflowSummaryDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codecatalyst-jvm Show documentation
Show all versions of codecatalyst-jvm Show documentation
The AWS SDK for Kotlin client for CodeCatalyst
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codecatalyst.serde
import aws.sdk.kotlin.services.codecatalyst.model.WorkflowRunMode
import aws.sdk.kotlin.services.codecatalyst.model.WorkflowStatus
import aws.sdk.kotlin.services.codecatalyst.model.WorkflowSummary
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 deserializeWorkflowSummaryDocument(deserializer: Deserializer): WorkflowSummary {
val builder = WorkflowSummary.Builder()
val CREATEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdTime"))
val DEFINITION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("definition"))
val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("id"))
val LASTUPDATEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastUpdatedTime"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
val RUNMODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("runMode"))
val SOURCEBRANCHNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("sourceBranchName"))
val SOURCEREPOSITORYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("sourceRepositoryName"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CREATEDTIME_DESCRIPTOR)
field(DEFINITION_DESCRIPTOR)
field(ID_DESCRIPTOR)
field(LASTUPDATEDTIME_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(RUNMODE_DESCRIPTOR)
field(SOURCEBRANCHNAME_DESCRIPTOR)
field(SOURCEREPOSITORYNAME_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CREATEDTIME_DESCRIPTOR.index -> builder.createdTime = deserializeInstant(TimestampFormat.ISO_8601)
DEFINITION_DESCRIPTOR.index -> builder.definition = deserializeWorkflowDefinitionSummaryDocument(deserializer)
ID_DESCRIPTOR.index -> builder.id = deserializeString()
LASTUPDATEDTIME_DESCRIPTOR.index -> builder.lastUpdatedTime = deserializeInstant(TimestampFormat.ISO_8601)
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
RUNMODE_DESCRIPTOR.index -> builder.runMode = deserializeString().let { WorkflowRunMode.fromValue(it) }
SOURCEBRANCHNAME_DESCRIPTOR.index -> builder.sourceBranchName = deserializeString()
SOURCEREPOSITORYNAME_DESCRIPTOR.index -> builder.sourceRepositoryName = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { WorkflowStatus.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}