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

commonMain.aws.sdk.kotlin.services.freetier.serde.ExpressionDocumentSerializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.freetier.serde

import aws.sdk.kotlin.services.freetier.model.Expression
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 serializeExpressionDocument(serializer: Serializer, input: Expression) {
    val AND_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("And"))
    val DIMENSIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Dimensions"))
    val NOT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Not"))
    val OR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Or"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AND_DESCRIPTOR)
        field(DIMENSIONS_DESCRIPTOR)
        field(NOT_DESCRIPTOR)
        field(OR_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        if (input.or != null) {
            listField(OR_DESCRIPTOR) {
                for (el0 in input.or) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializeExpressionDocument))
                }
            }
        }
        if (input.and != null) {
            listField(AND_DESCRIPTOR) {
                for (el0 in input.and) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializeExpressionDocument))
                }
            }
        }
        input.not?.let { field(NOT_DESCRIPTOR, it, ::serializeExpressionDocument) }
        input.dimensions?.let { field(DIMENSIONS_DESCRIPTOR, it, ::serializeDimensionValuesDocument) }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy