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

commonMain.aws.sdk.kotlin.services.autoscaling.serde.EbsDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.autoscaling.serde

import aws.sdk.kotlin.services.autoscaling.model.Ebs
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parseBoolean
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 deserializeEbsDocument(reader: XmlTagReader): Ebs {
    val builder = Ebs.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // SnapshotId com.amazonaws.autoscaling#Ebs$SnapshotId
            "SnapshotId" -> builder.snapshotId = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen255`)" }
            // VolumeSize com.amazonaws.autoscaling#Ebs$VolumeSize
            "VolumeSize" -> builder.volumeSize = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#BlockDeviceEbsVolumeSize`)" }
            // VolumeType com.amazonaws.autoscaling#Ebs$VolumeType
            "VolumeType" -> builder.volumeType = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#BlockDeviceEbsVolumeType`)" }
            // DeleteOnTermination com.amazonaws.autoscaling#Ebs$DeleteOnTermination
            "DeleteOnTermination" -> builder.deleteOnTermination = curr.tryData()
                .parseBoolean()
                .getOrDeserializeErr { "expected (boolean: `com.amazonaws.autoscaling#BlockDeviceEbsDeleteOnTermination`)" }
            // Iops com.amazonaws.autoscaling#Ebs$Iops
            "Iops" -> builder.iops = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#BlockDeviceEbsIops`)" }
            // Encrypted com.amazonaws.autoscaling#Ebs$Encrypted
            "Encrypted" -> builder.encrypted = curr.tryData()
                .parseBoolean()
                .getOrDeserializeErr { "expected (boolean: `com.amazonaws.autoscaling#BlockDeviceEbsEncrypted`)" }
            // Throughput com.amazonaws.autoscaling#Ebs$Throughput
            "Throughput" -> builder.throughput = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#BlockDeviceEbsThroughput`)" }
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy