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

commonMain.aws.sdk.kotlin.services.backup.serde.ReportJobDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.backup.serde

import aws.sdk.kotlin.services.backup.model.ReportJob
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 deserializeReportJobDocument(deserializer: Deserializer): ReportJob {
    val builder = ReportJob.Builder()
    val COMPLETIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CompletionTime"))
    val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTime"))
    val REPORTDESTINATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ReportDestination"))
    val REPORTJOBID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReportJobId"))
    val REPORTPLANARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReportPlanArn"))
    val REPORTTEMPLATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReportTemplate"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Status"))
    val STATUSMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StatusMessage"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(COMPLETIONTIME_DESCRIPTOR)
        field(CREATIONTIME_DESCRIPTOR)
        field(REPORTDESTINATION_DESCRIPTOR)
        field(REPORTJOBID_DESCRIPTOR)
        field(REPORTPLANARN_DESCRIPTOR)
        field(REPORTTEMPLATE_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(STATUSMESSAGE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                COMPLETIONTIME_DESCRIPTOR.index -> builder.completionTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                REPORTDESTINATION_DESCRIPTOR.index -> builder.reportDestination = deserializeReportDestinationDocument(deserializer)
                REPORTJOBID_DESCRIPTOR.index -> builder.reportJobId = deserializeString()
                REPORTPLANARN_DESCRIPTOR.index -> builder.reportPlanArn = deserializeString()
                REPORTTEMPLATE_DESCRIPTOR.index -> builder.reportTemplate = deserializeString()
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString()
                STATUSMESSAGE_DESCRIPTOR.index -> builder.statusMessage = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy