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

commonMain.aws.sdk.kotlin.services.resiliencehub.serde.AppDocumentDeserializer.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.App
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.EventSubscription
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 kotlin.collections.mutableListOf
import kotlin.collections.mutableMapOf

internal fun deserializeAppDocument(deserializer: Deserializer): App {
    val builder = App.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 EVENTSUBSCRIPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("eventSubscriptions"))
    val LASTAPPCOMPLIANCEEVALUATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastAppComplianceEvaluationTime"))
    val LASTDRIFTEVALUATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastDriftEvaluationTime"))
    val LASTRESILIENCYSCOREEVALUATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastResiliencyScoreEvaluationTime"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    val PERMISSIONMODEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("permissionModel"))
    val POLICYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("policyArn"))
    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 TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("tags"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(APPARN_DESCRIPTOR)
        field(ASSESSMENTSCHEDULE_DESCRIPTOR)
        field(COMPLIANCESTATUS_DESCRIPTOR)
        field(CREATIONTIME_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(DRIFTSTATUS_DESCRIPTOR)
        field(EVENTSUBSCRIPTIONS_DESCRIPTOR)
        field(LASTAPPCOMPLIANCEEVALUATIONTIME_DESCRIPTOR)
        field(LASTDRIFTEVALUATIONTIME_DESCRIPTOR)
        field(LASTRESILIENCYSCOREEVALUATIONTIME_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(PERMISSIONMODEL_DESCRIPTOR)
        field(POLICYARN_DESCRIPTOR)
        field(RESILIENCYSCORE_DESCRIPTOR)
        field(RPOINSECS_DESCRIPTOR)
        field(RTOINSECS_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(TAGS_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) }
                EVENTSUBSCRIPTIONS_DESCRIPTOR.index -> builder.eventSubscriptions =
                    deserializer.deserializeList(EVENTSUBSCRIPTIONS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeEventSubscriptionDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                LASTAPPCOMPLIANCEEVALUATIONTIME_DESCRIPTOR.index -> builder.lastAppComplianceEvaluationTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                LASTDRIFTEVALUATIONTIME_DESCRIPTOR.index -> builder.lastDriftEvaluationTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                LASTRESILIENCYSCOREEVALUATIONTIME_DESCRIPTOR.index -> builder.lastResiliencyScoreEvaluationTime = deserializeString().let { Instant.fromEpochSeconds(it) }
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                PERMISSIONMODEL_DESCRIPTOR.index -> builder.permissionModel = deserializePermissionModelDocument(deserializer)
                POLICYARN_DESCRIPTOR.index -> builder.policyArn = 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) }
                TAGS_DESCRIPTOR.index -> builder.tags =
                    deserializer.deserializeMap(TAGS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy