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

commonMain.aws.sdk.kotlin.services.redshift.serde.ReservedNodeExchangeStatusDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.redshift.serde

import aws.sdk.kotlin.services.redshift.model.ReservedNodeExchangeStatus
import aws.sdk.kotlin.services.redshift.model.ReservedNodeExchangeStatusType
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parse
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 deserializeReservedNodeExchangeStatusDocument(reader: XmlTagReader): ReservedNodeExchangeStatus {
    val builder = ReservedNodeExchangeStatus.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // ReservedNodeExchangeRequestId com.amazonaws.redshift#ReservedNodeExchangeStatus$ReservedNodeExchangeRequestId
            "ReservedNodeExchangeRequestId" -> builder.reservedNodeExchangeRequestId = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.redshift#String`)" }
            // Status com.amazonaws.redshift#ReservedNodeExchangeStatus$Status
            "Status" -> builder.status = curr.tryData()
                .parse { ReservedNodeExchangeStatusType.fromValue(it) }
                .getOrDeserializeErr { "expected (enum: `com.amazonaws.redshift#ReservedNodeExchangeStatusType`)" }
            // RequestTime com.amazonaws.redshift#ReservedNodeExchangeStatus$RequestTime
            "RequestTime" -> builder.requestTime = curr.tryData()
                .parseTimestamp(TimestampFormat.ISO_8601)
                .getOrDeserializeErr { "expected (timestamp: `com.amazonaws.redshift#TStamp`)" }
            // SourceReservedNodeId com.amazonaws.redshift#ReservedNodeExchangeStatus$SourceReservedNodeId
            "SourceReservedNodeId" -> builder.sourceReservedNodeId = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.redshift#String`)" }
            // SourceReservedNodeType com.amazonaws.redshift#ReservedNodeExchangeStatus$SourceReservedNodeType
            "SourceReservedNodeType" -> builder.sourceReservedNodeType = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.redshift#String`)" }
            // SourceReservedNodeCount com.amazonaws.redshift#ReservedNodeExchangeStatus$SourceReservedNodeCount
            "SourceReservedNodeCount" -> builder.sourceReservedNodeCount = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.redshift#Integer`)" }
            // TargetReservedNodeOfferingId com.amazonaws.redshift#ReservedNodeExchangeStatus$TargetReservedNodeOfferingId
            "TargetReservedNodeOfferingId" -> builder.targetReservedNodeOfferingId = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.redshift#String`)" }
            // TargetReservedNodeType com.amazonaws.redshift#ReservedNodeExchangeStatus$TargetReservedNodeType
            "TargetReservedNodeType" -> builder.targetReservedNodeType = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.redshift#String`)" }
            // TargetReservedNodeCount com.amazonaws.redshift#ReservedNodeExchangeStatus$TargetReservedNodeCount
            "TargetReservedNodeCount" -> builder.targetReservedNodeCount = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.redshift#Integer`)" }
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy