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

commonMain.aws.sdk.kotlin.services.iot.transform.ThingIndexingConfigurationDocumentSerializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.99
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.iot.transform

import aws.sdk.kotlin.services.iot.model.ThingIndexingConfiguration
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.Serializer
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 serializeThingIndexingConfigurationDocument(serializer: Serializer, input: ThingIndexingConfiguration) {
    val CUSTOMFIELDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("customFields"))
    val DEVICEDEFENDERINDEXINGMODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("deviceDefenderIndexingMode"))
    val FILTER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("filter"))
    val MANAGEDFIELDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("managedFields"))
    val NAMEDSHADOWINDEXINGMODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("namedShadowIndexingMode"))
    val THINGCONNECTIVITYINDEXINGMODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("thingConnectivityIndexingMode"))
    val THINGINDEXINGMODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("thingIndexingMode"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CUSTOMFIELDS_DESCRIPTOR)
        field(DEVICEDEFENDERINDEXINGMODE_DESCRIPTOR)
        field(FILTER_DESCRIPTOR)
        field(MANAGEDFIELDS_DESCRIPTOR)
        field(NAMEDSHADOWINDEXINGMODE_DESCRIPTOR)
        field(THINGCONNECTIVITYINDEXINGMODE_DESCRIPTOR)
        field(THINGINDEXINGMODE_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        input.thingIndexingMode?.let { field(THINGINDEXINGMODE_DESCRIPTOR, it.value) }
        input.thingConnectivityIndexingMode?.let { field(THINGCONNECTIVITYINDEXINGMODE_DESCRIPTOR, it.value) }
        input.deviceDefenderIndexingMode?.let { field(DEVICEDEFENDERINDEXINGMODE_DESCRIPTOR, it.value) }
        input.namedShadowIndexingMode?.let { field(NAMEDSHADOWINDEXINGMODE_DESCRIPTOR, it.value) }
        if (input.managedFields != null) {
            listField(MANAGEDFIELDS_DESCRIPTOR) {
                for (el0 in input.managedFields) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializeFieldDocument))
                }
            }
        }
        if (input.customFields != null) {
            listField(CUSTOMFIELDS_DESCRIPTOR) {
                for (el0 in input.customFields) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializeFieldDocument))
                }
            }
        }
        input.filter?.let { field(FILTER_DESCRIPTOR, it, ::serializeIndexingFilterDocument) }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy