commonMain.aws.sdk.kotlin.services.glue.serde.DataQualityResultDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.serde
import aws.sdk.kotlin.services.glue.model.DataQualityAnalyzerResult
import aws.sdk.kotlin.services.glue.model.DataQualityObservation
import aws.sdk.kotlin.services.glue.model.DataQualityResult
import aws.sdk.kotlin.services.glue.model.DataQualityRuleResult
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
import kotlin.collections.mutableListOf
internal fun deserializeDataQualityResultDocument(deserializer: Deserializer): DataQualityResult {
val builder = DataQualityResult.Builder()
val ANALYZERRESULTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AnalyzerResults"))
val COMPLETEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CompletedOn"))
val DATASOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DataSource"))
val EVALUATIONCONTEXT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EvaluationContext"))
val JOBNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("JobName"))
val JOBRUNID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("JobRunId"))
val OBSERVATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Observations"))
val PROFILEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ProfileId"))
val RESULTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResultId"))
val RULERESULTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("RuleResults"))
val RULESETEVALUATIONRUNID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RulesetEvaluationRunId"))
val RULESETNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RulesetName"))
val SCORE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("Score"))
val STARTEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("StartedOn"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ANALYZERRESULTS_DESCRIPTOR)
field(COMPLETEDON_DESCRIPTOR)
field(DATASOURCE_DESCRIPTOR)
field(EVALUATIONCONTEXT_DESCRIPTOR)
field(JOBNAME_DESCRIPTOR)
field(JOBRUNID_DESCRIPTOR)
field(OBSERVATIONS_DESCRIPTOR)
field(PROFILEID_DESCRIPTOR)
field(RESULTID_DESCRIPTOR)
field(RULERESULTS_DESCRIPTOR)
field(RULESETEVALUATIONRUNID_DESCRIPTOR)
field(RULESETNAME_DESCRIPTOR)
field(SCORE_DESCRIPTOR)
field(STARTEDON_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ANALYZERRESULTS_DESCRIPTOR.index -> builder.analyzerResults =
deserializer.deserializeList(ANALYZERRESULTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeDataQualityAnalyzerResultDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
COMPLETEDON_DESCRIPTOR.index -> builder.completedOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
DATASOURCE_DESCRIPTOR.index -> builder.dataSource = deserializeDataSourceDocument(deserializer)
EVALUATIONCONTEXT_DESCRIPTOR.index -> builder.evaluationContext = deserializeString()
JOBNAME_DESCRIPTOR.index -> builder.jobName = deserializeString()
JOBRUNID_DESCRIPTOR.index -> builder.jobRunId = deserializeString()
OBSERVATIONS_DESCRIPTOR.index -> builder.observations =
deserializer.deserializeList(OBSERVATIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeDataQualityObservationDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
PROFILEID_DESCRIPTOR.index -> builder.profileId = deserializeString()
RESULTID_DESCRIPTOR.index -> builder.resultId = deserializeString()
RULERESULTS_DESCRIPTOR.index -> builder.ruleResults =
deserializer.deserializeList(RULERESULTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeDataQualityRuleResultDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
RULESETEVALUATIONRUNID_DESCRIPTOR.index -> builder.rulesetEvaluationRunId = deserializeString()
RULESETNAME_DESCRIPTOR.index -> builder.rulesetName = deserializeString()
SCORE_DESCRIPTOR.index -> builder.score = deserializeDouble()
STARTEDON_DESCRIPTOR.index -> builder.startedOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}