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

commonMain.aws.sdk.kotlin.services.applicationinsights.serde.ObservationDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.78
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.applicationinsights.serde

import aws.sdk.kotlin.services.applicationinsights.model.CloudWatchEventSource
import aws.sdk.kotlin.services.applicationinsights.model.LogFilter
import aws.sdk.kotlin.services.applicationinsights.model.Observation
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 deserializeObservationDocument(deserializer: Deserializer): Observation {
    val builder = Observation.Builder()
    val CLOUDWATCHEVENTDETAILTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CloudWatchEventDetailType"))
    val CLOUDWATCHEVENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CloudWatchEventId"))
    val CLOUDWATCHEVENTSOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("CloudWatchEventSource"))
    val CODEDEPLOYAPPLICATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CodeDeployApplication"))
    val CODEDEPLOYDEPLOYMENTGROUP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CodeDeployDeploymentGroup"))
    val CODEDEPLOYDEPLOYMENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CodeDeployDeploymentId"))
    val CODEDEPLOYINSTANCEGROUPID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CodeDeployInstanceGroupId"))
    val CODEDEPLOYSTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CodeDeployState"))
    val EBSCAUSE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EbsCause"))
    val EBSEVENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EbsEvent"))
    val EBSREQUESTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EbsRequestId"))
    val EBSRESULT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EbsResult"))
    val EC2STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Ec2State"))
    val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("EndTime"))
    val HEALTHEVENTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("HealthEventArn"))
    val HEALTHEVENTDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("HealthEventDescription"))
    val HEALTHEVENTTYPECATEGORY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("HealthEventTypeCategory"))
    val HEALTHEVENTTYPECODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("HealthEventTypeCode"))
    val HEALTHSERVICE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("HealthService"))
    val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Id"))
    val LINETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LineTime"))
    val LOGFILTER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("LogFilter"))
    val LOGGROUP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LogGroup"))
    val LOGTEXT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LogText"))
    val METRICNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MetricName"))
    val METRICNAMESPACE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MetricNamespace"))
    val RDSEVENTCATEGORIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RdsEventCategories"))
    val RDSEVENTMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RdsEventMessage"))
    val S3EVENTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("S3EventName"))
    val SOURCEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SourceARN"))
    val SOURCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SourceType"))
    val STARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("StartTime"))
    val STATESARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StatesArn"))
    val STATESEXECUTIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StatesExecutionArn"))
    val STATESINPUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StatesInput"))
    val STATESSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StatesStatus"))
    val UNIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Unit"))
    val VALUE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("Value"))
    val XRAYERRORPERCENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("XRayErrorPercent"))
    val XRAYFAULTPERCENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("XRayFaultPercent"))
    val XRAYNODENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("XRayNodeName"))
    val XRAYNODETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("XRayNodeType"))
    val XRAYREQUESTAVERAGELATENCY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("XRayRequestAverageLatency"))
    val XRAYREQUESTCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("XRayRequestCount"))
    val XRAYTHROTTLEPERCENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("XRayThrottlePercent"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CLOUDWATCHEVENTDETAILTYPE_DESCRIPTOR)
        field(CLOUDWATCHEVENTID_DESCRIPTOR)
        field(CLOUDWATCHEVENTSOURCE_DESCRIPTOR)
        field(CODEDEPLOYAPPLICATION_DESCRIPTOR)
        field(CODEDEPLOYDEPLOYMENTGROUP_DESCRIPTOR)
        field(CODEDEPLOYDEPLOYMENTID_DESCRIPTOR)
        field(CODEDEPLOYINSTANCEGROUPID_DESCRIPTOR)
        field(CODEDEPLOYSTATE_DESCRIPTOR)
        field(EBSCAUSE_DESCRIPTOR)
        field(EBSEVENT_DESCRIPTOR)
        field(EBSREQUESTID_DESCRIPTOR)
        field(EBSRESULT_DESCRIPTOR)
        field(EC2STATE_DESCRIPTOR)
        field(ENDTIME_DESCRIPTOR)
        field(HEALTHEVENTARN_DESCRIPTOR)
        field(HEALTHEVENTDESCRIPTION_DESCRIPTOR)
        field(HEALTHEVENTTYPECATEGORY_DESCRIPTOR)
        field(HEALTHEVENTTYPECODE_DESCRIPTOR)
        field(HEALTHSERVICE_DESCRIPTOR)
        field(ID_DESCRIPTOR)
        field(LINETIME_DESCRIPTOR)
        field(LOGFILTER_DESCRIPTOR)
        field(LOGGROUP_DESCRIPTOR)
        field(LOGTEXT_DESCRIPTOR)
        field(METRICNAME_DESCRIPTOR)
        field(METRICNAMESPACE_DESCRIPTOR)
        field(RDSEVENTCATEGORIES_DESCRIPTOR)
        field(RDSEVENTMESSAGE_DESCRIPTOR)
        field(S3EVENTNAME_DESCRIPTOR)
        field(SOURCEARN_DESCRIPTOR)
        field(SOURCETYPE_DESCRIPTOR)
        field(STARTTIME_DESCRIPTOR)
        field(STATESARN_DESCRIPTOR)
        field(STATESEXECUTIONARN_DESCRIPTOR)
        field(STATESINPUT_DESCRIPTOR)
        field(STATESSTATUS_DESCRIPTOR)
        field(UNIT_DESCRIPTOR)
        field(VALUE_DESCRIPTOR)
        field(XRAYERRORPERCENT_DESCRIPTOR)
        field(XRAYFAULTPERCENT_DESCRIPTOR)
        field(XRAYNODENAME_DESCRIPTOR)
        field(XRAYNODETYPE_DESCRIPTOR)
        field(XRAYREQUESTAVERAGELATENCY_DESCRIPTOR)
        field(XRAYREQUESTCOUNT_DESCRIPTOR)
        field(XRAYTHROTTLEPERCENT_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CLOUDWATCHEVENTDETAILTYPE_DESCRIPTOR.index -> builder.cloudWatchEventDetailType = deserializeString()
                CLOUDWATCHEVENTID_DESCRIPTOR.index -> builder.cloudWatchEventId = deserializeString()
                CLOUDWATCHEVENTSOURCE_DESCRIPTOR.index -> builder.cloudWatchEventSource = deserializeString().let { CloudWatchEventSource.fromValue(it) }
                CODEDEPLOYAPPLICATION_DESCRIPTOR.index -> builder.codeDeployApplication = deserializeString()
                CODEDEPLOYDEPLOYMENTGROUP_DESCRIPTOR.index -> builder.codeDeployDeploymentGroup = deserializeString()
                CODEDEPLOYDEPLOYMENTID_DESCRIPTOR.index -> builder.codeDeployDeploymentId = deserializeString()
                CODEDEPLOYINSTANCEGROUPID_DESCRIPTOR.index -> builder.codeDeployInstanceGroupId = deserializeString()
                CODEDEPLOYSTATE_DESCRIPTOR.index -> builder.codeDeployState = deserializeString()
                EBSCAUSE_DESCRIPTOR.index -> builder.ebsCause = deserializeString()
                EBSEVENT_DESCRIPTOR.index -> builder.ebsEvent = deserializeString()
                EBSREQUESTID_DESCRIPTOR.index -> builder.ebsRequestId = deserializeString()
                EBSRESULT_DESCRIPTOR.index -> builder.ebsResult = deserializeString()
                EC2STATE_DESCRIPTOR.index -> builder.ec2State = deserializeString()
                ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                HEALTHEVENTARN_DESCRIPTOR.index -> builder.healthEventArn = deserializeString()
                HEALTHEVENTDESCRIPTION_DESCRIPTOR.index -> builder.healthEventDescription = deserializeString()
                HEALTHEVENTTYPECATEGORY_DESCRIPTOR.index -> builder.healthEventTypeCategory = deserializeString()
                HEALTHEVENTTYPECODE_DESCRIPTOR.index -> builder.healthEventTypeCode = deserializeString()
                HEALTHSERVICE_DESCRIPTOR.index -> builder.healthService = deserializeString()
                ID_DESCRIPTOR.index -> builder.id = deserializeString()
                LINETIME_DESCRIPTOR.index -> builder.lineTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                LOGFILTER_DESCRIPTOR.index -> builder.logFilter = deserializeString().let { LogFilter.fromValue(it) }
                LOGGROUP_DESCRIPTOR.index -> builder.logGroup = deserializeString()
                LOGTEXT_DESCRIPTOR.index -> builder.logText = deserializeString()
                METRICNAME_DESCRIPTOR.index -> builder.metricName = deserializeString()
                METRICNAMESPACE_DESCRIPTOR.index -> builder.metricNamespace = deserializeString()
                RDSEVENTCATEGORIES_DESCRIPTOR.index -> builder.rdsEventCategories = deserializeString()
                RDSEVENTMESSAGE_DESCRIPTOR.index -> builder.rdsEventMessage = deserializeString()
                S3EVENTNAME_DESCRIPTOR.index -> builder.s3EventName = deserializeString()
                SOURCEARN_DESCRIPTOR.index -> builder.sourceArn = deserializeString()
                SOURCETYPE_DESCRIPTOR.index -> builder.sourceType = deserializeString()
                STARTTIME_DESCRIPTOR.index -> builder.startTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                STATESARN_DESCRIPTOR.index -> builder.statesArn = deserializeString()
                STATESEXECUTIONARN_DESCRIPTOR.index -> builder.statesExecutionArn = deserializeString()
                STATESINPUT_DESCRIPTOR.index -> builder.statesInput = deserializeString()
                STATESSTATUS_DESCRIPTOR.index -> builder.statesStatus = deserializeString()
                UNIT_DESCRIPTOR.index -> builder.unit = deserializeString()
                VALUE_DESCRIPTOR.index -> builder.value = deserializeDouble()
                XRAYERRORPERCENT_DESCRIPTOR.index -> builder.xRayErrorPercent = deserializeInt()
                XRAYFAULTPERCENT_DESCRIPTOR.index -> builder.xRayFaultPercent = deserializeInt()
                XRAYNODENAME_DESCRIPTOR.index -> builder.xRayNodeName = deserializeString()
                XRAYNODETYPE_DESCRIPTOR.index -> builder.xRayNodeType = deserializeString()
                XRAYREQUESTAVERAGELATENCY_DESCRIPTOR.index -> builder.xRayRequestAverageLatency = deserializeLong()
                XRAYREQUESTCOUNT_DESCRIPTOR.index -> builder.xRayRequestCount = deserializeInt()
                XRAYTHROTTLEPERCENT_DESCRIPTOR.index -> builder.xRayThrottlePercent = deserializeInt()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy