commonMain.aws.sdk.kotlin.services.deadline.serde.FleetSummaryDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deadline-jvm Show documentation
Show all versions of deadline-jvm Show documentation
The AWS SDK for Kotlin client for deadline
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.deadline.serde
import aws.sdk.kotlin.services.deadline.model.AutoScalingStatus
import aws.sdk.kotlin.services.deadline.model.FleetStatus
import aws.sdk.kotlin.services.deadline.model.FleetSummary
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 deserializeFleetSummaryDocument(deserializer: Deserializer): FleetSummary {
val builder = FleetSummary.Builder()
val AUTOSCALINGSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("autoScalingStatus"))
val CONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("configuration"))
val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
val CREATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("createdBy"))
val DISPLAYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("displayName"))
val FARMID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("farmId"))
val FLEETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("fleetId"))
val MAXWORKERCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("maxWorkerCount"))
val MINWORKERCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("minWorkerCount"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("status"))
val TARGETWORKERCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("targetWorkerCount"))
val UPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("updatedAt"))
val UPDATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("updatedBy"))
val WORKERCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("workerCount"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(AUTOSCALINGSTATUS_DESCRIPTOR)
field(CONFIGURATION_DESCRIPTOR)
field(CREATEDAT_DESCRIPTOR)
field(CREATEDBY_DESCRIPTOR)
field(DISPLAYNAME_DESCRIPTOR)
field(FARMID_DESCRIPTOR)
field(FLEETID_DESCRIPTOR)
field(MAXWORKERCOUNT_DESCRIPTOR)
field(MINWORKERCOUNT_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(TARGETWORKERCOUNT_DESCRIPTOR)
field(UPDATEDAT_DESCRIPTOR)
field(UPDATEDBY_DESCRIPTOR)
field(WORKERCOUNT_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
AUTOSCALINGSTATUS_DESCRIPTOR.index -> builder.autoScalingStatus = deserializeString().let { AutoScalingStatus.fromValue(it) }
CONFIGURATION_DESCRIPTOR.index -> builder.configuration = deserializeFleetConfigurationDocument(deserializer)
CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.ISO_8601)
CREATEDBY_DESCRIPTOR.index -> builder.createdBy = deserializeString()
DISPLAYNAME_DESCRIPTOR.index -> builder.displayName = deserializeString()
FARMID_DESCRIPTOR.index -> builder.farmId = deserializeString()
FLEETID_DESCRIPTOR.index -> builder.fleetId = deserializeString()
MAXWORKERCOUNT_DESCRIPTOR.index -> builder.maxWorkerCount = deserializeInt()
MINWORKERCOUNT_DESCRIPTOR.index -> builder.minWorkerCount = deserializeInt()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { FleetStatus.fromValue(it) }
TARGETWORKERCOUNT_DESCRIPTOR.index -> builder.targetWorkerCount = deserializeInt()
UPDATEDAT_DESCRIPTOR.index -> builder.updatedAt = deserializeInstant(TimestampFormat.ISO_8601)
UPDATEDBY_DESCRIPTOR.index -> builder.updatedBy = deserializeString()
WORKERCOUNT_DESCRIPTOR.index -> builder.workerCount = deserializeInt()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}