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

commonMain.aws.sdk.kotlin.services.directconnect.serde.DirectConnectGatewayAttachmentDocumentDeserializer.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.directconnect.serde

import aws.sdk.kotlin.services.directconnect.model.DirectConnectGatewayAttachment
import aws.sdk.kotlin.services.directconnect.model.DirectConnectGatewayAttachmentState
import aws.sdk.kotlin.services.directconnect.model.DirectConnectGatewayAttachmentType
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

internal fun deserializeDirectConnectGatewayAttachmentDocument(deserializer: Deserializer): DirectConnectGatewayAttachment {
    val builder = DirectConnectGatewayAttachment.Builder()
    val ATTACHMENTSTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("attachmentState"))
    val ATTACHMENTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("attachmentType"))
    val DIRECTCONNECTGATEWAYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("directConnectGatewayId"))
    val STATECHANGEERROR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("stateChangeError"))
    val VIRTUALINTERFACEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("virtualInterfaceId"))
    val VIRTUALINTERFACEOWNERACCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("virtualInterfaceOwnerAccount"))
    val VIRTUALINTERFACEREGION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("virtualInterfaceRegion"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ATTACHMENTSTATE_DESCRIPTOR)
        field(ATTACHMENTTYPE_DESCRIPTOR)
        field(DIRECTCONNECTGATEWAYID_DESCRIPTOR)
        field(STATECHANGEERROR_DESCRIPTOR)
        field(VIRTUALINTERFACEID_DESCRIPTOR)
        field(VIRTUALINTERFACEOWNERACCOUNT_DESCRIPTOR)
        field(VIRTUALINTERFACEREGION_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ATTACHMENTSTATE_DESCRIPTOR.index -> builder.attachmentState = deserializeString().let { DirectConnectGatewayAttachmentState.fromValue(it) }
                ATTACHMENTTYPE_DESCRIPTOR.index -> builder.attachmentType = deserializeString().let { DirectConnectGatewayAttachmentType.fromValue(it) }
                DIRECTCONNECTGATEWAYID_DESCRIPTOR.index -> builder.directConnectGatewayId = deserializeString()
                STATECHANGEERROR_DESCRIPTOR.index -> builder.stateChangeError = deserializeString()
                VIRTUALINTERFACEID_DESCRIPTOR.index -> builder.virtualInterfaceId = deserializeString()
                VIRTUALINTERFACEOWNERACCOUNT_DESCRIPTOR.index -> builder.virtualInterfaceOwnerAccount = deserializeString()
                VIRTUALINTERFACEREGION_DESCRIPTOR.index -> builder.virtualInterfaceRegion = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy