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

commonMain.aws.sdk.kotlin.services.medicalimaging.serde.ImageSetPropertiesDocumentDeserializer.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.medicalimaging.serde

import aws.sdk.kotlin.services.medicalimaging.model.ImageSetProperties
import aws.sdk.kotlin.services.medicalimaging.model.ImageSetState
import aws.sdk.kotlin.services.medicalimaging.model.ImageSetWorkflowStatus
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 deserializeImageSetPropertiesDocument(deserializer: Deserializer): ImageSetProperties {
    val builder = ImageSetProperties.Builder()
    val IMAGESETWORKFLOWSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ImageSetWorkflowStatus"))
    val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
    val DELETEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("deletedAt"))
    val IMAGESETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("imageSetId"))
    val IMAGESETSTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("imageSetState"))
    val MESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("message"))
    val OVERRIDES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("overrides"))
    val UPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("updatedAt"))
    val VERSIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("versionId"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(IMAGESETWORKFLOWSTATUS_DESCRIPTOR)
        field(CREATEDAT_DESCRIPTOR)
        field(DELETEDAT_DESCRIPTOR)
        field(IMAGESETID_DESCRIPTOR)
        field(IMAGESETSTATE_DESCRIPTOR)
        field(MESSAGE_DESCRIPTOR)
        field(OVERRIDES_DESCRIPTOR)
        field(UPDATEDAT_DESCRIPTOR)
        field(VERSIONID_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                IMAGESETWORKFLOWSTATUS_DESCRIPTOR.index -> builder.imageSetWorkflowStatus = deserializeString().let { ImageSetWorkflowStatus.fromValue(it) }
                CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DELETEDAT_DESCRIPTOR.index -> builder.deletedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                IMAGESETID_DESCRIPTOR.index -> builder.imageSetId = deserializeString()
                IMAGESETSTATE_DESCRIPTOR.index -> builder.imageSetState = deserializeString().let { ImageSetState.fromValue(it) }
                MESSAGE_DESCRIPTOR.index -> builder.message = deserializeString()
                OVERRIDES_DESCRIPTOR.index -> builder.overrides = deserializeOverridesDocument(deserializer)
                UPDATEDAT_DESCRIPTOR.index -> builder.updatedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                VERSIONID_DESCRIPTOR.index -> builder.versionId = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy