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

commonMain.aws.sdk.kotlin.services.iotfleetwise.serde.ObdInterfaceDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iotfleetwise.serde

import aws.sdk.kotlin.services.iotfleetwise.model.ObdInterface
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 deserializeObdInterfaceDocument(deserializer: Deserializer): ObdInterface {
    val builder = ObdInterface.Builder()
    val DTCREQUESTINTERVALSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("dtcRequestIntervalSeconds"))
    val HASTRANSMISSIONECU_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("hasTransmissionEcu"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    val OBDSTANDARD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("obdStandard"))
    val PIDREQUESTINTERVALSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("pidRequestIntervalSeconds"))
    val REQUESTMESSAGEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("requestMessageId"))
    val USEEXTENDEDIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("useExtendedIds"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DTCREQUESTINTERVALSECONDS_DESCRIPTOR)
        field(HASTRANSMISSIONECU_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(OBDSTANDARD_DESCRIPTOR)
        field(PIDREQUESTINTERVALSECONDS_DESCRIPTOR)
        field(REQUESTMESSAGEID_DESCRIPTOR)
        field(USEEXTENDEDIDS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DTCREQUESTINTERVALSECONDS_DESCRIPTOR.index -> builder.dtcRequestIntervalSeconds = deserializeInt()
                HASTRANSMISSIONECU_DESCRIPTOR.index -> builder.hasTransmissionEcu = deserializeBoolean()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                OBDSTANDARD_DESCRIPTOR.index -> builder.obdStandard = deserializeString()
                PIDREQUESTINTERVALSECONDS_DESCRIPTOR.index -> builder.pidRequestIntervalSeconds = deserializeInt()
                REQUESTMESSAGEID_DESCRIPTOR.index -> builder.requestMessageId = deserializeInt()
                USEEXTENDEDIDS_DESCRIPTOR.index -> builder.useExtendedIds = deserializeBoolean()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy