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

commonMain.aws.sdk.kotlin.services.transfer.serde.DescribedAccessDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.transfer.serde

import aws.sdk.kotlin.services.transfer.model.DescribedAccess
import aws.sdk.kotlin.services.transfer.model.HomeDirectoryMapEntry
import aws.sdk.kotlin.services.transfer.model.HomeDirectoryType
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 deserializeDescribedAccessDocument(deserializer: Deserializer): DescribedAccess {
    val builder = DescribedAccess.Builder()
    val EXTERNALID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ExternalId"))
    val HOMEDIRECTORY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("HomeDirectory"))
    val HOMEDIRECTORYMAPPINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("HomeDirectoryMappings"))
    val HOMEDIRECTORYTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("HomeDirectoryType"))
    val POLICY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Policy"))
    val POSIXPROFILE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("PosixProfile"))
    val ROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Role"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(EXTERNALID_DESCRIPTOR)
        field(HOMEDIRECTORY_DESCRIPTOR)
        field(HOMEDIRECTORYMAPPINGS_DESCRIPTOR)
        field(HOMEDIRECTORYTYPE_DESCRIPTOR)
        field(POLICY_DESCRIPTOR)
        field(POSIXPROFILE_DESCRIPTOR)
        field(ROLE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                EXTERNALID_DESCRIPTOR.index -> builder.externalId = deserializeString()
                HOMEDIRECTORY_DESCRIPTOR.index -> builder.homeDirectory = deserializeString()
                HOMEDIRECTORYMAPPINGS_DESCRIPTOR.index -> builder.homeDirectoryMappings =
                    deserializer.deserializeList(HOMEDIRECTORYMAPPINGS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeHomeDirectoryMapEntryDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                HOMEDIRECTORYTYPE_DESCRIPTOR.index -> builder.homeDirectoryType = deserializeString().let { HomeDirectoryType.fromValue(it) }
                POLICY_DESCRIPTOR.index -> builder.policy = deserializeString()
                POSIXPROFILE_DESCRIPTOR.index -> builder.posixProfile = deserializePosixProfileDocument(deserializer)
                ROLE_DESCRIPTOR.index -> builder.role = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy