
commonMain.aws.sdk.kotlin.services.iottwinmaker.serde.PropertyDefinitionResponseDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.iottwinmaker.serde
import aws.sdk.kotlin.services.iottwinmaker.model.PropertyDefinitionResponse
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 kotlin.collections.mutableMapOf
internal fun deserializePropertyDefinitionResponseDocument(deserializer: Deserializer): PropertyDefinitionResponse {
val builder = PropertyDefinitionResponse.Builder()
val CONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("configuration"))
val DATATYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("dataType"))
val DEFAULTVALUE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("defaultValue"))
val DISPLAYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("displayName"))
val ISEXTERNALID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isExternalId"))
val ISFINAL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isFinal"))
val ISIMPORTED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isImported"))
val ISINHERITED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isInherited"))
val ISREQUIREDINENTITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isRequiredInEntity"))
val ISSTOREDEXTERNALLY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isStoredExternally"))
val ISTIMESERIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isTimeSeries"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CONFIGURATION_DESCRIPTOR)
field(DATATYPE_DESCRIPTOR)
field(DEFAULTVALUE_DESCRIPTOR)
field(DISPLAYNAME_DESCRIPTOR)
field(ISEXTERNALID_DESCRIPTOR)
field(ISFINAL_DESCRIPTOR)
field(ISIMPORTED_DESCRIPTOR)
field(ISINHERITED_DESCRIPTOR)
field(ISREQUIREDINENTITY_DESCRIPTOR)
field(ISSTOREDEXTERNALLY_DESCRIPTOR)
field(ISTIMESERIES_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CONFIGURATION_DESCRIPTOR.index -> builder.configuration =
deserializer.deserializeMap(CONFIGURATION_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
DATATYPE_DESCRIPTOR.index -> builder.dataType = deserializeDataTypeDocument(deserializer)
DEFAULTVALUE_DESCRIPTOR.index -> builder.defaultValue = deserializeDataValueDocument(deserializer)
DISPLAYNAME_DESCRIPTOR.index -> builder.displayName = deserializeString()
ISEXTERNALID_DESCRIPTOR.index -> builder.isExternalId = deserializeBoolean()
ISFINAL_DESCRIPTOR.index -> builder.isFinal = deserializeBoolean()
ISIMPORTED_DESCRIPTOR.index -> builder.isImported = deserializeBoolean()
ISINHERITED_DESCRIPTOR.index -> builder.isInherited = deserializeBoolean()
ISREQUIREDINENTITY_DESCRIPTOR.index -> builder.isRequiredInEntity = deserializeBoolean()
ISSTOREDEXTERNALLY_DESCRIPTOR.index -> builder.isStoredExternally = deserializeBoolean()
ISTIMESERIES_DESCRIPTOR.index -> builder.isTimeSeries = deserializeBoolean()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy