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

commonMain.aws.sdk.kotlin.services.s3outposts.serde.EndpointDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.s3outposts.serde

import aws.sdk.kotlin.services.s3outposts.model.Endpoint
import aws.sdk.kotlin.services.s3outposts.model.EndpointAccessType
import aws.sdk.kotlin.services.s3outposts.model.EndpointStatus
import aws.sdk.kotlin.services.s3outposts.model.NetworkInterface
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 kotlin.collections.mutableListOf

internal fun deserializeEndpointDocument(deserializer: Deserializer): Endpoint {
    val builder = Endpoint.Builder()
    val ACCESSTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("AccessType"))
    val CIDRBLOCK_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CidrBlock"))
    val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTime"))
    val CUSTOMEROWNEDIPV4POOL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CustomerOwnedIpv4Pool"))
    val ENDPOINTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EndpointArn"))
    val FAILEDREASON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("FailedReason"))
    val NETWORKINTERFACES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("NetworkInterfaces"))
    val OUTPOSTSID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OutpostsId"))
    val SECURITYGROUPID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SecurityGroupId"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
    val SUBNETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SubnetId"))
    val VPCID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("VpcId"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACCESSTYPE_DESCRIPTOR)
        field(CIDRBLOCK_DESCRIPTOR)
        field(CREATIONTIME_DESCRIPTOR)
        field(CUSTOMEROWNEDIPV4POOL_DESCRIPTOR)
        field(ENDPOINTARN_DESCRIPTOR)
        field(FAILEDREASON_DESCRIPTOR)
        field(NETWORKINTERFACES_DESCRIPTOR)
        field(OUTPOSTSID_DESCRIPTOR)
        field(SECURITYGROUPID_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(SUBNETID_DESCRIPTOR)
        field(VPCID_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACCESSTYPE_DESCRIPTOR.index -> builder.accessType = deserializeString().let { EndpointAccessType.fromValue(it) }
                CIDRBLOCK_DESCRIPTOR.index -> builder.cidrBlock = deserializeString()
                CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                CUSTOMEROWNEDIPV4POOL_DESCRIPTOR.index -> builder.customerOwnedIpv4Pool = deserializeString()
                ENDPOINTARN_DESCRIPTOR.index -> builder.endpointArn = deserializeString()
                FAILEDREASON_DESCRIPTOR.index -> builder.failedReason = deserializeFailedReasonDocument(deserializer)
                NETWORKINTERFACES_DESCRIPTOR.index -> builder.networkInterfaces =
                    deserializer.deserializeList(NETWORKINTERFACES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeNetworkInterfaceDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                OUTPOSTSID_DESCRIPTOR.index -> builder.outpostsId = deserializeString()
                SECURITYGROUPID_DESCRIPTOR.index -> builder.securityGroupId = deserializeString()
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { EndpointStatus.fromValue(it) }
                SUBNETID_DESCRIPTOR.index -> builder.subnetId = deserializeString()
                VPCID_DESCRIPTOR.index -> builder.vpcId = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy