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

commonMain.aws.sdk.kotlin.services.kinesis.serde.StreamDescriptionSummaryDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.kinesis.serde

import aws.sdk.kotlin.services.kinesis.model.EncryptionType
import aws.sdk.kotlin.services.kinesis.model.EnhancedMetrics
import aws.sdk.kotlin.services.kinesis.model.StreamDescriptionSummary
import aws.sdk.kotlin.services.kinesis.model.StreamStatus
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
import kotlin.collections.mutableListOf

internal fun deserializeStreamDescriptionSummaryDocument(deserializer: Deserializer): StreamDescriptionSummary {
    val builder = StreamDescriptionSummary.Builder()
    val CONSUMERCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("ConsumerCount"))
    val ENCRYPTIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("EncryptionType"))
    val ENHANCEDMONITORING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("EnhancedMonitoring"))
    val KEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("KeyId"))
    val OPENSHARDCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("OpenShardCount"))
    val RETENTIONPERIODHOURS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("RetentionPeriodHours"))
    val STREAMARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StreamARN"))
    val STREAMCREATIONTIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("StreamCreationTimestamp"))
    val STREAMMODEDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("StreamModeDetails"))
    val STREAMNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StreamName"))
    val STREAMSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("StreamStatus"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CONSUMERCOUNT_DESCRIPTOR)
        field(ENCRYPTIONTYPE_DESCRIPTOR)
        field(ENHANCEDMONITORING_DESCRIPTOR)
        field(KEYID_DESCRIPTOR)
        field(OPENSHARDCOUNT_DESCRIPTOR)
        field(RETENTIONPERIODHOURS_DESCRIPTOR)
        field(STREAMARN_DESCRIPTOR)
        field(STREAMCREATIONTIMESTAMP_DESCRIPTOR)
        field(STREAMMODEDETAILS_DESCRIPTOR)
        field(STREAMNAME_DESCRIPTOR)
        field(STREAMSTATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CONSUMERCOUNT_DESCRIPTOR.index -> builder.consumerCount = deserializeInt()
                ENCRYPTIONTYPE_DESCRIPTOR.index -> builder.encryptionType = deserializeString().let { EncryptionType.fromValue(it) }
                ENHANCEDMONITORING_DESCRIPTOR.index -> builder.enhancedMonitoring =
                    deserializer.deserializeList(ENHANCEDMONITORING_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeEnhancedMetricsDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                KEYID_DESCRIPTOR.index -> builder.keyId = deserializeString()
                OPENSHARDCOUNT_DESCRIPTOR.index -> builder.openShardCount = deserializeInt()
                RETENTIONPERIODHOURS_DESCRIPTOR.index -> builder.retentionPeriodHours = deserializeInt()
                STREAMARN_DESCRIPTOR.index -> builder.streamArn = deserializeString()
                STREAMCREATIONTIMESTAMP_DESCRIPTOR.index -> builder.streamCreationTimestamp = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                STREAMMODEDETAILS_DESCRIPTOR.index -> builder.streamModeDetails = deserializeStreamModeDetailsDocument(deserializer)
                STREAMNAME_DESCRIPTOR.index -> builder.streamName = deserializeString()
                STREAMSTATUS_DESCRIPTOR.index -> builder.streamStatus = deserializeString().let { StreamStatus.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy