commonMain.aws.sdk.kotlin.services.autoscaling.serde.InstanceRequirementsDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of autoscaling-jvm Show documentation
Show all versions of autoscaling-jvm Show documentation
The AWS Kotlin client for Auto Scaling
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.autoscaling.serde
import aws.sdk.kotlin.services.autoscaling.model.AcceleratorManufacturer
import aws.sdk.kotlin.services.autoscaling.model.AcceleratorName
import aws.sdk.kotlin.services.autoscaling.model.AcceleratorType
import aws.sdk.kotlin.services.autoscaling.model.BareMetal
import aws.sdk.kotlin.services.autoscaling.model.BurstablePerformance
import aws.sdk.kotlin.services.autoscaling.model.CpuManufacturer
import aws.sdk.kotlin.services.autoscaling.model.InstanceGeneration
import aws.sdk.kotlin.services.autoscaling.model.InstanceRequirements
import aws.sdk.kotlin.services.autoscaling.model.LocalStorage
import aws.sdk.kotlin.services.autoscaling.model.LocalStorageType
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.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import aws.smithy.kotlin.runtime.serde.xml.XmlDeserializer
import aws.smithy.kotlin.runtime.serde.xml.XmlNamespace
import aws.smithy.kotlin.runtime.serde.xml.XmlSerialName
import kotlin.collections.mutableListOf
internal fun deserializeInstanceRequirementsDocument(deserializer: Deserializer): InstanceRequirements {
val builder = InstanceRequirements.Builder()
val ACCELERATORCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("AcceleratorCount"))
val ACCELERATORMANUFACTURERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("AcceleratorManufacturers"))
val ACCELERATORNAMES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("AcceleratorNames"))
val ACCELERATORTOTALMEMORYMIB_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("AcceleratorTotalMemoryMiB"))
val ACCELERATORTYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("AcceleratorTypes"))
val ALLOWEDINSTANCETYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("AllowedInstanceTypes"))
val BAREMETAL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, XmlSerialName("BareMetal"))
val BASELINEEBSBANDWIDTHMBPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("BaselineEbsBandwidthMbps"))
val BURSTABLEPERFORMANCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, XmlSerialName("BurstablePerformance"))
val CPUMANUFACTURERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("CpuManufacturers"))
val EXCLUDEDINSTANCETYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("ExcludedInstanceTypes"))
val INSTANCEGENERATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("InstanceGenerations"))
val LOCALSTORAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, XmlSerialName("LocalStorage"))
val LOCALSTORAGETYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, XmlSerialName("LocalStorageTypes"))
val MEMORYGIBPERVCPU_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("MemoryGiBPerVCpu"))
val MEMORYMIB_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("MemoryMiB"))
val NETWORKBANDWIDTHGBPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("NetworkBandwidthGbps"))
val NETWORKINTERFACECOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("NetworkInterfaceCount"))
val ONDEMANDMAXPRICEPERCENTAGEOVERLOWESTPRICE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("OnDemandMaxPricePercentageOverLowestPrice"))
val REQUIREHIBERNATESUPPORT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, XmlSerialName("RequireHibernateSupport"))
val SPOTMAXPRICEPERCENTAGEOVERLOWESTPRICE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, XmlSerialName("SpotMaxPricePercentageOverLowestPrice"))
val TOTALLOCALSTORAGEGB_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("TotalLocalStorageGB"))
val VCPUCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, XmlSerialName("VCpuCount"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
trait(XmlSerialName("InstanceRequirements"))
trait(XmlNamespace("http://autoscaling.amazonaws.com/doc/2011-01-01/"))
field(ACCELERATORCOUNT_DESCRIPTOR)
field(ACCELERATORMANUFACTURERS_DESCRIPTOR)
field(ACCELERATORNAMES_DESCRIPTOR)
field(ACCELERATORTOTALMEMORYMIB_DESCRIPTOR)
field(ACCELERATORTYPES_DESCRIPTOR)
field(ALLOWEDINSTANCETYPES_DESCRIPTOR)
field(BAREMETAL_DESCRIPTOR)
field(BASELINEEBSBANDWIDTHMBPS_DESCRIPTOR)
field(BURSTABLEPERFORMANCE_DESCRIPTOR)
field(CPUMANUFACTURERS_DESCRIPTOR)
field(EXCLUDEDINSTANCETYPES_DESCRIPTOR)
field(INSTANCEGENERATIONS_DESCRIPTOR)
field(LOCALSTORAGE_DESCRIPTOR)
field(LOCALSTORAGETYPES_DESCRIPTOR)
field(MEMORYGIBPERVCPU_DESCRIPTOR)
field(MEMORYMIB_DESCRIPTOR)
field(NETWORKBANDWIDTHGBPS_DESCRIPTOR)
field(NETWORKINTERFACECOUNT_DESCRIPTOR)
field(ONDEMANDMAXPRICEPERCENTAGEOVERLOWESTPRICE_DESCRIPTOR)
field(REQUIREHIBERNATESUPPORT_DESCRIPTOR)
field(SPOTMAXPRICEPERCENTAGEOVERLOWESTPRICE_DESCRIPTOR)
field(TOTALLOCALSTORAGEGB_DESCRIPTOR)
field(VCPUCOUNT_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ACCELERATORCOUNT_DESCRIPTOR.index -> builder.acceleratorCount = deserializeAcceleratorCountRequestDocument(deserializer)
ACCELERATORMANUFACTURERS_DESCRIPTOR.index -> builder.acceleratorManufacturers =
deserializer.deserializeList(ACCELERATORMANUFACTURERS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { AcceleratorManufacturer.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
ACCELERATORNAMES_DESCRIPTOR.index -> builder.acceleratorNames =
deserializer.deserializeList(ACCELERATORNAMES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { AcceleratorName.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
ACCELERATORTOTALMEMORYMIB_DESCRIPTOR.index -> builder.acceleratorTotalMemoryMib = deserializeAcceleratorTotalMemoryMibRequestDocument(deserializer)
ACCELERATORTYPES_DESCRIPTOR.index -> builder.acceleratorTypes =
deserializer.deserializeList(ACCELERATORTYPES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { AcceleratorType.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
ALLOWEDINSTANCETYPES_DESCRIPTOR.index -> builder.allowedInstanceTypes =
deserializer.deserializeList(ALLOWEDINSTANCETYPES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
BAREMETAL_DESCRIPTOR.index -> builder.bareMetal = deserializeString().let { BareMetal.fromValue(it) }
BASELINEEBSBANDWIDTHMBPS_DESCRIPTOR.index -> builder.baselineEbsBandwidthMbps = deserializeBaselineEbsBandwidthMbpsRequestDocument(deserializer)
BURSTABLEPERFORMANCE_DESCRIPTOR.index -> builder.burstablePerformance = deserializeString().let { BurstablePerformance.fromValue(it) }
CPUMANUFACTURERS_DESCRIPTOR.index -> builder.cpuManufacturers =
deserializer.deserializeList(CPUMANUFACTURERS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { CpuManufacturer.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
EXCLUDEDINSTANCETYPES_DESCRIPTOR.index -> builder.excludedInstanceTypes =
deserializer.deserializeList(EXCLUDEDINSTANCETYPES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
INSTANCEGENERATIONS_DESCRIPTOR.index -> builder.instanceGenerations =
deserializer.deserializeList(INSTANCEGENERATIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { InstanceGeneration.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
LOCALSTORAGE_DESCRIPTOR.index -> builder.localStorage = deserializeString().let { LocalStorage.fromValue(it) }
LOCALSTORAGETYPES_DESCRIPTOR.index -> builder.localStorageTypes =
deserializer.deserializeList(LOCALSTORAGETYPES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { LocalStorageType.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
MEMORYGIBPERVCPU_DESCRIPTOR.index -> builder.memoryGibPerVCpu = deserializeMemoryGibPerVCpuRequestDocument(deserializer)
MEMORYMIB_DESCRIPTOR.index -> builder.memoryMib = deserializeMemoryMibRequestDocument(deserializer)
NETWORKBANDWIDTHGBPS_DESCRIPTOR.index -> builder.networkBandwidthGbps = deserializeNetworkBandwidthGbpsRequestDocument(deserializer)
NETWORKINTERFACECOUNT_DESCRIPTOR.index -> builder.networkInterfaceCount = deserializeNetworkInterfaceCountRequestDocument(deserializer)
ONDEMANDMAXPRICEPERCENTAGEOVERLOWESTPRICE_DESCRIPTOR.index -> builder.onDemandMaxPricePercentageOverLowestPrice = deserializeInt()
REQUIREHIBERNATESUPPORT_DESCRIPTOR.index -> builder.requireHibernateSupport = deserializeBoolean()
SPOTMAXPRICEPERCENTAGEOVERLOWESTPRICE_DESCRIPTOR.index -> builder.spotMaxPricePercentageOverLowestPrice = deserializeInt()
TOTALLOCALSTORAGEGB_DESCRIPTOR.index -> builder.totalLocalStorageGb = deserializeTotalLocalStorageGbRequestDocument(deserializer)
VCPUCOUNT_DESCRIPTOR.index -> builder.vCpuCount = deserializeVCpuCountRequestDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy