commonMain.aws.sdk.kotlin.services.backup.serde.ReportSettingDocumentDeserializer.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.ReportSetting
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 deserializeReportSettingDocument(deserializer: Deserializer): ReportSetting {
val builder = ReportSetting.Builder()
val ACCOUNTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Accounts"))
val FRAMEWORKARNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("FrameworkArns"))
val NUMBEROFFRAMEWORKS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("NumberOfFrameworks"))
val ORGANIZATIONUNITS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("OrganizationUnits"))
val REGIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Regions"))
val REPORTTEMPLATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReportTemplate"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACCOUNTS_DESCRIPTOR)
field(FRAMEWORKARNS_DESCRIPTOR)
field(NUMBEROFFRAMEWORKS_DESCRIPTOR)
field(ORGANIZATIONUNITS_DESCRIPTOR)
field(REGIONS_DESCRIPTOR)
field(REPORTTEMPLATE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ACCOUNTS_DESCRIPTOR.index -> builder.accounts =
deserializer.deserializeList(ACCOUNTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
FRAMEWORKARNS_DESCRIPTOR.index -> builder.frameworkArns =
deserializer.deserializeList(FRAMEWORKARNS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
NUMBEROFFRAMEWORKS_DESCRIPTOR.index -> builder.numberOfFrameworks = deserializeInt()
ORGANIZATIONUNITS_DESCRIPTOR.index -> builder.organizationUnits =
deserializer.deserializeList(ORGANIZATIONUNITS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
REGIONS_DESCRIPTOR.index -> builder.regions =
deserializer.deserializeList(REGIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
REPORTTEMPLATE_DESCRIPTOR.index -> builder.reportTemplate = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}