commonMain.aws.sdk.kotlin.services.timestreaminfluxdb.serde.InfluxDbV2ParametersDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of timestreaminfluxdb-jvm Show documentation
Show all versions of timestreaminfluxdb-jvm Show documentation
The AWS SDK for Kotlin client for Timestream InfluxDB
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.timestreaminfluxdb.serde
import aws.sdk.kotlin.services.timestreaminfluxdb.model.InfluxDbV2Parameters
import aws.sdk.kotlin.services.timestreaminfluxdb.model.LogLevel
import aws.sdk.kotlin.services.timestreaminfluxdb.model.TracingType
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 deserializeInfluxDbV2ParametersDocument(deserializer: Deserializer): InfluxDbV2Parameters {
val builder = InfluxDbV2Parameters.Builder()
val FLUXLOGENABLED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("fluxLogEnabled"))
val LOGLEVEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("logLevel"))
val METRICSDISABLED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("metricsDisabled"))
val NOTASKS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("noTasks"))
val QUERYCONCURRENCY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("queryConcurrency"))
val QUERYQUEUESIZE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("queryQueueSize"))
val TRACINGTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("tracingType"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(FLUXLOGENABLED_DESCRIPTOR)
field(LOGLEVEL_DESCRIPTOR)
field(METRICSDISABLED_DESCRIPTOR)
field(NOTASKS_DESCRIPTOR)
field(QUERYCONCURRENCY_DESCRIPTOR)
field(QUERYQUEUESIZE_DESCRIPTOR)
field(TRACINGTYPE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
FLUXLOGENABLED_DESCRIPTOR.index -> builder.fluxLogEnabled = deserializeBoolean()
LOGLEVEL_DESCRIPTOR.index -> builder.logLevel = deserializeString().let { LogLevel.fromValue(it) }
METRICSDISABLED_DESCRIPTOR.index -> builder.metricsDisabled = deserializeBoolean()
NOTASKS_DESCRIPTOR.index -> builder.noTasks = deserializeBoolean()
QUERYCONCURRENCY_DESCRIPTOR.index -> builder.queryConcurrency = deserializeInt()
QUERYQUEUESIZE_DESCRIPTOR.index -> builder.queryQueueSize = deserializeInt()
TRACINGTYPE_DESCRIPTOR.index -> builder.tracingType = deserializeString().let { TracingType.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}