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

commonMain.aws.sdk.kotlin.services.redshiftserverless.serde.WorkgroupDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.redshiftserverless.serde

import aws.sdk.kotlin.services.redshiftserverless.model.ConfigParameter
import aws.sdk.kotlin.services.redshiftserverless.model.Workgroup
import aws.sdk.kotlin.services.redshiftserverless.model.WorkgroupStatus
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 deserializeWorkgroupDocument(deserializer: Deserializer): Workgroup {
    val builder = Workgroup.Builder()
    val BASECAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("baseCapacity"))
    val CONFIGPARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("configParameters"))
    val CREATIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("creationDate"))
    val CROSSACCOUNTVPCS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("crossAccountVpcs"))
    val CUSTOMDOMAINCERTIFICATEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("customDomainCertificateArn"))
    val CUSTOMDOMAINCERTIFICATEEXPIRYTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("customDomainCertificateExpiryTime"))
    val CUSTOMDOMAINNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("customDomainName"))
    val ENDPOINT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("endpoint"))
    val ENHANCEDVPCROUTING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("enhancedVpcRouting"))
    val IPADDRESSTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ipAddressType"))
    val MAXCAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("maxCapacity"))
    val NAMESPACENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("namespaceName"))
    val PATCHVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("patchVersion"))
    val PORT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("port"))
    val PUBLICLYACCESSIBLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("publiclyAccessible"))
    val SECURITYGROUPIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("securityGroupIds"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
    val SUBNETIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("subnetIds"))
    val WORKGROUPARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("workgroupArn"))
    val WORKGROUPID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("workgroupId"))
    val WORKGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("workgroupName"))
    val WORKGROUPVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("workgroupVersion"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(BASECAPACITY_DESCRIPTOR)
        field(CONFIGPARAMETERS_DESCRIPTOR)
        field(CREATIONDATE_DESCRIPTOR)
        field(CROSSACCOUNTVPCS_DESCRIPTOR)
        field(CUSTOMDOMAINCERTIFICATEARN_DESCRIPTOR)
        field(CUSTOMDOMAINCERTIFICATEEXPIRYTIME_DESCRIPTOR)
        field(CUSTOMDOMAINNAME_DESCRIPTOR)
        field(ENDPOINT_DESCRIPTOR)
        field(ENHANCEDVPCROUTING_DESCRIPTOR)
        field(IPADDRESSTYPE_DESCRIPTOR)
        field(MAXCAPACITY_DESCRIPTOR)
        field(NAMESPACENAME_DESCRIPTOR)
        field(PATCHVERSION_DESCRIPTOR)
        field(PORT_DESCRIPTOR)
        field(PUBLICLYACCESSIBLE_DESCRIPTOR)
        field(SECURITYGROUPIDS_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(SUBNETIDS_DESCRIPTOR)
        field(WORKGROUPARN_DESCRIPTOR)
        field(WORKGROUPID_DESCRIPTOR)
        field(WORKGROUPNAME_DESCRIPTOR)
        field(WORKGROUPVERSION_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                BASECAPACITY_DESCRIPTOR.index -> builder.baseCapacity = deserializeInt()
                CONFIGPARAMETERS_DESCRIPTOR.index -> builder.configParameters =
                    deserializer.deserializeList(CONFIGPARAMETERS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeConfigParameterDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                CREATIONDATE_DESCRIPTOR.index -> builder.creationDate = deserializeInstant(TimestampFormat.ISO_8601)
                CROSSACCOUNTVPCS_DESCRIPTOR.index -> builder.crossAccountVpcs =
                    deserializer.deserializeList(CROSSACCOUNTVPCS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                CUSTOMDOMAINCERTIFICATEARN_DESCRIPTOR.index -> builder.customDomainCertificateArn = deserializeString()
                CUSTOMDOMAINCERTIFICATEEXPIRYTIME_DESCRIPTOR.index -> builder.customDomainCertificateExpiryTime = deserializeInstant(TimestampFormat.ISO_8601)
                CUSTOMDOMAINNAME_DESCRIPTOR.index -> builder.customDomainName = deserializeString()
                ENDPOINT_DESCRIPTOR.index -> builder.endpoint = deserializeEndpointDocument(deserializer)
                ENHANCEDVPCROUTING_DESCRIPTOR.index -> builder.enhancedVpcRouting = deserializeBoolean()
                IPADDRESSTYPE_DESCRIPTOR.index -> builder.ipAddressType = deserializeString()
                MAXCAPACITY_DESCRIPTOR.index -> builder.maxCapacity = deserializeInt()
                NAMESPACENAME_DESCRIPTOR.index -> builder.namespaceName = deserializeString()
                PATCHVERSION_DESCRIPTOR.index -> builder.patchVersion = deserializeString()
                PORT_DESCRIPTOR.index -> builder.port = deserializeInt()
                PUBLICLYACCESSIBLE_DESCRIPTOR.index -> builder.publiclyAccessible = deserializeBoolean()
                SECURITYGROUPIDS_DESCRIPTOR.index -> builder.securityGroupIds =
                    deserializer.deserializeList(SECURITYGROUPIDS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { WorkgroupStatus.fromValue(it) }
                SUBNETIDS_DESCRIPTOR.index -> builder.subnetIds =
                    deserializer.deserializeList(SUBNETIDS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                WORKGROUPARN_DESCRIPTOR.index -> builder.workgroupArn = deserializeString()
                WORKGROUPID_DESCRIPTOR.index -> builder.workgroupId = deserializeString()
                WORKGROUPNAME_DESCRIPTOR.index -> builder.workgroupName = deserializeString()
                WORKGROUPVERSION_DESCRIPTOR.index -> builder.workgroupVersion = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy