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

commonMain.aws.sdk.kotlin.services.cloudwatchevents.serde.EcsParametersDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudwatchevents.serde

import aws.sdk.kotlin.services.cloudwatchevents.model.CapacityProviderStrategyItem
import aws.sdk.kotlin.services.cloudwatchevents.model.EcsParameters
import aws.sdk.kotlin.services.cloudwatchevents.model.LaunchType
import aws.sdk.kotlin.services.cloudwatchevents.model.PlacementConstraint
import aws.sdk.kotlin.services.cloudwatchevents.model.PlacementStrategy
import aws.sdk.kotlin.services.cloudwatchevents.model.PropagateTags
import aws.sdk.kotlin.services.cloudwatchevents.model.Tag
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.mutableListOf

internal fun deserializeEcsParametersDocument(deserializer: Deserializer): EcsParameters {
    val builder = EcsParameters.Builder()
    val CAPACITYPROVIDERSTRATEGY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("CapacityProviderStrategy"))
    val ENABLEECSMANAGEDTAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("EnableECSManagedTags"))
    val ENABLEEXECUTECOMMAND_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("EnableExecuteCommand"))
    val GROUP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Group"))
    val LAUNCHTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("LaunchType"))
    val NETWORKCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("NetworkConfiguration"))
    val PLACEMENTCONSTRAINTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("PlacementConstraints"))
    val PLACEMENTSTRATEGY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("PlacementStrategy"))
    val PLATFORMVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PlatformVersion"))
    val PROPAGATETAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("PropagateTags"))
    val REFERENCEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReferenceId"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Tags"))
    val TASKCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("TaskCount"))
    val TASKDEFINITIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TaskDefinitionArn"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CAPACITYPROVIDERSTRATEGY_DESCRIPTOR)
        field(ENABLEECSMANAGEDTAGS_DESCRIPTOR)
        field(ENABLEEXECUTECOMMAND_DESCRIPTOR)
        field(GROUP_DESCRIPTOR)
        field(LAUNCHTYPE_DESCRIPTOR)
        field(NETWORKCONFIGURATION_DESCRIPTOR)
        field(PLACEMENTCONSTRAINTS_DESCRIPTOR)
        field(PLACEMENTSTRATEGY_DESCRIPTOR)
        field(PLATFORMVERSION_DESCRIPTOR)
        field(PROPAGATETAGS_DESCRIPTOR)
        field(REFERENCEID_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
        field(TASKCOUNT_DESCRIPTOR)
        field(TASKDEFINITIONARN_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CAPACITYPROVIDERSTRATEGY_DESCRIPTOR.index -> builder.capacityProviderStrategy =
                    deserializer.deserializeList(CAPACITYPROVIDERSTRATEGY_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeCapacityProviderStrategyItemDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                ENABLEECSMANAGEDTAGS_DESCRIPTOR.index -> builder.enableEcsManagedTags = deserializeBoolean()
                ENABLEEXECUTECOMMAND_DESCRIPTOR.index -> builder.enableExecuteCommand = deserializeBoolean()
                GROUP_DESCRIPTOR.index -> builder.group = deserializeString()
                LAUNCHTYPE_DESCRIPTOR.index -> builder.launchType = deserializeString().let { LaunchType.fromValue(it) }
                NETWORKCONFIGURATION_DESCRIPTOR.index -> builder.networkConfiguration = deserializeNetworkConfigurationDocument(deserializer)
                PLACEMENTCONSTRAINTS_DESCRIPTOR.index -> builder.placementConstraints =
                    deserializer.deserializeList(PLACEMENTCONSTRAINTS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializePlacementConstraintDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                PLACEMENTSTRATEGY_DESCRIPTOR.index -> builder.placementStrategy =
                    deserializer.deserializeList(PLACEMENTSTRATEGY_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializePlacementStrategyDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                PLATFORMVERSION_DESCRIPTOR.index -> builder.platformVersion = deserializeString()
                PROPAGATETAGS_DESCRIPTOR.index -> builder.propagateTags = deserializeString().let { PropagateTags.fromValue(it) }
                REFERENCEID_DESCRIPTOR.index -> builder.referenceId = deserializeString()
                TAGS_DESCRIPTOR.index -> builder.tags =
                    deserializer.deserializeList(TAGS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeTagDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                TASKCOUNT_DESCRIPTOR.index -> builder.taskCount = deserializeInt()
                TASKDEFINITIONARN_DESCRIPTOR.index -> builder.taskDefinitionArn = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy