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

commonMain.aws.sdk.kotlin.services.redshift.serde.ReservedNodeOfferingDocumentDeserializer.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.ReservedNodeOffering
import aws.sdk.kotlin.services.redshift.model.ReservedNodeOfferingType
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parse
import aws.smithy.kotlin.runtime.serde.parseDouble
import aws.smithy.kotlin.runtime.serde.parseInt
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData

internal fun deserializeReservedNodeOfferingDocument(reader: XmlTagReader): ReservedNodeOffering {
    val builder = ReservedNodeOffering.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // ReservedNodeOfferingId com.amazonaws.redshift#ReservedNodeOffering$ReservedNodeOfferingId
            "ReservedNodeOfferingId" -> builder.reservedNodeOfferingId = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.redshift#String`)" }
            // NodeType com.amazonaws.redshift#ReservedNodeOffering$NodeType
            "NodeType" -> builder.nodeType = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.redshift#String`)" }
            // Duration com.amazonaws.redshift#ReservedNodeOffering$Duration
            "Duration" -> builder.duration = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.redshift#Integer`)" }
            // FixedPrice com.amazonaws.redshift#ReservedNodeOffering$FixedPrice
            "FixedPrice" -> builder.fixedPrice = curr.tryData()
                .parseDouble()
                .getOrDeserializeErr { "expected (double: `com.amazonaws.redshift#Double`)" }
            // UsagePrice com.amazonaws.redshift#ReservedNodeOffering$UsagePrice
            "UsagePrice" -> builder.usagePrice = curr.tryData()
                .parseDouble()
                .getOrDeserializeErr { "expected (double: `com.amazonaws.redshift#Double`)" }
            // CurrencyCode com.amazonaws.redshift#ReservedNodeOffering$CurrencyCode
            "CurrencyCode" -> builder.currencyCode = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.redshift#String`)" }
            // OfferingType com.amazonaws.redshift#ReservedNodeOffering$OfferingType
            "OfferingType" -> builder.offeringType = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.redshift#String`)" }
            // RecurringCharges com.amazonaws.redshift#ReservedNodeOffering$RecurringCharges
            "RecurringCharges" -> builder.recurringCharges = deserializeRecurringChargeListShape(curr)
            // ReservedNodeOfferingType com.amazonaws.redshift#ReservedNodeOffering$ReservedNodeOfferingType
            "ReservedNodeOfferingType" -> builder.reservedNodeOfferingType = curr.tryData()
                .parse { ReservedNodeOfferingType.fromValue(it) }
                .getOrDeserializeErr { "expected (enum: `com.amazonaws.redshift#ReservedNodeOfferingType`)" }
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy