All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.lookoutvision.serde.DatasetImageStatsDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.34
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.lookoutvision.serde

import aws.sdk.kotlin.services.lookoutvision.model.DatasetImageStats
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

internal fun deserializeDatasetImageStatsDocument(deserializer: Deserializer): DatasetImageStats {
    val builder = DatasetImageStats.Builder()
    val ANOMALY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Anomaly"))
    val LABELED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Labeled"))
    val NORMAL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Normal"))
    val TOTAL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Total"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ANOMALY_DESCRIPTOR)
        field(LABELED_DESCRIPTOR)
        field(NORMAL_DESCRIPTOR)
        field(TOTAL_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ANOMALY_DESCRIPTOR.index -> builder.anomaly = deserializeInt()
                LABELED_DESCRIPTOR.index -> builder.labeled = deserializeInt()
                NORMAL_DESCRIPTOR.index -> builder.normal = deserializeInt()
                TOTAL_DESCRIPTOR.index -> builder.total = deserializeInt()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy