commonMain.aws.sdk.kotlin.services.resiliencehub.serde.DisruptionComplianceDocumentDeserializer.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.ComplianceStatus
import aws.sdk.kotlin.services.resiliencehub.model.DisruptionCompliance
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
internal fun deserializeDisruptionComplianceDocument(deserializer: Deserializer): DisruptionCompliance {
val builder = DisruptionCompliance.Builder()
val ACHIEVABLERPOINSECS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("achievableRpoInSecs"))
val ACHIEVABLERTOINSECS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("achievableRtoInSecs"))
val COMPLIANCESTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("complianceStatus"))
val CURRENTRPOINSECS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("currentRpoInSecs"))
val CURRENTRTOINSECS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("currentRtoInSecs"))
val MESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("message"))
val RPODESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("rpoDescription"))
val RPOREFERENCEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("rpoReferenceId"))
val RTODESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("rtoDescription"))
val RTOREFERENCEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("rtoReferenceId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACHIEVABLERPOINSECS_DESCRIPTOR)
field(ACHIEVABLERTOINSECS_DESCRIPTOR)
field(COMPLIANCESTATUS_DESCRIPTOR)
field(CURRENTRPOINSECS_DESCRIPTOR)
field(CURRENTRTOINSECS_DESCRIPTOR)
field(MESSAGE_DESCRIPTOR)
field(RPODESCRIPTION_DESCRIPTOR)
field(RPOREFERENCEID_DESCRIPTOR)
field(RTODESCRIPTION_DESCRIPTOR)
field(RTOREFERENCEID_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ACHIEVABLERPOINSECS_DESCRIPTOR.index -> builder.achievableRpoInSecs = deserializeInt()
ACHIEVABLERTOINSECS_DESCRIPTOR.index -> builder.achievableRtoInSecs = deserializeInt()
COMPLIANCESTATUS_DESCRIPTOR.index -> builder.complianceStatus = deserializeString().let { ComplianceStatus.fromValue(it) }
CURRENTRPOINSECS_DESCRIPTOR.index -> builder.currentRpoInSecs = deserializeInt()
CURRENTRTOINSECS_DESCRIPTOR.index -> builder.currentRtoInSecs = deserializeInt()
MESSAGE_DESCRIPTOR.index -> builder.message = deserializeString()
RPODESCRIPTION_DESCRIPTOR.index -> builder.rpoDescription = deserializeString()
RPOREFERENCEID_DESCRIPTOR.index -> builder.rpoReferenceId = deserializeString()
RTODESCRIPTION_DESCRIPTOR.index -> builder.rtoDescription = deserializeString()
RTOREFERENCEID_DESCRIPTOR.index -> builder.rtoReferenceId = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}