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

commonMain.aws.sdk.kotlin.services.route53.serde.TrafficPolicyInstanceDocumentDeserializer.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.route53.serde

import aws.sdk.kotlin.services.route53.model.RrType
import aws.sdk.kotlin.services.route53.model.TrafficPolicyInstance
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.parseLong
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData

internal fun deserializeTrafficPolicyInstanceDocument(reader: XmlTagReader): TrafficPolicyInstance {
    val builder = TrafficPolicyInstance.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // Id com.amazonaws.route53#TrafficPolicyInstance$Id
            "Id" -> builder.id = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.route53#TrafficPolicyInstanceId`)" }
            // HostedZoneId com.amazonaws.route53#TrafficPolicyInstance$HostedZoneId
            "HostedZoneId" -> builder.hostedZoneId = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.route53#ResourceId`)" }
            // Name com.amazonaws.route53#TrafficPolicyInstance$Name
            "Name" -> builder.name = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.route53#DNSName`)" }
            // TTL com.amazonaws.route53#TrafficPolicyInstance$TTL
            "TTL" -> builder.ttl = curr.tryData()
                .parseLong()
                .getOrDeserializeErr { "expected (long: `com.amazonaws.route53#TTL`)" }
            // State com.amazonaws.route53#TrafficPolicyInstance$State
            "State" -> builder.state = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.route53#TrafficPolicyInstanceState`)" }
            // Message com.amazonaws.route53#TrafficPolicyInstance$Message
            "Message" -> builder.message = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.route53#Message`)" }
            // TrafficPolicyId com.amazonaws.route53#TrafficPolicyInstance$TrafficPolicyId
            "TrafficPolicyId" -> builder.trafficPolicyId = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.route53#TrafficPolicyId`)" }
            // TrafficPolicyVersion com.amazonaws.route53#TrafficPolicyInstance$TrafficPolicyVersion
            "TrafficPolicyVersion" -> builder.trafficPolicyVersion = curr.tryData()
                .parseInt()
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.route53#TrafficPolicyVersion`)" }
            // TrafficPolicyType com.amazonaws.route53#TrafficPolicyInstance$TrafficPolicyType
            "TrafficPolicyType" -> builder.trafficPolicyType = curr.tryData()
                .parse { RrType.fromValue(it) }
                .getOrDeserializeErr { "expected (enum: `com.amazonaws.route53#RRType`)" }
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy