commonMain.aws.sdk.kotlin.services.deadline.serde.BudgetSummaryDocumentDeserializer.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.BudgetStatus
import aws.sdk.kotlin.services.deadline.model.BudgetSummary
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 deserializeBudgetSummaryDocument(deserializer: Deserializer): BudgetSummary {
val builder = BudgetSummary.Builder()
val APPROXIMATEDOLLARLIMIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Float, JsonSerialName("approximateDollarLimit"))
val BUDGETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("budgetId"))
val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
val CREATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("createdBy"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("description"))
val DISPLAYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("displayName"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("status"))
val UPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("updatedAt"))
val UPDATEDBY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("updatedBy"))
val USAGETRACKINGRESOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("usageTrackingResource"))
val USAGES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("usages"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(APPROXIMATEDOLLARLIMIT_DESCRIPTOR)
field(BUDGETID_DESCRIPTOR)
field(CREATEDAT_DESCRIPTOR)
field(CREATEDBY_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(DISPLAYNAME_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(UPDATEDAT_DESCRIPTOR)
field(UPDATEDBY_DESCRIPTOR)
field(USAGETRACKINGRESOURCE_DESCRIPTOR)
field(USAGES_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
APPROXIMATEDOLLARLIMIT_DESCRIPTOR.index -> builder.approximateDollarLimit = deserializeFloat()
BUDGETID_DESCRIPTOR.index -> builder.budgetId = deserializeString()
CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.ISO_8601)
CREATEDBY_DESCRIPTOR.index -> builder.createdBy = deserializeString()
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
DISPLAYNAME_DESCRIPTOR.index -> builder.displayName = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { BudgetStatus.fromValue(it) }
UPDATEDAT_DESCRIPTOR.index -> builder.updatedAt = deserializeInstant(TimestampFormat.ISO_8601)
UPDATEDBY_DESCRIPTOR.index -> builder.updatedBy = deserializeString()
USAGETRACKINGRESOURCE_DESCRIPTOR.index -> builder.usageTrackingResource = deserializeUsageTrackingResourceDocument(deserializer)
USAGES_DESCRIPTOR.index -> builder.usages = deserializeConsumedUsagesDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}