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

commonMain.aws.sdk.kotlin.services.iottwinmaker.serde.ComponentResponseDocumentDeserializer.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.ComponentPropertyGroupResponse
import aws.sdk.kotlin.services.iottwinmaker.model.ComponentResponse
import aws.sdk.kotlin.services.iottwinmaker.model.ComponentSummary
import aws.sdk.kotlin.services.iottwinmaker.model.PropertyResponse
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 deserializeComponentResponseDocument(deserializer: Deserializer): ComponentResponse {
    val builder = ComponentResponse.Builder()
    val AREALLCOMPOSITECOMPONENTSRETURNED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("areAllCompositeComponentsReturned"))
    val AREALLPROPERTIESRETURNED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("areAllPropertiesReturned"))
    val COMPONENTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("componentName"))
    val COMPONENTTYPEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("componentTypeId"))
    val COMPOSITECOMPONENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("compositeComponents"))
    val DEFINEDIN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("definedIn"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("description"))
    val PROPERTIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("properties"))
    val PROPERTYGROUPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("propertyGroups"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("status"))
    val SYNCSOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("syncSource"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AREALLCOMPOSITECOMPONENTSRETURNED_DESCRIPTOR)
        field(AREALLPROPERTIESRETURNED_DESCRIPTOR)
        field(COMPONENTNAME_DESCRIPTOR)
        field(COMPONENTTYPEID_DESCRIPTOR)
        field(COMPOSITECOMPONENTS_DESCRIPTOR)
        field(DEFINEDIN_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(PROPERTIES_DESCRIPTOR)
        field(PROPERTYGROUPS_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(SYNCSOURCE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AREALLCOMPOSITECOMPONENTSRETURNED_DESCRIPTOR.index -> builder.areAllCompositeComponentsReturned = deserializeBoolean()
                AREALLPROPERTIESRETURNED_DESCRIPTOR.index -> builder.areAllPropertiesReturned = deserializeBoolean()
                COMPONENTNAME_DESCRIPTOR.index -> builder.componentName = deserializeString()
                COMPONENTTYPEID_DESCRIPTOR.index -> builder.componentTypeId = deserializeString()
                COMPOSITECOMPONENTS_DESCRIPTOR.index -> builder.compositeComponents =
                    deserializer.deserializeMap(COMPOSITECOMPONENTS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeComponentSummaryDocument(deserializer) } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                DEFINEDIN_DESCRIPTOR.index -> builder.definedIn = deserializeString()
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                PROPERTIES_DESCRIPTOR.index -> builder.properties =
                    deserializer.deserializeMap(PROPERTIES_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializePropertyResponseDocument(deserializer) } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                PROPERTYGROUPS_DESCRIPTOR.index -> builder.propertyGroups =
                    deserializer.deserializeMap(PROPERTYGROUPS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeComponentPropertyGroupResponseDocument(deserializer) } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                STATUS_DESCRIPTOR.index -> builder.status = deserializeStatusDocument(deserializer)
                SYNCSOURCE_DESCRIPTOR.index -> builder.syncSource = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy