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

commonMain.aws.sdk.kotlin.services.gamelift.serde.FleetDeploymentDocumentDeserializer.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.DeploymentStatus
import aws.sdk.kotlin.services.gamelift.model.FleetDeployment
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

internal fun deserializeFleetDeploymentDocument(deserializer: Deserializer): FleetDeployment {
    val builder = FleetDeployment.Builder()
    val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTime"))
    val DEPLOYMENTCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DeploymentConfiguration"))
    val DEPLOYMENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DeploymentId"))
    val DEPLOYMENTSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("DeploymentStatus"))
    val FLEETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FleetId"))
    val GAMESERVERBINARYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("GameServerBinaryArn"))
    val PERINSTANCEBINARYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PerInstanceBinaryArn"))
    val ROLLBACKGAMESERVERBINARYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RollbackGameServerBinaryArn"))
    val ROLLBACKPERINSTANCEBINARYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RollbackPerInstanceBinaryArn"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CREATIONTIME_DESCRIPTOR)
        field(DEPLOYMENTCONFIGURATION_DESCRIPTOR)
        field(DEPLOYMENTID_DESCRIPTOR)
        field(DEPLOYMENTSTATUS_DESCRIPTOR)
        field(FLEETID_DESCRIPTOR)
        field(GAMESERVERBINARYARN_DESCRIPTOR)
        field(PERINSTANCEBINARYARN_DESCRIPTOR)
        field(ROLLBACKGAMESERVERBINARYARN_DESCRIPTOR)
        field(ROLLBACKPERINSTANCEBINARYARN_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DEPLOYMENTCONFIGURATION_DESCRIPTOR.index -> builder.deploymentConfiguration = deserializeDeploymentConfigurationDocument(deserializer)
                DEPLOYMENTID_DESCRIPTOR.index -> builder.deploymentId = deserializeString()
                DEPLOYMENTSTATUS_DESCRIPTOR.index -> builder.deploymentStatus = deserializeString().let { DeploymentStatus.fromValue(it) }
                FLEETID_DESCRIPTOR.index -> builder.fleetId = deserializeString()
                GAMESERVERBINARYARN_DESCRIPTOR.index -> builder.gameServerBinaryArn = deserializeString()
                PERINSTANCEBINARYARN_DESCRIPTOR.index -> builder.perInstanceBinaryArn = deserializeString()
                ROLLBACKGAMESERVERBINARYARN_DESCRIPTOR.index -> builder.rollbackGameServerBinaryArn = deserializeString()
                ROLLBACKPERINSTANCEBINARYARN_DESCRIPTOR.index -> builder.rollbackPerInstanceBinaryArn = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy