commonMain.aws.sdk.kotlin.services.resiliencehub.serde.AppAssessmentSummaryDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resiliencehub-jvm Show documentation
Show all versions of resiliencehub-jvm Show documentation
The AWS SDK for Kotlin client for resiliencehub
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.resiliencehub.serde
import aws.sdk.kotlin.services.resiliencehub.model.AppAssessmentSummary
import aws.sdk.kotlin.services.resiliencehub.model.AssessmentInvoker
import aws.sdk.kotlin.services.resiliencehub.model.AssessmentStatus
import aws.sdk.kotlin.services.resiliencehub.model.ComplianceStatus
import aws.sdk.kotlin.services.resiliencehub.model.DriftStatus
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 deserializeAppAssessmentSummaryDocument(deserializer: Deserializer): AppAssessmentSummary {
val builder = AppAssessmentSummary.Builder()
val APPARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("appArn"))
val APPVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("appVersion"))
val ASSESSMENTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("assessmentArn"))
val ASSESSMENTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("assessmentName"))
val ASSESSMENTSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("assessmentStatus"))
val COMPLIANCESTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("complianceStatus"))
val COST_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("cost"))
val DRIFTSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("driftStatus"))
val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("endTime"))
val INVOKER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("invoker"))
val MESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("message"))
val RESILIENCYSCORE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("resiliencyScore"))
val STARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("startTime"))
val VERSIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("versionName"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(APPARN_DESCRIPTOR)
field(APPVERSION_DESCRIPTOR)
field(ASSESSMENTARN_DESCRIPTOR)
field(ASSESSMENTNAME_DESCRIPTOR)
field(ASSESSMENTSTATUS_DESCRIPTOR)
field(COMPLIANCESTATUS_DESCRIPTOR)
field(COST_DESCRIPTOR)
field(DRIFTSTATUS_DESCRIPTOR)
field(ENDTIME_DESCRIPTOR)
field(INVOKER_DESCRIPTOR)
field(MESSAGE_DESCRIPTOR)
field(RESILIENCYSCORE_DESCRIPTOR)
field(STARTTIME_DESCRIPTOR)
field(VERSIONNAME_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
APPARN_DESCRIPTOR.index -> builder.appArn = deserializeString()
APPVERSION_DESCRIPTOR.index -> builder.appVersion = deserializeString()
ASSESSMENTARN_DESCRIPTOR.index -> builder.assessmentArn = deserializeString()
ASSESSMENTNAME_DESCRIPTOR.index -> builder.assessmentName = deserializeString()
ASSESSMENTSTATUS_DESCRIPTOR.index -> builder.assessmentStatus = deserializeString().let { AssessmentStatus.fromValue(it) }
COMPLIANCESTATUS_DESCRIPTOR.index -> builder.complianceStatus = deserializeString().let { ComplianceStatus.fromValue(it) }
COST_DESCRIPTOR.index -> builder.cost = deserializeCostDocument(deserializer)
DRIFTSTATUS_DESCRIPTOR.index -> builder.driftStatus = deserializeString().let { DriftStatus.fromValue(it) }
ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeString().let { Instant.fromEpochSeconds(it) }
INVOKER_DESCRIPTOR.index -> builder.invoker = deserializeString().let { AssessmentInvoker.fromValue(it) }
MESSAGE_DESCRIPTOR.index -> builder.message = deserializeString()
RESILIENCYSCORE_DESCRIPTOR.index -> builder.resiliencyScore = deserializeDouble()
STARTTIME_DESCRIPTOR.index -> builder.startTime = deserializeString().let { Instant.fromEpochSeconds(it) }
VERSIONNAME_DESCRIPTOR.index -> builder.versionName = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}