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

commonMain.aws.sdk.kotlin.services.codecatalyst.serde.EventLogEntryDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.codecatalyst.serde

import aws.sdk.kotlin.services.codecatalyst.model.EventLogEntry
import aws.sdk.kotlin.services.codecatalyst.model.OperationType
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 deserializeEventLogEntryDocument(deserializer: Deserializer): EventLogEntry {
    val builder = EventLogEntry.Builder()
    val ERRORCODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("errorCode"))
    val EVENTCATEGORY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("eventCategory"))
    val EVENTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("eventName"))
    val EVENTSOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("eventSource"))
    val EVENTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("eventTime"))
    val EVENTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("eventType"))
    val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("id"))
    val OPERATIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("operationType"))
    val PROJECTINFORMATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("projectInformation"))
    val REQUESTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("requestId"))
    val REQUESTPAYLOAD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("requestPayload"))
    val RESPONSEPAYLOAD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("responsePayload"))
    val SOURCEIPADDRESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("sourceIpAddress"))
    val USERAGENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("userAgent"))
    val USERIDENTITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("userIdentity"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ERRORCODE_DESCRIPTOR)
        field(EVENTCATEGORY_DESCRIPTOR)
        field(EVENTNAME_DESCRIPTOR)
        field(EVENTSOURCE_DESCRIPTOR)
        field(EVENTTIME_DESCRIPTOR)
        field(EVENTTYPE_DESCRIPTOR)
        field(ID_DESCRIPTOR)
        field(OPERATIONTYPE_DESCRIPTOR)
        field(PROJECTINFORMATION_DESCRIPTOR)
        field(REQUESTID_DESCRIPTOR)
        field(REQUESTPAYLOAD_DESCRIPTOR)
        field(RESPONSEPAYLOAD_DESCRIPTOR)
        field(SOURCEIPADDRESS_DESCRIPTOR)
        field(USERAGENT_DESCRIPTOR)
        field(USERIDENTITY_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ERRORCODE_DESCRIPTOR.index -> builder.errorCode = deserializeString()
                EVENTCATEGORY_DESCRIPTOR.index -> builder.eventCategory = deserializeString()
                EVENTNAME_DESCRIPTOR.index -> builder.eventName = deserializeString()
                EVENTSOURCE_DESCRIPTOR.index -> builder.eventSource = deserializeString()
                EVENTTIME_DESCRIPTOR.index -> builder.eventTime = deserializeInstant(TimestampFormat.ISO_8601)
                EVENTTYPE_DESCRIPTOR.index -> builder.eventType = deserializeString()
                ID_DESCRIPTOR.index -> builder.id = deserializeString()
                OPERATIONTYPE_DESCRIPTOR.index -> builder.operationType = deserializeString().let { OperationType.fromValue(it) }
                PROJECTINFORMATION_DESCRIPTOR.index -> builder.projectInformation = deserializeProjectInformationDocument(deserializer)
                REQUESTID_DESCRIPTOR.index -> builder.requestId = deserializeString()
                REQUESTPAYLOAD_DESCRIPTOR.index -> builder.requestPayload = deserializeEventPayloadDocument(deserializer)
                RESPONSEPAYLOAD_DESCRIPTOR.index -> builder.responsePayload = deserializeEventPayloadDocument(deserializer)
                SOURCEIPADDRESS_DESCRIPTOR.index -> builder.sourceIpAddress = deserializeString()
                USERAGENT_DESCRIPTOR.index -> builder.userAgent = deserializeString()
                USERIDENTITY_DESCRIPTOR.index -> builder.userIdentity = deserializeUserIdentityDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy