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

commonMain.aws.sdk.kotlin.services.appflow.serde.ConnectorConfigurationDocumentDeserializer.kt Maven / Gradle / Ivy

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.ConnectorConfiguration
import aws.sdk.kotlin.services.appflow.model.ConnectorProvisioningType
import aws.sdk.kotlin.services.appflow.model.ConnectorRuntimeSetting
import aws.sdk.kotlin.services.appflow.model.ConnectorType
import aws.sdk.kotlin.services.appflow.model.DataTransferApi
import aws.sdk.kotlin.services.appflow.model.Operators
import aws.sdk.kotlin.services.appflow.model.ScheduleFrequencyType
import aws.sdk.kotlin.services.appflow.model.SupportedDataTransferType
import aws.sdk.kotlin.services.appflow.model.TriggerType
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
import kotlin.collections.mutableListOf

internal fun deserializeConnectorConfigurationDocument(deserializer: Deserializer): ConnectorConfiguration {
    val builder = ConnectorConfiguration.Builder()
    val AUTHENTICATIONCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("authenticationConfig"))
    val CANUSEASDESTINATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("canUseAsDestination"))
    val CANUSEASSOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("canUseAsSource"))
    val CONNECTORARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("connectorArn"))
    val CONNECTORDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("connectorDescription"))
    val CONNECTORLABEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("connectorLabel"))
    val CONNECTORMETADATA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("connectorMetadata"))
    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 CONNECTORPROVISIONINGCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("connectorProvisioningConfig"))
    val CONNECTORPROVISIONINGTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("connectorProvisioningType"))
    val CONNECTORRUNTIMESETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("connectorRuntimeSettings"))
    val CONNECTORTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("connectorType"))
    val CONNECTORVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("connectorVersion"))
    val ISPRIVATELINKENABLED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isPrivateLinkEnabled"))
    val ISPRIVATELINKENDPOINTURLREQUIRED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isPrivateLinkEndpointUrlRequired"))
    val LOGOURL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("logoURL"))
    val REGISTEREDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("registeredAt"))
    val REGISTEREDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("registeredBy"))
    val SUPPORTEDAPIVERSIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("supportedApiVersions"))
    val SUPPORTEDDATATRANSFERAPIS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("supportedDataTransferApis"))
    val SUPPORTEDDATATRANSFERTYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("supportedDataTransferTypes"))
    val SUPPORTEDDESTINATIONCONNECTORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("supportedDestinationConnectors"))
    val SUPPORTEDOPERATORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("supportedOperators"))
    val SUPPORTEDSCHEDULINGFREQUENCIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("supportedSchedulingFrequencies"))
    val SUPPORTEDTRIGGERTYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("supportedTriggerTypes"))
    val SUPPORTEDWRITEOPERATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("supportedWriteOperations"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AUTHENTICATIONCONFIG_DESCRIPTOR)
        field(CANUSEASDESTINATION_DESCRIPTOR)
        field(CANUSEASSOURCE_DESCRIPTOR)
        field(CONNECTORARN_DESCRIPTOR)
        field(CONNECTORDESCRIPTION_DESCRIPTOR)
        field(CONNECTORLABEL_DESCRIPTOR)
        field(CONNECTORMETADATA_DESCRIPTOR)
        field(CONNECTORMODES_DESCRIPTOR)
        field(CONNECTORNAME_DESCRIPTOR)
        field(CONNECTOROWNER_DESCRIPTOR)
        field(CONNECTORPROVISIONINGCONFIG_DESCRIPTOR)
        field(CONNECTORPROVISIONINGTYPE_DESCRIPTOR)
        field(CONNECTORRUNTIMESETTINGS_DESCRIPTOR)
        field(CONNECTORTYPE_DESCRIPTOR)
        field(CONNECTORVERSION_DESCRIPTOR)
        field(ISPRIVATELINKENABLED_DESCRIPTOR)
        field(ISPRIVATELINKENDPOINTURLREQUIRED_DESCRIPTOR)
        field(LOGOURL_DESCRIPTOR)
        field(REGISTEREDAT_DESCRIPTOR)
        field(REGISTEREDBY_DESCRIPTOR)
        field(SUPPORTEDAPIVERSIONS_DESCRIPTOR)
        field(SUPPORTEDDATATRANSFERAPIS_DESCRIPTOR)
        field(SUPPORTEDDATATRANSFERTYPES_DESCRIPTOR)
        field(SUPPORTEDDESTINATIONCONNECTORS_DESCRIPTOR)
        field(SUPPORTEDOPERATORS_DESCRIPTOR)
        field(SUPPORTEDSCHEDULINGFREQUENCIES_DESCRIPTOR)
        field(SUPPORTEDTRIGGERTYPES_DESCRIPTOR)
        field(SUPPORTEDWRITEOPERATIONS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AUTHENTICATIONCONFIG_DESCRIPTOR.index -> builder.authenticationConfig = deserializeAuthenticationConfigDocument(deserializer)
                CANUSEASDESTINATION_DESCRIPTOR.index -> builder.canUseAsDestination = deserializeBoolean()
                CANUSEASSOURCE_DESCRIPTOR.index -> builder.canUseAsSource = deserializeBoolean()
                CONNECTORARN_DESCRIPTOR.index -> builder.connectorArn = deserializeString()
                CONNECTORDESCRIPTION_DESCRIPTOR.index -> builder.connectorDescription = deserializeString()
                CONNECTORLABEL_DESCRIPTOR.index -> builder.connectorLabel = deserializeString()
                CONNECTORMETADATA_DESCRIPTOR.index -> builder.connectorMetadata = deserializeConnectorMetadataDocument(deserializer)
                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()
                CONNECTORPROVISIONINGCONFIG_DESCRIPTOR.index -> builder.connectorProvisioningConfig = deserializeConnectorProvisioningConfigDocument(deserializer)
                CONNECTORPROVISIONINGTYPE_DESCRIPTOR.index -> builder.connectorProvisioningType = deserializeString().let { ConnectorProvisioningType.fromValue(it) }
                CONNECTORRUNTIMESETTINGS_DESCRIPTOR.index -> builder.connectorRuntimeSettings =
                    deserializer.deserializeList(CONNECTORRUNTIMESETTINGS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeConnectorRuntimeSettingDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                CONNECTORTYPE_DESCRIPTOR.index -> builder.connectorType = deserializeString().let { ConnectorType.fromValue(it) }
                CONNECTORVERSION_DESCRIPTOR.index -> builder.connectorVersion = deserializeString()
                ISPRIVATELINKENABLED_DESCRIPTOR.index -> builder.isPrivateLinkEnabled = deserializeBoolean()
                ISPRIVATELINKENDPOINTURLREQUIRED_DESCRIPTOR.index -> builder.isPrivateLinkEndpointUrlRequired = deserializeBoolean()
                LOGOURL_DESCRIPTOR.index -> builder.logoUrl = deserializeString()
                REGISTEREDAT_DESCRIPTOR.index -> builder.registeredAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                REGISTEREDBY_DESCRIPTOR.index -> builder.registeredBy = deserializeString()
                SUPPORTEDAPIVERSIONS_DESCRIPTOR.index -> builder.supportedApiVersions =
                    deserializer.deserializeList(SUPPORTEDAPIVERSIONS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SUPPORTEDDATATRANSFERAPIS_DESCRIPTOR.index -> builder.supportedDataTransferApis =
                    deserializer.deserializeList(SUPPORTEDDATATRANSFERAPIS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeDataTransferApiDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                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
                    }
                SUPPORTEDDESTINATIONCONNECTORS_DESCRIPTOR.index -> builder.supportedDestinationConnectors =
                    deserializer.deserializeList(SUPPORTEDDESTINATIONCONNECTORS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { ConnectorType.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SUPPORTEDOPERATORS_DESCRIPTOR.index -> builder.supportedOperators =
                    deserializer.deserializeList(SUPPORTEDOPERATORS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { Operators.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SUPPORTEDSCHEDULINGFREQUENCIES_DESCRIPTOR.index -> builder.supportedSchedulingFrequencies =
                    deserializer.deserializeList(SUPPORTEDSCHEDULINGFREQUENCIES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { ScheduleFrequencyType.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SUPPORTEDTRIGGERTYPES_DESCRIPTOR.index -> builder.supportedTriggerTypes =
                    deserializer.deserializeList(SUPPORTEDTRIGGERTYPES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { TriggerType.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SUPPORTEDWRITEOPERATIONS_DESCRIPTOR.index -> builder.supportedWriteOperations =
                    deserializer.deserializeList(SUPPORTEDWRITEOPERATIONS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString().let { WriteOperationType.fromValue(it) } } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy