commonMain.aws.sdk.kotlin.services.appstream.transform.ApplicationDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appstream-jvm Show documentation
Show all versions of appstream-jvm Show documentation
The AWS SDK for Kotlin client for AppStream
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.appstream.transform
import aws.sdk.kotlin.services.appstream.model.Application
import aws.sdk.kotlin.services.appstream.model.PlatformType
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 deserializeApplicationDocument(deserializer: Deserializer): Application {
val builder = Application.Builder()
val APPBLOCKARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AppBlockArn"))
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 ENABLED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("Enabled"))
val ICONS3LOCATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("IconS3Location"))
val ICONURL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("IconURL"))
val INSTANCEFAMILIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("InstanceFamilies"))
val LAUNCHPARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LaunchParameters"))
val LAUNCHPATH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LaunchPath"))
val METADATA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("Metadata"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val PLATFORMS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Platforms"))
val WORKINGDIRECTORY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("WorkingDirectory"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(APPBLOCKARN_DESCRIPTOR)
field(ARN_DESCRIPTOR)
field(CREATEDTIME_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(DISPLAYNAME_DESCRIPTOR)
field(ENABLED_DESCRIPTOR)
field(ICONS3LOCATION_DESCRIPTOR)
field(ICONURL_DESCRIPTOR)
field(INSTANCEFAMILIES_DESCRIPTOR)
field(LAUNCHPARAMETERS_DESCRIPTOR)
field(LAUNCHPATH_DESCRIPTOR)
field(METADATA_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(PLATFORMS_DESCRIPTOR)
field(WORKINGDIRECTORY_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
APPBLOCKARN_DESCRIPTOR.index -> builder.appBlockArn = deserializeString()
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()
ENABLED_DESCRIPTOR.index -> builder.enabled = deserializeBoolean()
ICONS3LOCATION_DESCRIPTOR.index -> builder.iconS3Location = deserializeS3LocationDocument(deserializer)
ICONURL_DESCRIPTOR.index -> builder.iconUrl = deserializeString()
INSTANCEFAMILIES_DESCRIPTOR.index -> builder.instanceFamilies =
deserializer.deserializeList(INSTANCEFAMILIES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
LAUNCHPARAMETERS_DESCRIPTOR.index -> builder.launchParameters = deserializeString()
LAUNCHPATH_DESCRIPTOR.index -> builder.launchPath = deserializeString()
METADATA_DESCRIPTOR.index -> builder.metadata =
deserializer.deserializeMap(METADATA_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
PLATFORMS_DESCRIPTOR.index -> builder.platforms =
deserializer.deserializeList(PLATFORMS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { PlatformType.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
WORKINGDIRECTORY_DESCRIPTOR.index -> builder.workingDirectory = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy