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

commonMain.aws.sdk.kotlin.services.devicefarm.serde.CountersDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.devicefarm.serde

import aws.sdk.kotlin.services.devicefarm.model.Counters
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 deserializeCountersDocument(deserializer: Deserializer): Counters {
    val builder = Counters.Builder()
    val ERRORED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("errored"))
    val FAILED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("failed"))
    val PASSED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("passed"))
    val SKIPPED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("skipped"))
    val STOPPED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("stopped"))
    val TOTAL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("total"))
    val WARNED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("warned"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ERRORED_DESCRIPTOR)
        field(FAILED_DESCRIPTOR)
        field(PASSED_DESCRIPTOR)
        field(SKIPPED_DESCRIPTOR)
        field(STOPPED_DESCRIPTOR)
        field(TOTAL_DESCRIPTOR)
        field(WARNED_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ERRORED_DESCRIPTOR.index -> builder.errored = deserializeInt()
                FAILED_DESCRIPTOR.index -> builder.failed = deserializeInt()
                PASSED_DESCRIPTOR.index -> builder.passed = deserializeInt()
                SKIPPED_DESCRIPTOR.index -> builder.skipped = deserializeInt()
                STOPPED_DESCRIPTOR.index -> builder.stopped = deserializeInt()
                TOTAL_DESCRIPTOR.index -> builder.total = deserializeInt()
                WARNED_DESCRIPTOR.index -> builder.warned = deserializeInt()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy