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

commonMain.aws.sdk.kotlin.services.cloudsearch.serde.OptionStatusDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudsearch.serde

import aws.sdk.kotlin.services.cloudsearch.model.OptionState
import aws.sdk.kotlin.services.cloudsearch.model.OptionStatus
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parse
import aws.smithy.kotlin.runtime.serde.parseBoolean
import aws.smithy.kotlin.runtime.serde.parseInt
import aws.smithy.kotlin.runtime.serde.parseTimestamp
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData
import aws.smithy.kotlin.runtime.time.TimestampFormat

internal fun deserializeOptionStatusDocument(reader: XmlTagReader): OptionStatus {
    val builder = OptionStatus.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // CreationDate com.amazonaws.cloudsearch#OptionStatus$CreationDate
            "CreationDate" -> builder.creationDate = curr.tryData()
                .parseTimestamp(TimestampFormat.ISO_8601)
                .getOrDeserializeErr { "expected (timestamp: `com.amazonaws.cloudsearch#UpdateTimestamp`)" }
            // UpdateDate com.amazonaws.cloudsearch#OptionStatus$UpdateDate
            "UpdateDate" -> builder.updateDate = curr.tryData()
                .parseTimestamp(TimestampFormat.ISO_8601)
                .getOrDeserializeErr { "expected (timestamp: `com.amazonaws.cloudsearch#UpdateTimestamp`)" }
            // UpdateVersion com.amazonaws.cloudsearch#OptionStatus$UpdateVersion
            "UpdateVersion" -> builder.updateVersion = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.cloudsearch#UIntValue`)" }
            // State com.amazonaws.cloudsearch#OptionStatus$State
            "State" -> builder.state = curr.tryData()
                .parse { OptionState.fromValue(it) }
                .getOrDeserializeErr { "expected (enum: `com.amazonaws.cloudsearch#OptionState`)" }
            // PendingDeletion com.amazonaws.cloudsearch#OptionStatus$PendingDeletion
            "PendingDeletion" -> builder.pendingDeletion = curr.tryData()
                .parseBoolean()
                .getOrDeserializeErr { "expected (boolean: `com.amazonaws.cloudsearch#Boolean`)" }
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy