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

commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.EndpointSettingDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.databasemigrationservice.serde

import aws.sdk.kotlin.services.databasemigrationservice.model.EndpointSetting
import aws.sdk.kotlin.services.databasemigrationservice.model.EndpointSettingTypeValue
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 kotlin.collections.mutableListOf

internal fun deserializeEndpointSettingDocument(deserializer: Deserializer): EndpointSetting {
    val builder = EndpointSetting.Builder()
    val APPLICABILITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Applicability"))
    val DEFAULTVALUE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DefaultValue"))
    val ENUMVALUES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("EnumValues"))
    val INTVALUEMAX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("IntValueMax"))
    val INTVALUEMIN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("IntValueMin"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
    val SENSITIVE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("Sensitive"))
    val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Type"))
    val UNITS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Units"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(APPLICABILITY_DESCRIPTOR)
        field(DEFAULTVALUE_DESCRIPTOR)
        field(ENUMVALUES_DESCRIPTOR)
        field(INTVALUEMAX_DESCRIPTOR)
        field(INTVALUEMIN_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(SENSITIVE_DESCRIPTOR)
        field(TYPE_DESCRIPTOR)
        field(UNITS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                APPLICABILITY_DESCRIPTOR.index -> builder.applicability = deserializeString()
                DEFAULTVALUE_DESCRIPTOR.index -> builder.defaultValue = deserializeString()
                ENUMVALUES_DESCRIPTOR.index -> builder.enumValues =
                    deserializer.deserializeList(ENUMVALUES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                INTVALUEMAX_DESCRIPTOR.index -> builder.intValueMax = deserializeInt()
                INTVALUEMIN_DESCRIPTOR.index -> builder.intValueMin = deserializeInt()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                SENSITIVE_DESCRIPTOR.index -> builder.sensitive = deserializeBoolean()
                TYPE_DESCRIPTOR.index -> builder.type = deserializeString().let { EndpointSettingTypeValue.fromValue(it) }
                UNITS_DESCRIPTOR.index -> builder.units = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy