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

commonMain.aws.sdk.kotlin.services.pinpointsmsvoicev2.serde.RegistrationFieldDefinitionDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.pinpointsmsvoicev2.serde

import aws.sdk.kotlin.services.pinpointsmsvoicev2.model.FieldRequirement
import aws.sdk.kotlin.services.pinpointsmsvoicev2.model.FieldType
import aws.sdk.kotlin.services.pinpointsmsvoicev2.model.RegistrationFieldDefinition
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 deserializeRegistrationFieldDefinitionDocument(deserializer: Deserializer): RegistrationFieldDefinition {
    val builder = RegistrationFieldDefinition.Builder()
    val DISPLAYHINTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DisplayHints"))
    val FIELDPATH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FieldPath"))
    val FIELDREQUIREMENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FieldRequirement"))
    val FIELDTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FieldType"))
    val SECTIONPATH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SectionPath"))
    val SELECTVALIDATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SelectValidation"))
    val TEXTVALIDATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("TextValidation"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DISPLAYHINTS_DESCRIPTOR)
        field(FIELDPATH_DESCRIPTOR)
        field(FIELDREQUIREMENT_DESCRIPTOR)
        field(FIELDTYPE_DESCRIPTOR)
        field(SECTIONPATH_DESCRIPTOR)
        field(SELECTVALIDATION_DESCRIPTOR)
        field(TEXTVALIDATION_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DISPLAYHINTS_DESCRIPTOR.index -> builder.displayHints = deserializeRegistrationFieldDisplayHintsDocument(deserializer)
                FIELDPATH_DESCRIPTOR.index -> builder.fieldPath = deserializeString()
                FIELDREQUIREMENT_DESCRIPTOR.index -> builder.fieldRequirement = deserializeString().let { FieldRequirement.fromValue(it) }
                FIELDTYPE_DESCRIPTOR.index -> builder.fieldType = deserializeString().let { FieldType.fromValue(it) }
                SECTIONPATH_DESCRIPTOR.index -> builder.sectionPath = deserializeString()
                SELECTVALIDATION_DESCRIPTOR.index -> builder.selectValidation = deserializeSelectValidationDocument(deserializer)
                TEXTVALIDATION_DESCRIPTOR.index -> builder.textValidation = deserializeTextValidationDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy