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

commonMain.aws.sdk.kotlin.services.appstream.serde.AppBlockBuilderDocumentDeserializer.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.appstream.serde

import aws.sdk.kotlin.services.appstream.model.AccessEndpoint
import aws.sdk.kotlin.services.appstream.model.AppBlockBuilder
import aws.sdk.kotlin.services.appstream.model.AppBlockBuilderPlatformType
import aws.sdk.kotlin.services.appstream.model.AppBlockBuilderState
import aws.sdk.kotlin.services.appstream.model.ResourceError
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

internal fun deserializeAppBlockBuilderDocument(deserializer: Deserializer): AppBlockBuilder {
    val builder = AppBlockBuilder.Builder()
    val ACCESSENDPOINTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AccessEndpoints"))
    val APPBLOCKBUILDERERRORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AppBlockBuilderErrors"))
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Arn"))
    val CREATEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreatedTime"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
    val DISPLAYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DisplayName"))
    val ENABLEDEFAULTINTERNETACCESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("EnableDefaultInternetAccess"))
    val IAMROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("IamRoleArn"))
    val INSTANCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("InstanceType"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val PLATFORM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Platform"))
    val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("State"))
    val STATECHANGEREASON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("StateChangeReason"))
    val VPCCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("VpcConfig"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACCESSENDPOINTS_DESCRIPTOR)
        field(APPBLOCKBUILDERERRORS_DESCRIPTOR)
        field(ARN_DESCRIPTOR)
        field(CREATEDTIME_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(DISPLAYNAME_DESCRIPTOR)
        field(ENABLEDEFAULTINTERNETACCESS_DESCRIPTOR)
        field(IAMROLEARN_DESCRIPTOR)
        field(INSTANCETYPE_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(PLATFORM_DESCRIPTOR)
        field(STATE_DESCRIPTOR)
        field(STATECHANGEREASON_DESCRIPTOR)
        field(VPCCONFIG_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACCESSENDPOINTS_DESCRIPTOR.index -> builder.accessEndpoints =
                    deserializer.deserializeList(ACCESSENDPOINTS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeAccessEndpointDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                APPBLOCKBUILDERERRORS_DESCRIPTOR.index -> builder.appBlockBuilderErrors =
                    deserializer.deserializeList(APPBLOCKBUILDERERRORS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeResourceErrorDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                CREATEDTIME_DESCRIPTOR.index -> builder.createdTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                DISPLAYNAME_DESCRIPTOR.index -> builder.displayName = deserializeString()
                ENABLEDEFAULTINTERNETACCESS_DESCRIPTOR.index -> builder.enableDefaultInternetAccess = deserializeBoolean()
                IAMROLEARN_DESCRIPTOR.index -> builder.iamRoleArn = deserializeString()
                INSTANCETYPE_DESCRIPTOR.index -> builder.instanceType = deserializeString()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                PLATFORM_DESCRIPTOR.index -> builder.platform = deserializeString().let { AppBlockBuilderPlatformType.fromValue(it) }
                STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { AppBlockBuilderState.fromValue(it) }
                STATECHANGEREASON_DESCRIPTOR.index -> builder.stateChangeReason = deserializeAppBlockBuilderStateChangeReasonDocument(deserializer)
                VPCCONFIG_DESCRIPTOR.index -> builder.vpcConfig = deserializeVpcConfigDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy