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

commonMain.aws.sdk.kotlin.services.appstream.serde.ComputeCapacityStatusDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.99
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.appstream.serde

import aws.sdk.kotlin.services.appstream.model.ComputeCapacityStatus
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 deserializeComputeCapacityStatusDocument(deserializer: Deserializer): ComputeCapacityStatus {
    val builder = ComputeCapacityStatus.Builder()
    val ACTIVEUSERSESSIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("ActiveUserSessions"))
    val ACTUALUSERSESSIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("ActualUserSessions"))
    val AVAILABLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Available"))
    val AVAILABLEUSERSESSIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("AvailableUserSessions"))
    val DESIRED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Desired"))
    val DESIREDUSERSESSIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("DesiredUserSessions"))
    val INUSE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("InUse"))
    val RUNNING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Running"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACTIVEUSERSESSIONS_DESCRIPTOR)
        field(ACTUALUSERSESSIONS_DESCRIPTOR)
        field(AVAILABLE_DESCRIPTOR)
        field(AVAILABLEUSERSESSIONS_DESCRIPTOR)
        field(DESIRED_DESCRIPTOR)
        field(DESIREDUSERSESSIONS_DESCRIPTOR)
        field(INUSE_DESCRIPTOR)
        field(RUNNING_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACTIVEUSERSESSIONS_DESCRIPTOR.index -> builder.activeUserSessions = deserializeInt()
                ACTUALUSERSESSIONS_DESCRIPTOR.index -> builder.actualUserSessions = deserializeInt()
                AVAILABLE_DESCRIPTOR.index -> builder.available = deserializeInt()
                AVAILABLEUSERSESSIONS_DESCRIPTOR.index -> builder.availableUserSessions = deserializeInt()
                DESIRED_DESCRIPTOR.index -> builder.desired = deserializeInt()
                DESIREDUSERSESSIONS_DESCRIPTOR.index -> builder.desiredUserSessions = deserializeInt()
                INUSE_DESCRIPTOR.index -> builder.inUse = deserializeInt()
                RUNNING_DESCRIPTOR.index -> builder.running = deserializeInt()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy