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

aws.sdk.kotlin.services.sagemaker.transform.TransformJobSummaryDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.99
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.sagemaker.transform

import aws.sdk.kotlin.services.sagemaker.model.TransformJobStatus
import aws.sdk.kotlin.services.sagemaker.model.TransformJobSummary
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


internal suspend fun deserializeTransformJobSummaryDocument(deserializer: Deserializer): TransformJobSummary {
    val builder = TransformJobSummary.builder()
    val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTime"))
    val FAILUREREASON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FailureReason"))
    val LASTMODIFIEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastModifiedTime"))
    val TRANSFORMENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("TransformEndTime"))
    val TRANSFORMJOBARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TransformJobArn"))
    val TRANSFORMJOBNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TransformJobName"))
    val TRANSFORMJOBSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TransformJobStatus"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CREATIONTIME_DESCRIPTOR)
        field(FAILUREREASON_DESCRIPTOR)
        field(LASTMODIFIEDTIME_DESCRIPTOR)
        field(TRANSFORMENDTIME_DESCRIPTOR)
        field(TRANSFORMJOBARN_DESCRIPTOR)
        field(TRANSFORMJOBNAME_DESCRIPTOR)
        field(TRANSFORMJOBSTATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                FAILUREREASON_DESCRIPTOR.index -> builder.failureReason = deserializeString()
                LASTMODIFIEDTIME_DESCRIPTOR.index -> builder.lastModifiedTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                TRANSFORMENDTIME_DESCRIPTOR.index -> builder.transformEndTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                TRANSFORMJOBARN_DESCRIPTOR.index -> builder.transformJobArn = deserializeString()
                TRANSFORMJOBNAME_DESCRIPTOR.index -> builder.transformJobName = deserializeString()
                TRANSFORMJOBSTATUS_DESCRIPTOR.index -> builder.transformJobStatus = deserializeString().let { TransformJobStatus.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy