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

commonMain.aws.sdk.kotlin.services.appstream.transform.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.transform

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 AVAILABLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Available"))
    val DESIRED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Desired"))
    val INUSE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("InUse"))
    val RUNNING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Running"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AVAILABLE_DESCRIPTOR)
        field(DESIRED_DESCRIPTOR)
        field(INUSE_DESCRIPTOR)
        field(RUNNING_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AVAILABLE_DESCRIPTOR.index -> builder.available = deserializeInt()
                DESIRED_DESCRIPTOR.index -> builder.desired = deserializeInt()
                INUSE_DESCRIPTOR.index -> builder.inUse = deserializeInt()
                RUNNING_DESCRIPTOR.index -> builder.running = deserializeInt()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy