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

commonMain.aws.sdk.kotlin.services.outposts.serde.CapacityTaskSummaryDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.outposts.serde

import aws.sdk.kotlin.services.outposts.model.CapacityTaskStatus
import aws.sdk.kotlin.services.outposts.model.CapacityTaskSummary
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

internal fun deserializeCapacityTaskSummaryDocument(deserializer: Deserializer): CapacityTaskSummary {
    val builder = CapacityTaskSummary.Builder()
    val CAPACITYTASKID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CapacityTaskId"))
    val CAPACITYTASKSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("CapacityTaskStatus"))
    val COMPLETIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CompletionDate"))
    val CREATIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationDate"))
    val LASTMODIFIEDDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastModifiedDate"))
    val ORDERID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OrderId"))
    val OUTPOSTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OutpostId"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CAPACITYTASKID_DESCRIPTOR)
        field(CAPACITYTASKSTATUS_DESCRIPTOR)
        field(COMPLETIONDATE_DESCRIPTOR)
        field(CREATIONDATE_DESCRIPTOR)
        field(LASTMODIFIEDDATE_DESCRIPTOR)
        field(ORDERID_DESCRIPTOR)
        field(OUTPOSTID_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CAPACITYTASKID_DESCRIPTOR.index -> builder.capacityTaskId = deserializeString()
                CAPACITYTASKSTATUS_DESCRIPTOR.index -> builder.capacityTaskStatus = deserializeString().let { CapacityTaskStatus.fromValue(it) }
                COMPLETIONDATE_DESCRIPTOR.index -> builder.completionDate = deserializeString().let { Instant.fromEpochSeconds(it) }
                CREATIONDATE_DESCRIPTOR.index -> builder.creationDate = deserializeString().let { Instant.fromEpochSeconds(it) }
                LASTMODIFIEDDATE_DESCRIPTOR.index -> builder.lastModifiedDate = deserializeString().let { Instant.fromEpochSeconds(it) }
                ORDERID_DESCRIPTOR.index -> builder.orderId = deserializeString()
                OUTPOSTID_DESCRIPTOR.index -> builder.outpostId = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy