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

commonMain.aws.sdk.kotlin.services.autoscaling.serde.LifecycleHookDocumentDeserializer.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.autoscaling.serde

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

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // LifecycleHookName com.amazonaws.autoscaling#LifecycleHook$LifecycleHookName
            "LifecycleHookName" -> builder.lifecycleHookName = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#AsciiStringMaxLen255`)" }
            // AutoScalingGroupName com.amazonaws.autoscaling#LifecycleHook$AutoScalingGroupName
            "AutoScalingGroupName" -> builder.autoScalingGroupName = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen255`)" }
            // LifecycleTransition com.amazonaws.autoscaling#LifecycleHook$LifecycleTransition
            "LifecycleTransition" -> builder.lifecycleTransition = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#LifecycleTransition`)" }
            // NotificationTargetARN com.amazonaws.autoscaling#LifecycleHook$NotificationTargetARN
            "NotificationTargetARN" -> builder.notificationTargetArn = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#NotificationTargetResourceName`)" }
            // RoleARN com.amazonaws.autoscaling#LifecycleHook$RoleARN
            "RoleARN" -> builder.roleArn = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#XmlStringMaxLen255`)" }
            // NotificationMetadata com.amazonaws.autoscaling#LifecycleHook$NotificationMetadata
            "NotificationMetadata" -> builder.notificationMetadata = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#AnyPrintableAsciiStringMaxLen4000`)" }
            // HeartbeatTimeout com.amazonaws.autoscaling#LifecycleHook$HeartbeatTimeout
            "HeartbeatTimeout" -> builder.heartbeatTimeout = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#HeartbeatTimeout`)" }
            // GlobalTimeout com.amazonaws.autoscaling#LifecycleHook$GlobalTimeout
            "GlobalTimeout" -> builder.globalTimeout = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.autoscaling#GlobalTimeout`)" }
            // DefaultResult com.amazonaws.autoscaling#LifecycleHook$DefaultResult
            "DefaultResult" -> builder.defaultResult = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.autoscaling#LifecycleActionResult`)" }
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy