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

commonMain.aws.sdk.kotlin.services.appstream.transform.StackDocumentDeserializer.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.transform

import aws.sdk.kotlin.services.appstream.model.AccessEndpoint
import aws.sdk.kotlin.services.appstream.model.Stack
import aws.sdk.kotlin.services.appstream.model.StackError
import aws.sdk.kotlin.services.appstream.model.StorageConnector
import aws.sdk.kotlin.services.appstream.model.UserSetting
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 fun deserializeStackDocument(deserializer: Deserializer): Stack {
    val builder = Stack.Builder()
    val ACCESSENDPOINTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AccessEndpoints"))
    val APPLICATIONSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ApplicationSettings"))
    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 EMBEDHOSTDOMAINS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("EmbedHostDomains"))
    val FEEDBACKURL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FeedbackURL"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val REDIRECTURL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RedirectURL"))
    val STACKERRORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("StackErrors"))
    val STORAGECONNECTORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("StorageConnectors"))
    val USERSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("UserSettings"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACCESSENDPOINTS_DESCRIPTOR)
        field(APPLICATIONSETTINGS_DESCRIPTOR)
        field(ARN_DESCRIPTOR)
        field(CREATEDTIME_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(DISPLAYNAME_DESCRIPTOR)
        field(EMBEDHOSTDOMAINS_DESCRIPTOR)
        field(FEEDBACKURL_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(REDIRECTURL_DESCRIPTOR)
        field(STACKERRORS_DESCRIPTOR)
        field(STORAGECONNECTORS_DESCRIPTOR)
        field(USERSETTINGS_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
                    }
                APPLICATIONSETTINGS_DESCRIPTOR.index -> builder.applicationSettings = deserializeApplicationSettingsResponseDocument(deserializer)
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                CREATEDTIME_DESCRIPTOR.index -> builder.createdTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                DISPLAYNAME_DESCRIPTOR.index -> builder.displayName = deserializeString()
                EMBEDHOSTDOMAINS_DESCRIPTOR.index -> builder.embedHostDomains =
                    deserializer.deserializeList(EMBEDHOSTDOMAINS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                FEEDBACKURL_DESCRIPTOR.index -> builder.feedbackUrl = deserializeString()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                REDIRECTURL_DESCRIPTOR.index -> builder.redirectUrl = deserializeString()
                STACKERRORS_DESCRIPTOR.index -> builder.stackErrors =
                    deserializer.deserializeList(STACKERRORS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeStackErrorDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                STORAGECONNECTORS_DESCRIPTOR.index -> builder.storageConnectors =
                    deserializer.deserializeList(STORAGECONNECTORS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeStorageConnectorDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                USERSETTINGS_DESCRIPTOR.index -> builder.userSettings =
                    deserializer.deserializeList(USERSETTINGS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeUserSettingDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy