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

commonMain.aws.sdk.kotlin.services.codebuild.serde.TestCaseDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.codebuild.serde

import aws.sdk.kotlin.services.codebuild.model.TestCase
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

internal fun deserializeTestCaseDocument(deserializer: Deserializer): TestCase {
    val builder = TestCase.Builder()
    val DURATIONINNANOSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("durationInNanoSeconds"))
    val EXPIRED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("expired"))
    val MESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("message"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    val PREFIX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("prefix"))
    val REPORTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("reportArn"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
    val TESTRAWDATAPATH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("testRawDataPath"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DURATIONINNANOSECONDS_DESCRIPTOR)
        field(EXPIRED_DESCRIPTOR)
        field(MESSAGE_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(PREFIX_DESCRIPTOR)
        field(REPORTARN_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(TESTRAWDATAPATH_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DURATIONINNANOSECONDS_DESCRIPTOR.index -> builder.durationInNanoSeconds = deserializeLong()
                EXPIRED_DESCRIPTOR.index -> builder.expired = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                MESSAGE_DESCRIPTOR.index -> builder.message = deserializeString()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                PREFIX_DESCRIPTOR.index -> builder.prefix = deserializeString()
                REPORTARN_DESCRIPTOR.index -> builder.reportArn = deserializeString()
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString()
                TESTRAWDATAPATH_DESCRIPTOR.index -> builder.testRawDataPath = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy