commonMain.aws.sdk.kotlin.services.eventbridge.serde.EcsParametersDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eventbridge-jvm Show documentation
Show all versions of eventbridge-jvm Show documentation
The AWS SDK for Kotlin client for EventBridge
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.eventbridge.serde
import aws.sdk.kotlin.services.eventbridge.model.CapacityProviderStrategyItem
import aws.sdk.kotlin.services.eventbridge.model.EcsParameters
import aws.sdk.kotlin.services.eventbridge.model.LaunchType
import aws.sdk.kotlin.services.eventbridge.model.PlacementConstraint
import aws.sdk.kotlin.services.eventbridge.model.PlacementStrategy
import aws.sdk.kotlin.services.eventbridge.model.PropagateTags
import aws.sdk.kotlin.services.eventbridge.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()
}