commonMain.aws.sdk.kotlin.services.kinesis.serde.StreamSummaryDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kinesis-jvm Show documentation
Show all versions of kinesis-jvm Show documentation
The AWS SDK for Kotlin client for Kinesis
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.kinesis.serde
import aws.sdk.kotlin.services.kinesis.model.StreamStatus
import aws.sdk.kotlin.services.kinesis.model.StreamSummary
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 deserializeStreamSummaryDocument(deserializer: Deserializer): StreamSummary {
val builder = StreamSummary.Builder()
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(STREAMARN_DESCRIPTOR)
field(STREAMCREATIONTIMESTAMP_DESCRIPTOR)
field(STREAMMODEDETAILS_DESCRIPTOR)
field(STREAMNAME_DESCRIPTOR)
field(STREAMSTATUS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
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()
}