commonMain.aws.sdk.kotlin.services.appflow.serde.ConnectorDetailDocumentDeserializer.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
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.appflow.serde
import aws.sdk.kotlin.services.appflow.model.ConnectorDetail
import aws.sdk.kotlin.services.appflow.model.ConnectorProvisioningType
import aws.sdk.kotlin.services.appflow.model.ConnectorType
import aws.sdk.kotlin.services.appflow.model.SupportedDataTransferType
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
import kotlin.collections.mutableListOf
internal fun deserializeConnectorDetailDocument(deserializer: Deserializer): ConnectorDetail {
val builder = ConnectorDetail.Builder()
val APPLICATIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("applicationType"))
val CONNECTORDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("connectorDescription"))
val CONNECTORLABEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("connectorLabel"))
val CONNECTORMODES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("connectorModes"))
val CONNECTORNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("connectorName"))
val CONNECTOROWNER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("connectorOwner"))
val CONNECTORPROVISIONINGTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("connectorProvisioningType"))
val CONNECTORTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("connectorType"))
val CONNECTORVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("connectorVersion"))
val REGISTEREDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("registeredAt"))
val REGISTEREDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("registeredBy"))
val SUPPORTEDDATATRANSFERTYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("supportedDataTransferTypes"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(APPLICATIONTYPE_DESCRIPTOR)
field(CONNECTORDESCRIPTION_DESCRIPTOR)
field(CONNECTORLABEL_DESCRIPTOR)
field(CONNECTORMODES_DESCRIPTOR)
field(CONNECTORNAME_DESCRIPTOR)
field(CONNECTOROWNER_DESCRIPTOR)
field(CONNECTORPROVISIONINGTYPE_DESCRIPTOR)
field(CONNECTORTYPE_DESCRIPTOR)
field(CONNECTORVERSION_DESCRIPTOR)
field(REGISTEREDAT_DESCRIPTOR)
field(REGISTEREDBY_DESCRIPTOR)
field(SUPPORTEDDATATRANSFERTYPES_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
APPLICATIONTYPE_DESCRIPTOR.index -> builder.applicationType = deserializeString()
CONNECTORDESCRIPTION_DESCRIPTOR.index -> builder.connectorDescription = deserializeString()
CONNECTORLABEL_DESCRIPTOR.index -> builder.connectorLabel = deserializeString()
CONNECTORMODES_DESCRIPTOR.index -> builder.connectorModes =
deserializer.deserializeList(CONNECTORMODES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
CONNECTORNAME_DESCRIPTOR.index -> builder.connectorName = deserializeString()
CONNECTOROWNER_DESCRIPTOR.index -> builder.connectorOwner = deserializeString()
CONNECTORPROVISIONINGTYPE_DESCRIPTOR.index -> builder.connectorProvisioningType = deserializeString().let { ConnectorProvisioningType.fromValue(it) }
CONNECTORTYPE_DESCRIPTOR.index -> builder.connectorType = deserializeString().let { ConnectorType.fromValue(it) }
CONNECTORVERSION_DESCRIPTOR.index -> builder.connectorVersion = deserializeString()
REGISTEREDAT_DESCRIPTOR.index -> builder.registeredAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
REGISTEREDBY_DESCRIPTOR.index -> builder.registeredBy = deserializeString()
SUPPORTEDDATATRANSFERTYPES_DESCRIPTOR.index -> builder.supportedDataTransferTypes =
deserializer.deserializeList(SUPPORTEDDATATRANSFERTYPES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { SupportedDataTransferType.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}