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

commonMain.aws.sdk.kotlin.services.applicationdiscoveryservice.serde.Ec2RecommendationsExportPreferencesDocumentSerializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.applicationdiscoveryservice.serde

import aws.sdk.kotlin.services.applicationdiscoveryservice.model.Ec2RecommendationsExportPreferences
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 serializeEc2RecommendationsExportPreferencesDocument(serializer: Serializer, input: Ec2RecommendationsExportPreferences) {
    val CPUPERFORMANCEMETRICBASIS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("cpuPerformanceMetricBasis"))
    val ENABLED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("enabled"))
    val EXCLUDEDINSTANCETYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("excludedInstanceTypes"))
    val PREFERREDREGION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("preferredRegion"))
    val RAMPERFORMANCEMETRICBASIS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ramPerformanceMetricBasis"))
    val RESERVEDINSTANCEOPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("reservedInstanceOptions"))
    val TENANCY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("tenancy"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CPUPERFORMANCEMETRICBASIS_DESCRIPTOR)
        field(ENABLED_DESCRIPTOR)
        field(EXCLUDEDINSTANCETYPES_DESCRIPTOR)
        field(PREFERREDREGION_DESCRIPTOR)
        field(RAMPERFORMANCEMETRICBASIS_DESCRIPTOR)
        field(RESERVEDINSTANCEOPTIONS_DESCRIPTOR)
        field(TENANCY_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        if (input.enabled != false) field(ENABLED_DESCRIPTOR, input.enabled)
        input.cpuPerformanceMetricBasis?.let { field(CPUPERFORMANCEMETRICBASIS_DESCRIPTOR, it, ::serializeUsageMetricBasisDocument) }
        input.ramPerformanceMetricBasis?.let { field(RAMPERFORMANCEMETRICBASIS_DESCRIPTOR, it, ::serializeUsageMetricBasisDocument) }
        input.tenancy?.let { field(TENANCY_DESCRIPTOR, it.value) }
        if (input.excludedInstanceTypes != null) {
            listField(EXCLUDEDINSTANCETYPES_DESCRIPTOR) {
                for (el0 in input.excludedInstanceTypes) {
                    serializeString(el0)
                }
            }
        }
        input.preferredRegion?.let { field(PREFERREDREGION_DESCRIPTOR, it) }
        input.reservedInstanceOptions?.let { field(RESERVEDINSTANCEOPTIONS_DESCRIPTOR, it, ::serializeReservedInstanceOptionsDocument) }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy