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

commonMain.aws.sdk.kotlin.services.deadline.serde.ServiceManagedEc2InstanceCapabilitiesDocumentSerializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.deadline.serde

import aws.sdk.kotlin.services.deadline.model.ServiceManagedEc2InstanceCapabilities
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.Serializer
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 serializeServiceManagedEc2InstanceCapabilitiesDocument(serializer: Serializer, input: ServiceManagedEc2InstanceCapabilities) {
    val ALLOWEDINSTANCETYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("allowedInstanceTypes"))
    val CPUARCHITECTURETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("cpuArchitectureType"))
    val CUSTOMAMOUNTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("customAmounts"))
    val CUSTOMATTRIBUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("customAttributes"))
    val EXCLUDEDINSTANCETYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("excludedInstanceTypes"))
    val MEMORYMIB_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("memoryMiB"))
    val OSFAMILY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("osFamily"))
    val ROOTEBSVOLUME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("rootEbsVolume"))
    val VCPUCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("vCpuCount"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ALLOWEDINSTANCETYPES_DESCRIPTOR)
        field(CPUARCHITECTURETYPE_DESCRIPTOR)
        field(CUSTOMAMOUNTS_DESCRIPTOR)
        field(CUSTOMATTRIBUTES_DESCRIPTOR)
        field(EXCLUDEDINSTANCETYPES_DESCRIPTOR)
        field(MEMORYMIB_DESCRIPTOR)
        field(OSFAMILY_DESCRIPTOR)
        field(ROOTEBSVOLUME_DESCRIPTOR)
        field(VCPUCOUNT_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        input.vCpuCount?.let { field(VCPUCOUNT_DESCRIPTOR, it, ::serializeVCpuCountRangeDocument) }
        input.memoryMib?.let { field(MEMORYMIB_DESCRIPTOR, it, ::serializeMemoryMibRangeDocument) }
        field(OSFAMILY_DESCRIPTOR, input.osFamily.value)
        field(CPUARCHITECTURETYPE_DESCRIPTOR, input.cpuArchitectureType.value)
        input.rootEbsVolume?.let { field(ROOTEBSVOLUME_DESCRIPTOR, it, ::serializeEc2EbsVolumeDocument) }
        if (input.allowedInstanceTypes != null) {
            listField(ALLOWEDINSTANCETYPES_DESCRIPTOR) {
                for (el0 in input.allowedInstanceTypes) {
                    serializeString(el0)
                }
            }
        }
        if (input.excludedInstanceTypes != null) {
            listField(EXCLUDEDINSTANCETYPES_DESCRIPTOR) {
                for (el0 in input.excludedInstanceTypes) {
                    serializeString(el0)
                }
            }
        }
        if (input.customAmounts != null) {
            listField(CUSTOMAMOUNTS_DESCRIPTOR) {
                for (el0 in input.customAmounts) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializeFleetAmountCapabilityDocument))
                }
            }
        }
        if (input.customAttributes != null) {
            listField(CUSTOMATTRIBUTES_DESCRIPTOR) {
                for (el0 in input.customAttributes) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializeFleetAttributeCapabilityDocument))
                }
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy