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

commonMain.aws.sdk.kotlin.services.iot.serde.LocationActionDocumentDeserializer.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.iot.serde

import aws.sdk.kotlin.services.iot.model.LocationAction
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 deserializeLocationActionDocument(deserializer: Deserializer): LocationAction {
    val builder = LocationAction.Builder()
    val DEVICEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("deviceId"))
    val LATITUDE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("latitude"))
    val LONGITUDE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("longitude"))
    val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("roleArn"))
    val TIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("timestamp"))
    val TRACKERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("trackerName"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DEVICEID_DESCRIPTOR)
        field(LATITUDE_DESCRIPTOR)
        field(LONGITUDE_DESCRIPTOR)
        field(ROLEARN_DESCRIPTOR)
        field(TIMESTAMP_DESCRIPTOR)
        field(TRACKERNAME_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DEVICEID_DESCRIPTOR.index -> builder.deviceId = deserializeString()
                LATITUDE_DESCRIPTOR.index -> builder.latitude = deserializeString()
                LONGITUDE_DESCRIPTOR.index -> builder.longitude = deserializeString()
                ROLEARN_DESCRIPTOR.index -> builder.roleArn = deserializeString()
                TIMESTAMP_DESCRIPTOR.index -> builder.timestamp = deserializeLocationTimestampDocument(deserializer)
                TRACKERNAME_DESCRIPTOR.index -> builder.trackerName = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy