
commonMain.aws.sdk.kotlin.services.gamelift.serde.GameSessionQueueDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.gamelift.serde
import aws.sdk.kotlin.services.gamelift.model.GameSessionQueue
import aws.sdk.kotlin.services.gamelift.model.GameSessionQueueDestination
import aws.sdk.kotlin.services.gamelift.model.PlayerLatencyPolicy
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 kotlin.collections.mutableListOf
internal fun deserializeGameSessionQueueDocument(deserializer: Deserializer): GameSessionQueue {
val builder = GameSessionQueue.Builder()
val CUSTOMEVENTDATA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CustomEventData"))
val DESTINATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Destinations"))
val FILTERCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("FilterConfiguration"))
val GAMESESSIONQUEUEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("GameSessionQueueArn"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val NOTIFICATIONTARGET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("NotificationTarget"))
val PLAYERLATENCYPOLICIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("PlayerLatencyPolicies"))
val PRIORITYCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("PriorityConfiguration"))
val TIMEOUTINSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("TimeoutInSeconds"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CUSTOMEVENTDATA_DESCRIPTOR)
field(DESTINATIONS_DESCRIPTOR)
field(FILTERCONFIGURATION_DESCRIPTOR)
field(GAMESESSIONQUEUEARN_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(NOTIFICATIONTARGET_DESCRIPTOR)
field(PLAYERLATENCYPOLICIES_DESCRIPTOR)
field(PRIORITYCONFIGURATION_DESCRIPTOR)
field(TIMEOUTINSECONDS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CUSTOMEVENTDATA_DESCRIPTOR.index -> builder.customEventData = deserializeString()
DESTINATIONS_DESCRIPTOR.index -> builder.destinations =
deserializer.deserializeList(DESTINATIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeGameSessionQueueDestinationDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
FILTERCONFIGURATION_DESCRIPTOR.index -> builder.filterConfiguration = deserializeFilterConfigurationDocument(deserializer)
GAMESESSIONQUEUEARN_DESCRIPTOR.index -> builder.gameSessionQueueArn = deserializeString()
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
NOTIFICATIONTARGET_DESCRIPTOR.index -> builder.notificationTarget = deserializeString()
PLAYERLATENCYPOLICIES_DESCRIPTOR.index -> builder.playerLatencyPolicies =
deserializer.deserializeList(PLAYERLATENCYPOLICIES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializePlayerLatencyPolicyDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
PRIORITYCONFIGURATION_DESCRIPTOR.index -> builder.priorityConfiguration = deserializePriorityConfigurationDocument(deserializer)
TIMEOUTINSECONDS_DESCRIPTOR.index -> builder.timeoutInSeconds = deserializeInt()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy