commonMain.aws.sdk.kotlin.services.transfer.serde.DescribedUserDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of transfer-jvm Show documentation
Show all versions of transfer-jvm Show documentation
The AWS SDK for Kotlin client for Transfer
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.transfer.serde
import aws.sdk.kotlin.services.transfer.model.DescribedUser
import aws.sdk.kotlin.services.transfer.model.HomeDirectoryMapEntry
import aws.sdk.kotlin.services.transfer.model.HomeDirectoryType
import aws.sdk.kotlin.services.transfer.model.SshPublicKey
import aws.sdk.kotlin.services.transfer.model.Tag
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 deserializeDescribedUserDocument(deserializer: Deserializer): DescribedUser {
val builder = DescribedUser.Builder()
val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Arn"))
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 SSHPUBLICKEYS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("SshPublicKeys"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Tags"))
val USERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("UserName"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ARN_DESCRIPTOR)
field(HOMEDIRECTORY_DESCRIPTOR)
field(HOMEDIRECTORYMAPPINGS_DESCRIPTOR)
field(HOMEDIRECTORYTYPE_DESCRIPTOR)
field(POLICY_DESCRIPTOR)
field(POSIXPROFILE_DESCRIPTOR)
field(ROLE_DESCRIPTOR)
field(SSHPUBLICKEYS_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(USERNAME_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ARN_DESCRIPTOR.index -> builder.arn = 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()
SSHPUBLICKEYS_DESCRIPTOR.index -> builder.sshPublicKeys =
deserializer.deserializeList(SSHPUBLICKEYS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeSshPublicKeyDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
TAGS_DESCRIPTOR.index -> builder.tags =
deserializer.deserializeList(TAGS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeTagDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
USERNAME_DESCRIPTOR.index -> builder.userName = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}