commonMain.aws.sdk.kotlin.services.redshiftserverless.serde.EndpointAccessDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redshiftserverless-jvm Show documentation
Show all versions of redshiftserverless-jvm Show documentation
The AWS SDK for Kotlin client for Redshift Serverless
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.redshiftserverless.serde
import aws.sdk.kotlin.services.redshiftserverless.model.EndpointAccess
import aws.sdk.kotlin.services.redshiftserverless.model.VpcSecurityGroupMembership
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 deserializeEndpointAccessDocument(deserializer: Deserializer): EndpointAccess {
val builder = EndpointAccess.Builder()
val ADDRESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("address"))
val ENDPOINTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("endpointArn"))
val ENDPOINTCREATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("endpointCreateTime"))
val ENDPOINTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("endpointName"))
val ENDPOINTSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("endpointStatus"))
val PORT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("port"))
val SUBNETIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("subnetIds"))
val VPCENDPOINT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("vpcEndpoint"))
val VPCSECURITYGROUPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("vpcSecurityGroups"))
val WORKGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("workgroupName"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ADDRESS_DESCRIPTOR)
field(ENDPOINTARN_DESCRIPTOR)
field(ENDPOINTCREATETIME_DESCRIPTOR)
field(ENDPOINTNAME_DESCRIPTOR)
field(ENDPOINTSTATUS_DESCRIPTOR)
field(PORT_DESCRIPTOR)
field(SUBNETIDS_DESCRIPTOR)
field(VPCENDPOINT_DESCRIPTOR)
field(VPCSECURITYGROUPS_DESCRIPTOR)
field(WORKGROUPNAME_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ADDRESS_DESCRIPTOR.index -> builder.address = deserializeString()
ENDPOINTARN_DESCRIPTOR.index -> builder.endpointArn = deserializeString()
ENDPOINTCREATETIME_DESCRIPTOR.index -> builder.endpointCreateTime = deserializeInstant(TimestampFormat.ISO_8601)
ENDPOINTNAME_DESCRIPTOR.index -> builder.endpointName = deserializeString()
ENDPOINTSTATUS_DESCRIPTOR.index -> builder.endpointStatus = deserializeString()
PORT_DESCRIPTOR.index -> builder.port = deserializeInt()
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
}
VPCENDPOINT_DESCRIPTOR.index -> builder.vpcEndpoint = deserializeVpcEndpointDocument(deserializer)
VPCSECURITYGROUPS_DESCRIPTOR.index -> builder.vpcSecurityGroups =
deserializer.deserializeList(VPCSECURITYGROUPS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeVpcSecurityGroupMembershipDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
WORKGROUPNAME_DESCRIPTOR.index -> builder.workgroupName = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}