commonMain.aws.sdk.kotlin.services.glue.serde.KafkaStreamingSourceOptionsDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.serde
import aws.sdk.kotlin.services.glue.model.KafkaStreamingSourceOptions
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 deserializeKafkaStreamingSourceOptionsDocument(deserializer: Deserializer): KafkaStreamingSourceOptions {
val builder = KafkaStreamingSourceOptions.Builder()
val ADDRECORDTIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AddRecordTimestamp"))
val ASSIGN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Assign"))
val BOOTSTRAPSERVERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("BootstrapServers"))
val CLASSIFICATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Classification"))
val CONNECTIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConnectionName"))
val DELIMITER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Delimiter"))
val EMITCONSUMERLAGMETRICS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EmitConsumerLagMetrics"))
val ENDINGOFFSETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EndingOffsets"))
val INCLUDEHEADERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("IncludeHeaders"))
val MAXOFFSETSPERTRIGGER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("MaxOffsetsPerTrigger"))
val MINPARTITIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MinPartitions"))
val NUMRETRIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("NumRetries"))
val POLLTIMEOUTMS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("PollTimeoutMs"))
val RETRYINTERVALMS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("RetryIntervalMs"))
val SECURITYPROTOCOL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SecurityProtocol"))
val STARTINGOFFSETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StartingOffsets"))
val STARTINGTIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("StartingTimestamp"))
val SUBSCRIBEPATTERN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SubscribePattern"))
val TOPICNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TopicName"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ADDRECORDTIMESTAMP_DESCRIPTOR)
field(ASSIGN_DESCRIPTOR)
field(BOOTSTRAPSERVERS_DESCRIPTOR)
field(CLASSIFICATION_DESCRIPTOR)
field(CONNECTIONNAME_DESCRIPTOR)
field(DELIMITER_DESCRIPTOR)
field(EMITCONSUMERLAGMETRICS_DESCRIPTOR)
field(ENDINGOFFSETS_DESCRIPTOR)
field(INCLUDEHEADERS_DESCRIPTOR)
field(MAXOFFSETSPERTRIGGER_DESCRIPTOR)
field(MINPARTITIONS_DESCRIPTOR)
field(NUMRETRIES_DESCRIPTOR)
field(POLLTIMEOUTMS_DESCRIPTOR)
field(RETRYINTERVALMS_DESCRIPTOR)
field(SECURITYPROTOCOL_DESCRIPTOR)
field(STARTINGOFFSETS_DESCRIPTOR)
field(STARTINGTIMESTAMP_DESCRIPTOR)
field(SUBSCRIBEPATTERN_DESCRIPTOR)
field(TOPICNAME_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ADDRECORDTIMESTAMP_DESCRIPTOR.index -> builder.addRecordTimestamp = deserializeString()
ASSIGN_DESCRIPTOR.index -> builder.assign = deserializeString()
BOOTSTRAPSERVERS_DESCRIPTOR.index -> builder.bootstrapServers = deserializeString()
CLASSIFICATION_DESCRIPTOR.index -> builder.classification = deserializeString()
CONNECTIONNAME_DESCRIPTOR.index -> builder.connectionName = deserializeString()
DELIMITER_DESCRIPTOR.index -> builder.delimiter = deserializeString()
EMITCONSUMERLAGMETRICS_DESCRIPTOR.index -> builder.emitConsumerLagMetrics = deserializeString()
ENDINGOFFSETS_DESCRIPTOR.index -> builder.endingOffsets = deserializeString()
INCLUDEHEADERS_DESCRIPTOR.index -> builder.includeHeaders = deserializeBoolean()
MAXOFFSETSPERTRIGGER_DESCRIPTOR.index -> builder.maxOffsetsPerTrigger = deserializeLong()
MINPARTITIONS_DESCRIPTOR.index -> builder.minPartitions = deserializeInt()
NUMRETRIES_DESCRIPTOR.index -> builder.numRetries = deserializeInt()
POLLTIMEOUTMS_DESCRIPTOR.index -> builder.pollTimeoutMs = deserializeLong()
RETRYINTERVALMS_DESCRIPTOR.index -> builder.retryIntervalMs = deserializeLong()
SECURITYPROTOCOL_DESCRIPTOR.index -> builder.securityProtocol = deserializeString()
STARTINGOFFSETS_DESCRIPTOR.index -> builder.startingOffsets = deserializeString()
STARTINGTIMESTAMP_DESCRIPTOR.index -> builder.startingTimestamp = deserializeInstant(TimestampFormat.ISO_8601)
SUBSCRIBEPATTERN_DESCRIPTOR.index -> builder.subscribePattern = deserializeString()
TOPICNAME_DESCRIPTOR.index -> builder.topicName = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}