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

commonMain.aws.sdk.kotlin.services.route53recoverycontrolconfig.serde.ControlPanelDocumentDeserializer.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.route53recoverycontrolconfig.serde

import aws.sdk.kotlin.services.route53recoverycontrolconfig.model.ControlPanel
import aws.sdk.kotlin.services.route53recoverycontrolconfig.model.Status
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 deserializeControlPanelDocument(deserializer: Deserializer): ControlPanel {
    val builder = ControlPanel.Builder()
    val CLUSTERARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ClusterArn"))
    val CONTROLPANELARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ControlPanelArn"))
    val DEFAULTCONTROLPANEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("DefaultControlPanel"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val OWNER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Owner"))
    val ROUTINGCONTROLCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("RoutingControlCount"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CLUSTERARN_DESCRIPTOR)
        field(CONTROLPANELARN_DESCRIPTOR)
        field(DEFAULTCONTROLPANEL_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(OWNER_DESCRIPTOR)
        field(ROUTINGCONTROLCOUNT_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CLUSTERARN_DESCRIPTOR.index -> builder.clusterArn = deserializeString()
                CONTROLPANELARN_DESCRIPTOR.index -> builder.controlPanelArn = deserializeString()
                DEFAULTCONTROLPANEL_DESCRIPTOR.index -> builder.defaultControlPanel = deserializeBoolean()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                OWNER_DESCRIPTOR.index -> builder.owner = deserializeString()
                ROUTINGCONTROLCOUNT_DESCRIPTOR.index -> builder.routingControlCount = deserializeInt()
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { Status.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy