commonMain.aws.sdk.kotlin.services.appstream.transform.EntitlementDocumentDeserializer.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.AppVisibility
import aws.sdk.kotlin.services.appstream.model.Entitlement
import aws.sdk.kotlin.services.appstream.model.EntitlementAttribute
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 deserializeEntitlementDocument(deserializer: Deserializer): Entitlement {
val builder = Entitlement.Builder()
val APPVISIBILITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AppVisibility"))
val ATTRIBUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Attributes"))
val CREATEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreatedTime"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val LASTMODIFIEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastModifiedTime"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val STACKNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StackName"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(APPVISIBILITY_DESCRIPTOR)
field(ATTRIBUTES_DESCRIPTOR)
field(CREATEDTIME_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(LASTMODIFIEDTIME_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(STACKNAME_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
APPVISIBILITY_DESCRIPTOR.index -> builder.appVisibility = deserializeString().let { AppVisibility.fromValue(it) }
ATTRIBUTES_DESCRIPTOR.index -> builder.attributes =
deserializer.deserializeList(ATTRIBUTES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeEntitlementAttributeDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
CREATEDTIME_DESCRIPTOR.index -> builder.createdTime = deserializeString().let { Instant.fromEpochSeconds(it) }
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
LASTMODIFIEDTIME_DESCRIPTOR.index -> builder.lastModifiedTime = deserializeString().let { Instant.fromEpochSeconds(it) }
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
STACKNAME_DESCRIPTOR.index -> builder.stackName = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy