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

commonMain.aws.sdk.kotlin.services.resiliencehub.serde.AppSummaryDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.resiliencehub.serde

import aws.sdk.kotlin.services.resiliencehub.model.AppAssessmentScheduleType
import aws.sdk.kotlin.services.resiliencehub.model.AppComplianceStatusType
import aws.sdk.kotlin.services.resiliencehub.model.AppDriftStatusType
import aws.sdk.kotlin.services.resiliencehub.model.AppStatusType
import aws.sdk.kotlin.services.resiliencehub.model.AppSummary
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 deserializeAppSummaryDocument(deserializer: Deserializer): AppSummary {
    val builder = AppSummary.Builder()
    val APPARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("appArn"))
    val ASSESSMENTSCHEDULE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("assessmentSchedule"))
    val COMPLIANCESTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("complianceStatus"))
    val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("creationTime"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("description"))
    val DRIFTSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("driftStatus"))
    val LASTAPPCOMPLIANCEEVALUATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastAppComplianceEvaluationTime"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    val RESILIENCYSCORE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("resiliencyScore"))
    val RPOINSECS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("rpoInSecs"))
    val RTOINSECS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("rtoInSecs"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(APPARN_DESCRIPTOR)
        field(ASSESSMENTSCHEDULE_DESCRIPTOR)
        field(COMPLIANCESTATUS_DESCRIPTOR)
        field(CREATIONTIME_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(DRIFTSTATUS_DESCRIPTOR)
        field(LASTAPPCOMPLIANCEEVALUATIONTIME_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(RESILIENCYSCORE_DESCRIPTOR)
        field(RPOINSECS_DESCRIPTOR)
        field(RTOINSECS_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                APPARN_DESCRIPTOR.index -> builder.appArn = deserializeString()
                ASSESSMENTSCHEDULE_DESCRIPTOR.index -> builder.assessmentSchedule = deserializeString().let { AppAssessmentScheduleType.fromValue(it) }
                COMPLIANCESTATUS_DESCRIPTOR.index -> builder.complianceStatus = deserializeString().let { AppComplianceStatusType.fromValue(it) }
                CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                DRIFTSTATUS_DESCRIPTOR.index -> builder.driftStatus = deserializeString().let { AppDriftStatusType.fromValue(it) }
                LASTAPPCOMPLIANCEEVALUATIONTIME_DESCRIPTOR.index -> builder.lastAppComplianceEvaluationTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                RESILIENCYSCORE_DESCRIPTOR.index -> builder.resiliencyScore = deserializeDouble()
                RPOINSECS_DESCRIPTOR.index -> builder.rpoInSecs = deserializeInt()
                RTOINSECS_DESCRIPTOR.index -> builder.rtoInSecs = deserializeInt()
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { AppStatusType.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy