
commonMain.aws.sdk.kotlin.services.gamelift.serde.PlayerDocumentSerializer.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.Player
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.Serializer
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
internal fun serializePlayerDocument(serializer: Serializer, input: Player) {
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)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.playerId?.let { field(PLAYERID_DESCRIPTOR, it) }
if (input.playerAttributes != null) {
mapField(PLAYERATTRIBUTES_DESCRIPTOR) {
input.playerAttributes.forEach { (key, value) -> entry(key, asSdkSerializable(value, ::serializeAttributeValueDocument)) }
}
}
input.team?.let { field(TEAM_DESCRIPTOR, it) }
if (input.latencyInMs != null) {
mapField(LATENCYINMS_DESCRIPTOR) {
input.latencyInMs.forEach { (key, value) -> entry(key, value) }
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy