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

commonMain.aws.sdk.kotlin.services.connect.transform.UserPhoneConfigDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.connect.transform

import aws.sdk.kotlin.services.connect.model.PhoneType
import aws.sdk.kotlin.services.connect.model.UserPhoneConfig
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 deserializeUserPhoneConfigDocument(deserializer: Deserializer): UserPhoneConfig {
    val builder = UserPhoneConfig.Builder()
    val AFTERCONTACTWORKTIMELIMIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("AfterContactWorkTimeLimit"))
    val AUTOACCEPT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("AutoAccept"))
    val DESKPHONENUMBER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DeskPhoneNumber"))
    val PHONETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("PhoneType"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AFTERCONTACTWORKTIMELIMIT_DESCRIPTOR)
        field(AUTOACCEPT_DESCRIPTOR)
        field(DESKPHONENUMBER_DESCRIPTOR)
        field(PHONETYPE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AFTERCONTACTWORKTIMELIMIT_DESCRIPTOR.index -> builder.afterContactWorkTimeLimit = deserializeInt()
                AUTOACCEPT_DESCRIPTOR.index -> builder.autoAccept = deserializeBoolean()
                DESKPHONENUMBER_DESCRIPTOR.index -> builder.deskPhoneNumber = deserializeString()
                PHONETYPE_DESCRIPTOR.index -> builder.phoneType = deserializeString().let { PhoneType.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy