
commonMain.aws.sdk.kotlin.services.wellarchitected.transform.ProfileTemplateQuestionDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.wellarchitected.transform
import aws.sdk.kotlin.services.wellarchitected.model.ProfileTemplateChoice
import aws.sdk.kotlin.services.wellarchitected.model.ProfileTemplateQuestion
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 deserializeProfileTemplateQuestionDocument(deserializer: Deserializer): ProfileTemplateQuestion {
val builder = ProfileTemplateQuestion.Builder()
val MAXSELECTEDCHOICES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaxSelectedChoices"))
val MINSELECTEDCHOICES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MinSelectedChoices"))
val QUESTIONCHOICES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("QuestionChoices"))
val QUESTIONDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("QuestionDescription"))
val QUESTIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("QuestionId"))
val QUESTIONTITLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("QuestionTitle"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(MAXSELECTEDCHOICES_DESCRIPTOR)
field(MINSELECTEDCHOICES_DESCRIPTOR)
field(QUESTIONCHOICES_DESCRIPTOR)
field(QUESTIONDESCRIPTION_DESCRIPTOR)
field(QUESTIONID_DESCRIPTOR)
field(QUESTIONTITLE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
MAXSELECTEDCHOICES_DESCRIPTOR.index -> builder.maxSelectedChoices = deserializeInt()
MINSELECTEDCHOICES_DESCRIPTOR.index -> builder.minSelectedChoices = deserializeInt()
QUESTIONCHOICES_DESCRIPTOR.index -> builder.questionChoices =
deserializer.deserializeList(QUESTIONCHOICES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeProfileTemplateChoiceDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
QUESTIONDESCRIPTION_DESCRIPTOR.index -> builder.questionDescription = deserializeString()
QUESTIONID_DESCRIPTOR.index -> builder.questionId = deserializeString()
QUESTIONTITLE_DESCRIPTOR.index -> builder.questionTitle = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy