commonMain.aws.sdk.kotlin.services.backup.serde.BackupSelectionDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.backup.serde
import aws.sdk.kotlin.services.backup.model.BackupSelection
import aws.sdk.kotlin.services.backup.model.Condition
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 deserializeBackupSelectionDocument(deserializer: Deserializer): BackupSelection {
val builder = BackupSelection.Builder()
val CONDITIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Conditions"))
val IAMROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("IamRoleArn"))
val LISTOFTAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ListOfTags"))
val NOTRESOURCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("NotResources"))
val RESOURCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Resources"))
val SELECTIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SelectionName"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CONDITIONS_DESCRIPTOR)
field(IAMROLEARN_DESCRIPTOR)
field(LISTOFTAGS_DESCRIPTOR)
field(NOTRESOURCES_DESCRIPTOR)
field(RESOURCES_DESCRIPTOR)
field(SELECTIONNAME_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CONDITIONS_DESCRIPTOR.index -> builder.conditions = deserializeConditionsDocument(deserializer)
IAMROLEARN_DESCRIPTOR.index -> builder.iamRoleArn = deserializeString()
LISTOFTAGS_DESCRIPTOR.index -> builder.listOfTags =
deserializer.deserializeList(LISTOFTAGS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeConditionDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
NOTRESOURCES_DESCRIPTOR.index -> builder.notResources =
deserializer.deserializeList(NOTRESOURCES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
RESOURCES_DESCRIPTOR.index -> builder.resources =
deserializer.deserializeList(RESOURCES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
SELECTIONNAME_DESCRIPTOR.index -> builder.selectionName = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}