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

commonMain.aws.sdk.kotlin.services.gamelift.serde.SupportContainerDefinitionDocumentDeserializer.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.gamelift.serde

import aws.sdk.kotlin.services.gamelift.model.ContainerDependency
import aws.sdk.kotlin.services.gamelift.model.ContainerEnvironment
import aws.sdk.kotlin.services.gamelift.model.ContainerMountPoint
import aws.sdk.kotlin.services.gamelift.model.SupportContainerDefinition
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 deserializeSupportContainerDefinitionDocument(deserializer: Deserializer): SupportContainerDefinition {
    val builder = SupportContainerDefinition.Builder()
    val CONTAINERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ContainerName"))
    val DEPENDSON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DependsOn"))
    val ENVIRONMENTOVERRIDE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("EnvironmentOverride"))
    val ESSENTIAL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("Essential"))
    val HEALTHCHECK_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("HealthCheck"))
    val IMAGEURI_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ImageUri"))
    val MEMORYHARDLIMITMEBIBYTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MemoryHardLimitMebibytes"))
    val MOUNTPOINTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("MountPoints"))
    val PORTCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("PortConfiguration"))
    val RESOLVEDIMAGEDIGEST_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResolvedImageDigest"))
    val VCPU_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("Vcpu"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CONTAINERNAME_DESCRIPTOR)
        field(DEPENDSON_DESCRIPTOR)
        field(ENVIRONMENTOVERRIDE_DESCRIPTOR)
        field(ESSENTIAL_DESCRIPTOR)
        field(HEALTHCHECK_DESCRIPTOR)
        field(IMAGEURI_DESCRIPTOR)
        field(MEMORYHARDLIMITMEBIBYTES_DESCRIPTOR)
        field(MOUNTPOINTS_DESCRIPTOR)
        field(PORTCONFIGURATION_DESCRIPTOR)
        field(RESOLVEDIMAGEDIGEST_DESCRIPTOR)
        field(VCPU_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CONTAINERNAME_DESCRIPTOR.index -> builder.containerName = deserializeString()
                DEPENDSON_DESCRIPTOR.index -> builder.dependsOn =
                    deserializer.deserializeList(DEPENDSON_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeContainerDependencyDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                ENVIRONMENTOVERRIDE_DESCRIPTOR.index -> builder.environmentOverride =
                    deserializer.deserializeList(ENVIRONMENTOVERRIDE_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeContainerEnvironmentDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                ESSENTIAL_DESCRIPTOR.index -> builder.essential = deserializeBoolean()
                HEALTHCHECK_DESCRIPTOR.index -> builder.healthCheck = deserializeContainerHealthCheckDocument(deserializer)
                IMAGEURI_DESCRIPTOR.index -> builder.imageUri = deserializeString()
                MEMORYHARDLIMITMEBIBYTES_DESCRIPTOR.index -> builder.memoryHardLimitMebibytes = deserializeInt()
                MOUNTPOINTS_DESCRIPTOR.index -> builder.mountPoints =
                    deserializer.deserializeList(MOUNTPOINTS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeContainerMountPointDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                PORTCONFIGURATION_DESCRIPTOR.index -> builder.portConfiguration = deserializeContainerPortConfigurationDocument(deserializer)
                RESOLVEDIMAGEDIGEST_DESCRIPTOR.index -> builder.resolvedImageDigest = deserializeString()
                VCPU_DESCRIPTOR.index -> builder.vcpu = deserializeDouble()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy