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

commonMain.aws.sdk.kotlin.services.applicationautoscaling.serde.StepScalingPolicyConfigurationDocumentSerializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.applicationautoscaling.serde

import aws.sdk.kotlin.services.applicationautoscaling.model.StepScalingPolicyConfiguration
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 serializeStepScalingPolicyConfigurationDocument(serializer: Serializer, input: StepScalingPolicyConfiguration) {
    val ADJUSTMENTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("AdjustmentType"))
    val COOLDOWN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Cooldown"))
    val METRICAGGREGATIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("MetricAggregationType"))
    val MINADJUSTMENTMAGNITUDE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MinAdjustmentMagnitude"))
    val STEPADJUSTMENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("StepAdjustments"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ADJUSTMENTTYPE_DESCRIPTOR)
        field(COOLDOWN_DESCRIPTOR)
        field(METRICAGGREGATIONTYPE_DESCRIPTOR)
        field(MINADJUSTMENTMAGNITUDE_DESCRIPTOR)
        field(STEPADJUSTMENTS_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        input.adjustmentType?.let { field(ADJUSTMENTTYPE_DESCRIPTOR, it.value) }
        if (input.stepAdjustments != null) {
            listField(STEPADJUSTMENTS_DESCRIPTOR) {
                for (el0 in input.stepAdjustments) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializeStepAdjustmentDocument))
                }
            }
        }
        input.minAdjustmentMagnitude?.let { field(MINADJUSTMENTMAGNITUDE_DESCRIPTOR, it) }
        input.cooldown?.let { field(COOLDOWN_DESCRIPTOR, it) }
        input.metricAggregationType?.let { field(METRICAGGREGATIONTYPE_DESCRIPTOR, it.value) }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy