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

commonMain.aws.sdk.kotlin.services.iotfleethub.serde.ApplicationSummaryDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iotfleethub.serde

import aws.sdk.kotlin.services.iotfleethub.model.ApplicationState
import aws.sdk.kotlin.services.iotfleethub.model.ApplicationSummary
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 deserializeApplicationSummaryDocument(deserializer: Deserializer): ApplicationSummary {
    val builder = ApplicationSummary.Builder()
    val APPLICATIONCREATIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("applicationCreationDate"))
    val APPLICATIONDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("applicationDescription"))
    val APPLICATIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("applicationId"))
    val APPLICATIONLASTUPDATEDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("applicationLastUpdateDate"))
    val APPLICATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("applicationName"))
    val APPLICATIONSTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("applicationState"))
    val APPLICATIONURL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("applicationUrl"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(APPLICATIONCREATIONDATE_DESCRIPTOR)
        field(APPLICATIONDESCRIPTION_DESCRIPTOR)
        field(APPLICATIONID_DESCRIPTOR)
        field(APPLICATIONLASTUPDATEDATE_DESCRIPTOR)
        field(APPLICATIONNAME_DESCRIPTOR)
        field(APPLICATIONSTATE_DESCRIPTOR)
        field(APPLICATIONURL_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                APPLICATIONCREATIONDATE_DESCRIPTOR.index -> builder.applicationCreationDate = deserializeLong()
                APPLICATIONDESCRIPTION_DESCRIPTOR.index -> builder.applicationDescription = deserializeString()
                APPLICATIONID_DESCRIPTOR.index -> builder.applicationId = deserializeString()
                APPLICATIONLASTUPDATEDATE_DESCRIPTOR.index -> builder.applicationLastUpdateDate = deserializeLong()
                APPLICATIONNAME_DESCRIPTOR.index -> builder.applicationName = deserializeString()
                APPLICATIONSTATE_DESCRIPTOR.index -> builder.applicationState = deserializeString().let { ApplicationState.fromValue(it) }
                APPLICATIONURL_DESCRIPTOR.index -> builder.applicationUrl = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy