commonMain.aws.sdk.kotlin.services.appflow.serde.CustomConnectorDestinationPropertiesDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appflow-jvm Show documentation
Show all versions of appflow-jvm Show documentation
The AWS SDK for Kotlin client for Appflow
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.appflow.serde
import aws.sdk.kotlin.services.appflow.model.CustomConnectorDestinationProperties
import aws.sdk.kotlin.services.appflow.model.WriteOperationType
import aws.smithy.kotlin.runtime.serde.Deserializer
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.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 kotlin.collections.mutableListOf
import kotlin.collections.mutableMapOf
internal fun deserializeCustomConnectorDestinationPropertiesDocument(deserializer: Deserializer): CustomConnectorDestinationProperties {
val builder = CustomConnectorDestinationProperties.Builder()
val CUSTOMPROPERTIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("customProperties"))
val ENTITYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("entityName"))
val ERRORHANDLINGCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("errorHandlingConfig"))
val IDFIELDNAMES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("idFieldNames"))
val WRITEOPERATIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("writeOperationType"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CUSTOMPROPERTIES_DESCRIPTOR)
field(ENTITYNAME_DESCRIPTOR)
field(ERRORHANDLINGCONFIG_DESCRIPTOR)
field(IDFIELDNAMES_DESCRIPTOR)
field(WRITEOPERATIONTYPE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CUSTOMPROPERTIES_DESCRIPTOR.index -> builder.customProperties =
deserializer.deserializeMap(CUSTOMPROPERTIES_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
ENTITYNAME_DESCRIPTOR.index -> builder.entityName = deserializeString()
ERRORHANDLINGCONFIG_DESCRIPTOR.index -> builder.errorHandlingConfig = deserializeErrorHandlingConfigDocument(deserializer)
IDFIELDNAMES_DESCRIPTOR.index -> builder.idFieldNames =
deserializer.deserializeList(IDFIELDNAMES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
WRITEOPERATIONTYPE_DESCRIPTOR.index -> builder.writeOperationType = deserializeString().let { WriteOperationType.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}