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

commonMain.aws.sdk.kotlin.services.iam.serde.TrackedActionLastAccessedDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iam.serde

import aws.sdk.kotlin.services.iam.model.TrackedActionLastAccessed
import aws.smithy.kotlin.runtime.serde.Deserializer
import aws.smithy.kotlin.runtime.serde.SdkFieldDescriptor
import aws.smithy.kotlin.runtime.serde.SdkObjectDescriptor
import aws.smithy.kotlin.runtime.serde.SerialKind
import aws.smithy.kotlin.runtime.serde.asSdkSerializable
import aws.smithy.kotlin.runtime.serde.deserializeList
import aws.smithy.kotlin.runtime.serde.deserializeMap
import aws.smithy.kotlin.runtime.serde.deserializeStruct
import aws.smithy.kotlin.runtime.serde.field
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import aws.smithy.kotlin.runtime.serde.xml.XmlDeserializer
import aws.smithy.kotlin.runtime.serde.xml.XmlNamespace
import aws.smithy.kotlin.runtime.serde.xml.XmlSerialName
import aws.smithy.kotlin.runtime.time.Instant

internal fun deserializeTrackedActionLastAccessedDocument(deserializer: Deserializer): TrackedActionLastAccessed {
    val builder = TrackedActionLastAccessed.Builder()
    val ACTIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("ActionName"))
    val LASTACCESSEDENTITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("LastAccessedEntity"))
    val LASTACCESSEDREGION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("LastAccessedRegion"))
    val LASTACCESSEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, XmlSerialName("LastAccessedTime"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        trait(XmlSerialName("TrackedActionLastAccessed"))
        trait(XmlNamespace("https://iam.amazonaws.com/doc/2010-05-08/"))
        field(ACTIONNAME_DESCRIPTOR)
        field(LASTACCESSEDENTITY_DESCRIPTOR)
        field(LASTACCESSEDREGION_DESCRIPTOR)
        field(LASTACCESSEDTIME_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACTIONNAME_DESCRIPTOR.index -> builder.actionName = deserializeString()
                LASTACCESSEDENTITY_DESCRIPTOR.index -> builder.lastAccessedEntity = deserializeString()
                LASTACCESSEDREGION_DESCRIPTOR.index -> builder.lastAccessedRegion = deserializeString()
                LASTACCESSEDTIME_DESCRIPTOR.index -> builder.lastAccessedTime = deserializeString().let { Instant.fromIso8601(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy