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

commonMain.aws.sdk.kotlin.services.emrserverless.serde.CloudWatchLoggingConfigurationDocumentSerializer.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.emrserverless.serde

import aws.sdk.kotlin.services.emrserverless.model.CloudWatchLoggingConfiguration
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 serializeCloudWatchLoggingConfigurationDocument(serializer: Serializer, input: CloudWatchLoggingConfiguration) {
    val ENABLED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("enabled"))
    val ENCRYPTIONKEYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("encryptionKeyArn"))
    val LOGGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("logGroupName"))
    val LOGSTREAMNAMEPREFIX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("logStreamNamePrefix"))
    val LOGTYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("logTypes"))
    val LOGTYPES_C0_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List)
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ENABLED_DESCRIPTOR)
        field(ENCRYPTIONKEYARN_DESCRIPTOR)
        field(LOGGROUPNAME_DESCRIPTOR)
        field(LOGSTREAMNAMEPREFIX_DESCRIPTOR)
        field(LOGTYPES_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        field(ENABLED_DESCRIPTOR, input.enabled)
        input.logGroupName?.let { field(LOGGROUPNAME_DESCRIPTOR, it) }
        input.logStreamNamePrefix?.let { field(LOGSTREAMNAMEPREFIX_DESCRIPTOR, it) }
        input.encryptionKeyArn?.let { field(ENCRYPTIONKEYARN_DESCRIPTOR, it) }
        if (input.logTypes != null) {
            mapField(LOGTYPES_DESCRIPTOR) {
                input.logTypes.forEach { (key, value) ->
                    listEntry(key, LOGTYPES_C0_DESCRIPTOR) {
                        for (el1 in value) {
                            serializeString(el1)
                        }
                    }
                }
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy