org.http4k.connect.amazon.model.KotshiParameterNameJsonAdapter.kt Maven / Gradle / Ivy
// Code generated by Kotshi. Do not edit.
package org.http4k.connect.amazon.model
import com.squareup.moshi.JsonDataException
import com.squareup.moshi.JsonReader
import com.squareup.moshi.JsonWriter
import java.io.IOException
import kotlin.Suppress
import kotlin.jvm.Throws
import se.ansman.kotshi.InternalKotshiApi
import se.ansman.kotshi.NamedJsonAdapter
@InternalKotshiApi
@Suppress(
"DEPRECATION",
"unused",
"ClassName",
"REDUNDANT_PROJECTION",
"RedundantExplicitType",
"LocalVariableName",
"RedundantVisibilityModifier",
"PLATFORM_CLASS_MAPPED_TO_KOTLIN",
"IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION",
"EXPERIMENTAL_API_USAGE",
"OPT_IN_USAGE",
)
internal class KotshiParameterNameJsonAdapter : NamedJsonAdapter("KotshiJsonAdapter(ParameterName)") {
private val options: JsonReader.Options = JsonReader.Options.of(
"LambdaArn",
"NumberOfRetries",
"RoleArn",
"BufferSizeInMBs",
"BufferIntervalInSeconds"
)
@Throws(IOException::class)
override fun toJson(writer: JsonWriter, `value`: ParameterName?) {
when (`value`) {
ParameterName.LambdaArn -> writer.value("LambdaArn")
ParameterName.NumberOfRetries -> writer.value("NumberOfRetries")
ParameterName.RoleArn -> writer.value("RoleArn")
ParameterName.BufferSizeInMBs -> writer.value("BufferSizeInMBs")
ParameterName.BufferIntervalInSeconds -> writer.value("BufferIntervalInSeconds")
null -> writer.nullValue()
}
}
@Throws(IOException::class)
override fun fromJson(reader: JsonReader): ParameterName? = if (reader.peek() == JsonReader.Token.NULL) {
reader.nextNull()
} else when (reader.selectString(options)) {
0 -> ParameterName.LambdaArn
1 -> ParameterName.NumberOfRetries
2 -> ParameterName.RoleArn
3 -> ParameterName.BufferSizeInMBs
4 -> ParameterName.BufferIntervalInSeconds
else -> throw JsonDataException("""Expected one of [LambdaArn, NumberOfRetries, RoleArn, BufferSizeInMBs, BufferIntervalInSeconds] but was ${reader.nextString()} at path ${reader.path}""")
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy