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

commonMain.aws.sdk.kotlin.services.cloudwatchlogs.serde.LogStreamDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudwatchlogs.serde

import aws.sdk.kotlin.services.cloudwatchlogs.model.LogStream
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

internal fun deserializeLogStreamDocument(deserializer: Deserializer): LogStream {
    val builder = LogStream.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("creationTime"))
    val FIRSTEVENTTIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("firstEventTimestamp"))
    val LASTEVENTTIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("lastEventTimestamp"))
    val LASTINGESTIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("lastIngestionTime"))
    val LOGSTREAMNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("logStreamName"))
    val STOREDBYTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("storedBytes"))
    val UPLOADSEQUENCETOKEN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("uploadSequenceToken"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(CREATIONTIME_DESCRIPTOR)
        field(FIRSTEVENTTIMESTAMP_DESCRIPTOR)
        field(LASTEVENTTIMESTAMP_DESCRIPTOR)
        field(LASTINGESTIONTIME_DESCRIPTOR)
        field(LOGSTREAMNAME_DESCRIPTOR)
        field(STOREDBYTES_DESCRIPTOR)
        field(UPLOADSEQUENCETOKEN_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeLong()
                FIRSTEVENTTIMESTAMP_DESCRIPTOR.index -> builder.firstEventTimestamp = deserializeLong()
                LASTEVENTTIMESTAMP_DESCRIPTOR.index -> builder.lastEventTimestamp = deserializeLong()
                LASTINGESTIONTIME_DESCRIPTOR.index -> builder.lastIngestionTime = deserializeLong()
                LOGSTREAMNAME_DESCRIPTOR.index -> builder.logStreamName = deserializeString()
                STOREDBYTES_DESCRIPTOR.index -> builder.storedBytes = deserializeLong()
                UPLOADSEQUENCETOKEN_DESCRIPTOR.index -> builder.uploadSequenceToken = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy