commonMain.aws.sdk.kotlin.services.gamelift.serde.Ec2InstanceLimitDocumentDeserializer.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.Ec2InstanceLimit
import aws.sdk.kotlin.services.gamelift.model.Ec2InstanceType
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 deserializeEc2InstanceLimitDocument(deserializer: Deserializer): Ec2InstanceLimit {
val builder = Ec2InstanceLimit.Builder()
val CURRENTINSTANCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("CurrentInstances"))
val EC2INSTANCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("EC2InstanceType"))
val INSTANCELIMIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("InstanceLimit"))
val LOCATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Location"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CURRENTINSTANCES_DESCRIPTOR)
field(EC2INSTANCETYPE_DESCRIPTOR)
field(INSTANCELIMIT_DESCRIPTOR)
field(LOCATION_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CURRENTINSTANCES_DESCRIPTOR.index -> builder.currentInstances = deserializeInt()
EC2INSTANCETYPE_DESCRIPTOR.index -> builder.ec2InstanceType = deserializeString().let { Ec2InstanceType.fromValue(it) }
INSTANCELIMIT_DESCRIPTOR.index -> builder.instanceLimit = deserializeInt()
LOCATION_DESCRIPTOR.index -> builder.location = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy