commonMain.aws.sdk.kotlin.services.glue.serde.TableInputDocumentSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glue-jvm Show documentation
Show all versions of glue-jvm Show documentation
The AWS SDK for Kotlin client for Glue
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.serde
import aws.sdk.kotlin.services.glue.model.TableInput
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
import aws.smithy.kotlin.runtime.time.TimestampFormat
internal fun serializeTableInputDocument(serializer: Serializer, input: TableInput) {
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val LASTACCESSTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastAccessTime"))
val LASTANALYZEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastAnalyzedTime"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val OWNER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Owner"))
val PARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("Parameters"))
val PARTITIONKEYS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("PartitionKeys"))
val RETENTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Retention"))
val STORAGEDESCRIPTOR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("StorageDescriptor"))
val TABLETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TableType"))
val TARGETTABLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("TargetTable"))
val VIEWDEFINITION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ViewDefinition"))
val VIEWEXPANDEDTEXT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ViewExpandedText"))
val VIEWORIGINALTEXT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ViewOriginalText"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DESCRIPTION_DESCRIPTOR)
field(LASTACCESSTIME_DESCRIPTOR)
field(LASTANALYZEDTIME_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(OWNER_DESCRIPTOR)
field(PARAMETERS_DESCRIPTOR)
field(PARTITIONKEYS_DESCRIPTOR)
field(RETENTION_DESCRIPTOR)
field(STORAGEDESCRIPTOR_DESCRIPTOR)
field(TABLETYPE_DESCRIPTOR)
field(TARGETTABLE_DESCRIPTOR)
field(VIEWDEFINITION_DESCRIPTOR)
field(VIEWEXPANDEDTEXT_DESCRIPTOR)
field(VIEWORIGINALTEXT_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
field(NAME_DESCRIPTOR, input.name)
input.description?.let { field(DESCRIPTION_DESCRIPTOR, it) }
input.owner?.let { field(OWNER_DESCRIPTOR, it) }
input.lastAccessTime?.let { field(LASTACCESSTIME_DESCRIPTOR, it, TimestampFormat.EPOCH_SECONDS) }
input.lastAnalyzedTime?.let { field(LASTANALYZEDTIME_DESCRIPTOR, it, TimestampFormat.EPOCH_SECONDS) }
if (input.retention != 0) field(RETENTION_DESCRIPTOR, input.retention)
input.storageDescriptor?.let { field(STORAGEDESCRIPTOR_DESCRIPTOR, it, ::serializeStorageDescriptorDocument) }
if (input.partitionKeys != null) {
listField(PARTITIONKEYS_DESCRIPTOR) {
for (el0 in input.partitionKeys) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeColumnDocument))
}
}
}
input.viewOriginalText?.let { field(VIEWORIGINALTEXT_DESCRIPTOR, it) }
input.viewExpandedText?.let { field(VIEWEXPANDEDTEXT_DESCRIPTOR, it) }
input.tableType?.let { field(TABLETYPE_DESCRIPTOR, it) }
if (input.parameters != null) {
mapField(PARAMETERS_DESCRIPTOR) {
input.parameters.forEach { (key, value) ->
entry(key, value)
}
}
}
input.targetTable?.let { field(TARGETTABLE_DESCRIPTOR, it, ::serializeTableIdentifierDocument) }
input.viewDefinition?.let { field(VIEWDEFINITION_DESCRIPTOR, it, ::serializeViewDefinitionInputDocument) }
}
}