commonMain.aws.sdk.kotlin.services.cloudsearch.serde.TextOptionsDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudsearch-jvm Show documentation
Show all versions of cloudsearch-jvm Show documentation
The AWS SDK for Kotlin client for CloudSearch
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cloudsearch.serde
import aws.sdk.kotlin.services.cloudsearch.model.TextOptions
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.parseBoolean
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
import aws.smithy.kotlin.runtime.serde.xml.tryData
internal fun deserializeTextOptionsDocument(reader: XmlTagReader): TextOptions {
val builder = TextOptions.Builder()
loop@while (true) {
val curr = reader.nextTag() ?: break@loop
when (curr.tagName) {
// DefaultValue com.amazonaws.cloudsearch#TextOptions$DefaultValue
"DefaultValue" -> builder.defaultValue = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudsearch#FieldValue`)" }
// SourceField com.amazonaws.cloudsearch#TextOptions$SourceField
"SourceField" -> builder.sourceField = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudsearch#FieldName`)" }
// ReturnEnabled com.amazonaws.cloudsearch#TextOptions$ReturnEnabled
"ReturnEnabled" -> builder.returnEnabled = curr.tryData()
.parseBoolean()
.getOrDeserializeErr { "expected (boolean: `com.amazonaws.cloudsearch#Boolean`)" }
// SortEnabled com.amazonaws.cloudsearch#TextOptions$SortEnabled
"SortEnabled" -> builder.sortEnabled = curr.tryData()
.parseBoolean()
.getOrDeserializeErr { "expected (boolean: `com.amazonaws.cloudsearch#Boolean`)" }
// HighlightEnabled com.amazonaws.cloudsearch#TextOptions$HighlightEnabled
"HighlightEnabled" -> builder.highlightEnabled = curr.tryData()
.parseBoolean()
.getOrDeserializeErr { "expected (boolean: `com.amazonaws.cloudsearch#Boolean`)" }
// AnalysisScheme com.amazonaws.cloudsearch#TextOptions$AnalysisScheme
"AnalysisScheme" -> builder.analysisScheme = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.cloudsearch#Word`)" }
else -> {}
}
curr.drop()
}
builder.correctErrors()
return builder.build()
}