commonMain.aws.sdk.kotlin.services.applicationinsights.serde.ConfigurationEventDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of applicationinsights-jvm Show documentation
Show all versions of applicationinsights-jvm Show documentation
The AWS SDK for Kotlin client for Application Insights
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.applicationinsights.serde
import aws.sdk.kotlin.services.applicationinsights.model.ConfigurationEvent
import aws.sdk.kotlin.services.applicationinsights.model.ConfigurationEventResourceType
import aws.sdk.kotlin.services.applicationinsights.model.ConfigurationEventStatus
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 deserializeConfigurationEventDocument(deserializer: Deserializer): ConfigurationEvent {
val builder = ConfigurationEvent.Builder()
val ACCOUNTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AccountId"))
val EVENTDETAIL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EventDetail"))
val EVENTRESOURCENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EventResourceName"))
val EVENTRESOURCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("EventResourceType"))
val EVENTSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("EventStatus"))
val EVENTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("EventTime"))
val MONITOREDRESOURCEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MonitoredResourceARN"))
val RESOURCEGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceGroupName"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACCOUNTID_DESCRIPTOR)
field(EVENTDETAIL_DESCRIPTOR)
field(EVENTRESOURCENAME_DESCRIPTOR)
field(EVENTRESOURCETYPE_DESCRIPTOR)
field(EVENTSTATUS_DESCRIPTOR)
field(EVENTTIME_DESCRIPTOR)
field(MONITOREDRESOURCEARN_DESCRIPTOR)
field(RESOURCEGROUPNAME_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ACCOUNTID_DESCRIPTOR.index -> builder.accountId = deserializeString()
EVENTDETAIL_DESCRIPTOR.index -> builder.eventDetail = deserializeString()
EVENTRESOURCENAME_DESCRIPTOR.index -> builder.eventResourceName = deserializeString()
EVENTRESOURCETYPE_DESCRIPTOR.index -> builder.eventResourceType = deserializeString().let { ConfigurationEventResourceType.fromValue(it) }
EVENTSTATUS_DESCRIPTOR.index -> builder.eventStatus = deserializeString().let { ConfigurationEventStatus.fromValue(it) }
EVENTTIME_DESCRIPTOR.index -> builder.eventTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
MONITOREDRESOURCEARN_DESCRIPTOR.index -> builder.monitoredResourceArn = deserializeString()
RESOURCEGROUPNAME_DESCRIPTOR.index -> builder.resourceGroupName = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy