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

commonMain.aws.sdk.kotlin.services.cloudfront.serde.FunctionAssociationDocumentDeserializer.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.cloudfront.serde

import aws.sdk.kotlin.services.cloudfront.model.EventType
import aws.sdk.kotlin.services.cloudfront.model.FunctionAssociation
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parse
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData

internal fun deserializeFunctionAssociationDocument(reader: XmlTagReader): FunctionAssociation {
    val builder = FunctionAssociation.Builder()

    loop@while (true) {
        val curr = reader.nextTag() ?: break@loop
        when (curr.tagName) {
            // FunctionARN com.amazonaws.cloudfront#FunctionAssociation$FunctionARN
            "FunctionARN" -> builder.functionArn = curr.tryData()
                .getOrDeserializeErr { "expected (string: `com.amazonaws.cloudfront#FunctionARN`)" }
            // EventType com.amazonaws.cloudfront#FunctionAssociation$EventType
            "EventType" -> builder.eventType = curr.tryData()
                .parse { EventType.fromValue(it) }
                .getOrDeserializeErr { "expected (enum: `com.amazonaws.cloudfront#EventType`)" }
            else -> {}
        }
        curr.drop()
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy