commonMain.aws.sdk.kotlin.services.apprunner.serde.VpcConnectorDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apprunner-jvm Show documentation
Show all versions of apprunner-jvm Show documentation
The AWS SDK for Kotlin client for AppRunner
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.apprunner.serde
import aws.sdk.kotlin.services.apprunner.model.VpcConnector
import aws.sdk.kotlin.services.apprunner.model.VpcConnectorStatus
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 deserializeVpcConnectorDocument(deserializer: Deserializer): VpcConnector {
val builder = VpcConnector.Builder()
val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreatedAt"))
val DELETEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("DeletedAt"))
val SECURITYGROUPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("SecurityGroups"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
val SUBNETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Subnets"))
val VPCCONNECTORARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("VpcConnectorArn"))
val VPCCONNECTORNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("VpcConnectorName"))
val VPCCONNECTORREVISION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("VpcConnectorRevision"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CREATEDAT_DESCRIPTOR)
field(DELETEDAT_DESCRIPTOR)
field(SECURITYGROUPS_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(SUBNETS_DESCRIPTOR)
field(VPCCONNECTORARN_DESCRIPTOR)
field(VPCCONNECTORNAME_DESCRIPTOR)
field(VPCCONNECTORREVISION_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
DELETEDAT_DESCRIPTOR.index -> builder.deletedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
SECURITYGROUPS_DESCRIPTOR.index -> builder.securityGroups =
deserializer.deserializeList(SECURITYGROUPS_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 { VpcConnectorStatus.fromValue(it) }
SUBNETS_DESCRIPTOR.index -> builder.subnets =
deserializer.deserializeList(SUBNETS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
VPCCONNECTORARN_DESCRIPTOR.index -> builder.vpcConnectorArn = deserializeString()
VPCCONNECTORNAME_DESCRIPTOR.index -> builder.vpcConnectorName = deserializeString()
VPCCONNECTORREVISION_DESCRIPTOR.index -> builder.vpcConnectorRevision = deserializeInt()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}