commonMain.aws.sdk.kotlin.services.glue.serde.PropertyDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glue-jvm Show documentation
Show all versions of glue-jvm Show documentation
The AWS SDK for Kotlin client for Glue
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.serde
import aws.sdk.kotlin.services.glue.model.AllowedValue
import aws.sdk.kotlin.services.glue.model.DataOperation
import aws.sdk.kotlin.services.glue.model.Property
import aws.sdk.kotlin.services.glue.model.PropertyType
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 kotlin.collections.mutableListOf
internal fun deserializePropertyDocument(deserializer: Deserializer): Property {
val builder = Property.Builder()
val ALLOWEDVALUES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AllowedValues"))
val DATAOPERATIONSCOPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DataOperationScopes"))
val DEFAULTVALUE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DefaultValue"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val PROPERTYTYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("PropertyTypes"))
val REQUIRED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("Required"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ALLOWEDVALUES_DESCRIPTOR)
field(DATAOPERATIONSCOPES_DESCRIPTOR)
field(DEFAULTVALUE_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(PROPERTYTYPES_DESCRIPTOR)
field(REQUIRED_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ALLOWEDVALUES_DESCRIPTOR.index -> builder.allowedValues =
deserializer.deserializeList(ALLOWEDVALUES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeAllowedValueDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
DATAOPERATIONSCOPES_DESCRIPTOR.index -> builder.dataOperationScopes =
deserializer.deserializeList(DATAOPERATIONSCOPES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { DataOperation.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
DEFAULTVALUE_DESCRIPTOR.index -> builder.defaultValue = deserializeString()
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
PROPERTYTYPES_DESCRIPTOR.index -> builder.propertyTypes =
deserializer.deserializeList(PROPERTYTYPES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { PropertyType.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
REQUIRED_DESCRIPTOR.index -> builder.required = deserializeBoolean()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy