commonMain.aws.sdk.kotlin.services.gamelift.serde.PlayerDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gamelift-jvm Show documentation
Show all versions of gamelift-jvm Show documentation
The AWS SDK for Kotlin client for GameLift
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.gamelift.serde
import aws.sdk.kotlin.services.gamelift.model.AttributeValue
import aws.sdk.kotlin.services.gamelift.model.Player
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.mutableMapOf
internal fun deserializePlayerDocument(deserializer: Deserializer): Player {
val builder = Player.Builder()
val LATENCYINMS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("LatencyInMs"))
val PLAYERATTRIBUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("PlayerAttributes"))
val PLAYERID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PlayerId"))
val TEAM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Team"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(LATENCYINMS_DESCRIPTOR)
field(PLAYERATTRIBUTES_DESCRIPTOR)
field(PLAYERID_DESCRIPTOR)
field(TEAM_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
LATENCYINMS_DESCRIPTOR.index -> builder.latencyInMs =
deserializer.deserializeMap(LATENCYINMS_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeInt() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
PLAYERATTRIBUTES_DESCRIPTOR.index -> builder.playerAttributes =
deserializer.deserializeMap(PLAYERATTRIBUTES_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeAttributeValueDocument(deserializer) } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
PLAYERID_DESCRIPTOR.index -> builder.playerId = deserializeString()
TEAM_DESCRIPTOR.index -> builder.team = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy