All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.gamelift.serde.FleetUtilizationDocumentDeserializer.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.FleetUtilization
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

internal fun deserializeFleetUtilizationDocument(deserializer: Deserializer): FleetUtilization {
    val builder = FleetUtilization.Builder()
    val ACTIVEGAMESESSIONCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("ActiveGameSessionCount"))
    val ACTIVESERVERPROCESSCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("ActiveServerProcessCount"))
    val CURRENTPLAYERSESSIONCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("CurrentPlayerSessionCount"))
    val FLEETARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FleetArn"))
    val FLEETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FleetId"))
    val LOCATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Location"))
    val MAXIMUMPLAYERSESSIONCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaximumPlayerSessionCount"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACTIVEGAMESESSIONCOUNT_DESCRIPTOR)
        field(ACTIVESERVERPROCESSCOUNT_DESCRIPTOR)
        field(CURRENTPLAYERSESSIONCOUNT_DESCRIPTOR)
        field(FLEETARN_DESCRIPTOR)
        field(FLEETID_DESCRIPTOR)
        field(LOCATION_DESCRIPTOR)
        field(MAXIMUMPLAYERSESSIONCOUNT_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACTIVEGAMESESSIONCOUNT_DESCRIPTOR.index -> builder.activeGameSessionCount = deserializeInt()
                ACTIVESERVERPROCESSCOUNT_DESCRIPTOR.index -> builder.activeServerProcessCount = deserializeInt()
                CURRENTPLAYERSESSIONCOUNT_DESCRIPTOR.index -> builder.currentPlayerSessionCount = deserializeInt()
                FLEETARN_DESCRIPTOR.index -> builder.fleetArn = deserializeString()
                FLEETID_DESCRIPTOR.index -> builder.fleetId = deserializeString()
                LOCATION_DESCRIPTOR.index -> builder.location = deserializeString()
                MAXIMUMPLAYERSESSIONCOUNT_DESCRIPTOR.index -> builder.maximumPlayerSessionCount = deserializeInt()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy