commonMain.aws.sdk.kotlin.services.transfer.serde.DescribedAgreementDocumentDeserializer.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.AgreementStatusType
import aws.sdk.kotlin.services.transfer.model.DescribedAgreement
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 deserializeDescribedAgreementDocument(deserializer: Deserializer): DescribedAgreement {
val builder = DescribedAgreement.Builder()
val ACCESSROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AccessRole"))
val AGREEMENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AgreementId"))
val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Arn"))
val BASEDIRECTORY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("BaseDirectory"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val LOCALPROFILEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LocalProfileId"))
val PARTNERPROFILEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PartnerProfileId"))
val SERVERID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ServerId"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Tags"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACCESSROLE_DESCRIPTOR)
field(AGREEMENTID_DESCRIPTOR)
field(ARN_DESCRIPTOR)
field(BASEDIRECTORY_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(LOCALPROFILEID_DESCRIPTOR)
field(PARTNERPROFILEID_DESCRIPTOR)
field(SERVERID_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ACCESSROLE_DESCRIPTOR.index -> builder.accessRole = deserializeString()
AGREEMENTID_DESCRIPTOR.index -> builder.agreementId = deserializeString()
ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
BASEDIRECTORY_DESCRIPTOR.index -> builder.baseDirectory = deserializeString()
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
LOCALPROFILEID_DESCRIPTOR.index -> builder.localProfileId = deserializeString()
PARTNERPROFILEID_DESCRIPTOR.index -> builder.partnerProfileId = deserializeString()
SERVERID_DESCRIPTOR.index -> builder.serverId = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { AgreementStatusType.fromValue(it) }
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
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}