
commonMain.aws.sdk.kotlin.services.iot1clickdevicesservice.serde.DeviceMethodDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.iot1clickdevicesservice.serde
import aws.sdk.kotlin.services.iot1clickdevicesservice.model.DeviceMethod
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 deserializeDeviceMethodDocument(deserializer: Deserializer): DeviceMethod {
val builder = DeviceMethod.Builder()
val DEVICETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("deviceType"))
val METHODNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("methodName"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DEVICETYPE_DESCRIPTOR)
field(METHODNAME_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
DEVICETYPE_DESCRIPTOR.index -> builder.deviceType = deserializeString()
METHODNAME_DESCRIPTOR.index -> builder.methodName = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy