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

commonMain.aws.sdk.kotlin.services.nimble.serde.StudioComponentDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.nimble.serde

import aws.sdk.kotlin.services.nimble.model.ScriptParameterKeyValue
import aws.sdk.kotlin.services.nimble.model.StudioComponent
import aws.sdk.kotlin.services.nimble.model.StudioComponentInitializationScript
import aws.sdk.kotlin.services.nimble.model.StudioComponentState
import aws.sdk.kotlin.services.nimble.model.StudioComponentStatusCode
import aws.sdk.kotlin.services.nimble.model.StudioComponentSubtype
import aws.sdk.kotlin.services.nimble.model.StudioComponentType
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
import kotlin.collections.mutableListOf
import kotlin.collections.mutableMapOf

internal fun deserializeStudioComponentDocument(deserializer: Deserializer): StudioComponent {
    val builder = StudioComponent.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val CONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("configuration"))
    val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
    val CREATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("createdBy"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("description"))
    val EC2SECURITYGROUPIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ec2SecurityGroupIds"))
    val INITIALIZATIONSCRIPTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("initializationScripts"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    val RUNTIMEROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("runtimeRoleArn"))
    val SCRIPTPARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("scriptParameters"))
    val SECUREINITIALIZATIONROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("secureInitializationRoleArn"))
    val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("state"))
    val STATUSCODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("statusCode"))
    val STATUSMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("statusMessage"))
    val STUDIOCOMPONENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("studioComponentId"))
    val SUBTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("subtype"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("tags"))
    val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("type"))
    val UPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("updatedAt"))
    val UPDATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("updatedBy"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(CONFIGURATION_DESCRIPTOR)
        field(CREATEDAT_DESCRIPTOR)
        field(CREATEDBY_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(EC2SECURITYGROUPIDS_DESCRIPTOR)
        field(INITIALIZATIONSCRIPTS_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(RUNTIMEROLEARN_DESCRIPTOR)
        field(SCRIPTPARAMETERS_DESCRIPTOR)
        field(SECUREINITIALIZATIONROLEARN_DESCRIPTOR)
        field(STATE_DESCRIPTOR)
        field(STATUSCODE_DESCRIPTOR)
        field(STATUSMESSAGE_DESCRIPTOR)
        field(STUDIOCOMPONENTID_DESCRIPTOR)
        field(SUBTYPE_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
        field(TYPE_DESCRIPTOR)
        field(UPDATEDAT_DESCRIPTOR)
        field(UPDATEDBY_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                CONFIGURATION_DESCRIPTOR.index -> builder.configuration = deserializeStudioComponentConfigurationDocument(deserializer)
                CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.ISO_8601)
                CREATEDBY_DESCRIPTOR.index -> builder.createdBy = deserializeString()
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                EC2SECURITYGROUPIDS_DESCRIPTOR.index -> builder.ec2SecurityGroupIds =
                    deserializer.deserializeList(EC2SECURITYGROUPIDS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                INITIALIZATIONSCRIPTS_DESCRIPTOR.index -> builder.initializationScripts =
                    deserializer.deserializeList(INITIALIZATIONSCRIPTS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeStudioComponentInitializationScriptDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                RUNTIMEROLEARN_DESCRIPTOR.index -> builder.runtimeRoleArn = deserializeString()
                SCRIPTPARAMETERS_DESCRIPTOR.index -> builder.scriptParameters =
                    deserializer.deserializeList(SCRIPTPARAMETERS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeScriptParameterKeyValueDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SECUREINITIALIZATIONROLEARN_DESCRIPTOR.index -> builder.secureInitializationRoleArn = deserializeString()
                STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { StudioComponentState.fromValue(it) }
                STATUSCODE_DESCRIPTOR.index -> builder.statusCode = deserializeString().let { StudioComponentStatusCode.fromValue(it) }
                STATUSMESSAGE_DESCRIPTOR.index -> builder.statusMessage = deserializeString()
                STUDIOCOMPONENTID_DESCRIPTOR.index -> builder.studioComponentId = deserializeString()
                SUBTYPE_DESCRIPTOR.index -> builder.subtype = deserializeString().let { StudioComponentSubtype.fromValue(it) }
                TAGS_DESCRIPTOR.index -> builder.tags =
                    deserializer.deserializeMap(TAGS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                TYPE_DESCRIPTOR.index -> builder.type = deserializeString().let { StudioComponentType.fromValue(it) }
                UPDATEDAT_DESCRIPTOR.index -> builder.updatedAt = deserializeInstant(TimestampFormat.ISO_8601)
                UPDATEDBY_DESCRIPTOR.index -> builder.updatedBy = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy