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

commonMain.aws.sdk.kotlin.services.codebuild.serde.FleetDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.codebuild.serde

import aws.sdk.kotlin.services.codebuild.model.ComputeType
import aws.sdk.kotlin.services.codebuild.model.EnvironmentType
import aws.sdk.kotlin.services.codebuild.model.Fleet
import aws.sdk.kotlin.services.codebuild.model.FleetOverflowBehavior
import aws.sdk.kotlin.services.codebuild.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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
import kotlin.collections.mutableListOf

internal fun deserializeFleetDocument(deserializer: Deserializer): Fleet {
    val builder = Fleet.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val BASECAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("baseCapacity"))
    val COMPUTECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("computeConfiguration"))
    val COMPUTETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("computeType"))
    val CREATED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("created"))
    val ENVIRONMENTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("environmentType"))
    val FLEETSERVICEROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("fleetServiceRole"))
    val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("id"))
    val IMAGEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("imageId"))
    val LASTMODIFIED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastModified"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    val OVERFLOWBEHAVIOR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("overflowBehavior"))
    val PROXYCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("proxyConfiguration"))
    val SCALINGCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("scalingConfiguration"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("status"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("tags"))
    val VPCCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("vpcConfig"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(BASECAPACITY_DESCRIPTOR)
        field(COMPUTECONFIGURATION_DESCRIPTOR)
        field(COMPUTETYPE_DESCRIPTOR)
        field(CREATED_DESCRIPTOR)
        field(ENVIRONMENTTYPE_DESCRIPTOR)
        field(FLEETSERVICEROLE_DESCRIPTOR)
        field(ID_DESCRIPTOR)
        field(IMAGEID_DESCRIPTOR)
        field(LASTMODIFIED_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(OVERFLOWBEHAVIOR_DESCRIPTOR)
        field(PROXYCONFIGURATION_DESCRIPTOR)
        field(SCALINGCONFIGURATION_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
        field(VPCCONFIG_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                BASECAPACITY_DESCRIPTOR.index -> builder.baseCapacity = deserializeInt()
                COMPUTECONFIGURATION_DESCRIPTOR.index -> builder.computeConfiguration = deserializeComputeConfigurationDocument(deserializer)
                COMPUTETYPE_DESCRIPTOR.index -> builder.computeType = deserializeString().let { ComputeType.fromValue(it) }
                CREATED_DESCRIPTOR.index -> builder.created = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                ENVIRONMENTTYPE_DESCRIPTOR.index -> builder.environmentType = deserializeString().let { EnvironmentType.fromValue(it) }
                FLEETSERVICEROLE_DESCRIPTOR.index -> builder.fleetServiceRole = deserializeString()
                ID_DESCRIPTOR.index -> builder.id = deserializeString()
                IMAGEID_DESCRIPTOR.index -> builder.imageId = deserializeString()
                LASTMODIFIED_DESCRIPTOR.index -> builder.lastModified = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                OVERFLOWBEHAVIOR_DESCRIPTOR.index -> builder.overflowBehavior = deserializeString().let { FleetOverflowBehavior.fromValue(it) }
                PROXYCONFIGURATION_DESCRIPTOR.index -> builder.proxyConfiguration = deserializeProxyConfigurationDocument(deserializer)
                SCALINGCONFIGURATION_DESCRIPTOR.index -> builder.scalingConfiguration = deserializeScalingConfigurationOutputDocument(deserializer)
                STATUS_DESCRIPTOR.index -> builder.status = deserializeFleetStatusDocument(deserializer)
                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
                    }
                VPCCONFIG_DESCRIPTOR.index -> builder.vpcConfig = deserializeVpcConfigDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy