commonMain.aws.sdk.kotlin.services.datazone.serde.SubscribedAssetDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datazone-jvm Show documentation
Show all versions of datazone-jvm Show documentation
The AWS SDK for Kotlin client for DataZone
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.datazone.serde
import aws.sdk.kotlin.services.datazone.model.SubscribedAsset
import aws.sdk.kotlin.services.datazone.model.SubscriptionGrantStatus
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.json.JsonDeserializer
import aws.smithy.kotlin.runtime.serde.json.JsonSerialName
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.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
internal fun deserializeSubscribedAssetDocument(deserializer: Deserializer): SubscribedAsset {
val builder = SubscribedAsset.Builder()
val ASSETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("assetId"))
val ASSETREVISION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("assetRevision"))
val ASSETSCOPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("assetScope"))
val FAILURECAUSE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("failureCause"))
val FAILURETIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("failureTimestamp"))
val GRANTEDTIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("grantedTimestamp"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("status"))
val TARGETNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("targetName"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ASSETID_DESCRIPTOR)
field(ASSETREVISION_DESCRIPTOR)
field(ASSETSCOPE_DESCRIPTOR)
field(FAILURECAUSE_DESCRIPTOR)
field(FAILURETIMESTAMP_DESCRIPTOR)
field(GRANTEDTIMESTAMP_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(TARGETNAME_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ASSETID_DESCRIPTOR.index -> builder.assetId = deserializeString()
ASSETREVISION_DESCRIPTOR.index -> builder.assetRevision = deserializeString()
ASSETSCOPE_DESCRIPTOR.index -> builder.assetScope = deserializeAssetScopeDocument(deserializer)
FAILURECAUSE_DESCRIPTOR.index -> builder.failureCause = deserializeFailureCauseDocument(deserializer)
FAILURETIMESTAMP_DESCRIPTOR.index -> builder.failureTimestamp = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
GRANTEDTIMESTAMP_DESCRIPTOR.index -> builder.grantedTimestamp = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { SubscriptionGrantStatus.fromValue(it) }
TARGETNAME_DESCRIPTOR.index -> builder.targetName = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy