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

aws.sdk.kotlin.services.sagemaker.transform.ModelPackageGroupDocumentDeserializer.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.ModelPackageGroup
import aws.sdk.kotlin.services.sagemaker.model.ModelPackageGroupStatus
import aws.sdk.kotlin.services.sagemaker.model.Tag
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 deserializeModelPackageGroupDocument(deserializer: Deserializer): ModelPackageGroup {
    val builder = ModelPackageGroup.builder()
    val CREATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("CreatedBy"))
    val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTime"))
    val MODELPACKAGEGROUPARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ModelPackageGroupArn"))
    val MODELPACKAGEGROUPDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ModelPackageGroupDescription"))
    val MODELPACKAGEGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ModelPackageGroupName"))
    val MODELPACKAGEGROUPSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ModelPackageGroupStatus"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Tags"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CREATEDBY_DESCRIPTOR)
        field(CREATIONTIME_DESCRIPTOR)
        field(MODELPACKAGEGROUPARN_DESCRIPTOR)
        field(MODELPACKAGEGROUPDESCRIPTION_DESCRIPTOR)
        field(MODELPACKAGEGROUPNAME_DESCRIPTOR)
        field(MODELPACKAGEGROUPSTATUS_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CREATEDBY_DESCRIPTOR.index -> builder.createdBy = deserializeUserContextDocument(deserializer)
                CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                MODELPACKAGEGROUPARN_DESCRIPTOR.index -> builder.modelPackageGroupArn = deserializeString()
                MODELPACKAGEGROUPDESCRIPTION_DESCRIPTOR.index -> builder.modelPackageGroupDescription = deserializeString()
                MODELPACKAGEGROUPNAME_DESCRIPTOR.index -> builder.modelPackageGroupName = deserializeString()
                MODELPACKAGEGROUPSTATUS_DESCRIPTOR.index -> builder.modelPackageGroupStatus = deserializeString().let { ModelPackageGroupStatus.fromValue(it) }
                TAGS_DESCRIPTOR.index -> builder.tags =
                    deserializer.deserializeList(TAGS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeTagDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy