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

commonMain.aws.sdk.kotlin.services.glue.serde.DatabaseInputDocumentSerializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.glue.serde

import aws.sdk.kotlin.services.glue.model.DatabaseInput
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 serializeDatabaseInputDocument(serializer: Serializer, input: DatabaseInput) {
    val CREATETABLEDEFAULTPERMISSIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("CreateTableDefaultPermissions"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
    val FEDERATEDDATABASE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("FederatedDatabase"))
    val LOCATIONURI_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LocationUri"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val PARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("Parameters"))
    val TARGETDATABASE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("TargetDatabase"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CREATETABLEDEFAULTPERMISSIONS_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(FEDERATEDDATABASE_DESCRIPTOR)
        field(LOCATIONURI_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(PARAMETERS_DESCRIPTOR)
        field(TARGETDATABASE_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        field(NAME_DESCRIPTOR, input.name)
        input.description?.let { field(DESCRIPTION_DESCRIPTOR, it) }
        input.locationUri?.let { field(LOCATIONURI_DESCRIPTOR, it) }
        if (input.parameters != null) {
            mapField(PARAMETERS_DESCRIPTOR) {
                input.parameters.forEach { (key, value) ->
                    entry(key, value)
                }
            }
        }
        if (input.createTableDefaultPermissions != null) {
            listField(CREATETABLEDEFAULTPERMISSIONS_DESCRIPTOR) {
                for (el0 in input.createTableDefaultPermissions) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializePrincipalPermissionsDocument))
                }
            }
        }
        input.targetDatabase?.let { field(TARGETDATABASE_DESCRIPTOR, it, ::serializeDatabaseIdentifierDocument) }
        input.federatedDatabase?.let { field(FEDERATEDDATABASE_DESCRIPTOR, it, ::serializeFederatedDatabaseDocument) }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy