commonMain.aws.sdk.kotlin.services.glue.serde.MlTransformDocumentDeserializer.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.GlueTable
import aws.sdk.kotlin.services.glue.model.MlTransform
import aws.sdk.kotlin.services.glue.model.SchemaColumn
import aws.sdk.kotlin.services.glue.model.TransformStatusType
import aws.sdk.kotlin.services.glue.model.WorkerType
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
import kotlin.collections.mutableListOf
internal fun deserializeMlTransformDocument(deserializer: Deserializer): MlTransform {
val builder = MlTransform.Builder()
val CREATEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreatedOn"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val EVALUATIONMETRICS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("EvaluationMetrics"))
val GLUEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("GlueVersion"))
val INPUTRECORDTABLES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("InputRecordTables"))
val LABELCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("LabelCount"))
val LASTMODIFIEDON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastModifiedOn"))
val MAXCAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("MaxCapacity"))
val MAXRETRIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaxRetries"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val NUMBEROFWORKERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("NumberOfWorkers"))
val PARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Parameters"))
val ROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Role"))
val SCHEMA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Schema"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
val TIMEOUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Timeout"))
val TRANSFORMENCRYPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("TransformEncryption"))
val TRANSFORMID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TransformId"))
val WORKERTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("WorkerType"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CREATEDON_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(EVALUATIONMETRICS_DESCRIPTOR)
field(GLUEVERSION_DESCRIPTOR)
field(INPUTRECORDTABLES_DESCRIPTOR)
field(LABELCOUNT_DESCRIPTOR)
field(LASTMODIFIEDON_DESCRIPTOR)
field(MAXCAPACITY_DESCRIPTOR)
field(MAXRETRIES_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(NUMBEROFWORKERS_DESCRIPTOR)
field(PARAMETERS_DESCRIPTOR)
field(ROLE_DESCRIPTOR)
field(SCHEMA_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(TIMEOUT_DESCRIPTOR)
field(TRANSFORMENCRYPTION_DESCRIPTOR)
field(TRANSFORMID_DESCRIPTOR)
field(WORKERTYPE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CREATEDON_DESCRIPTOR.index -> builder.createdOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
EVALUATIONMETRICS_DESCRIPTOR.index -> builder.evaluationMetrics = deserializeEvaluationMetricsDocument(deserializer)
GLUEVERSION_DESCRIPTOR.index -> builder.glueVersion = deserializeString()
INPUTRECORDTABLES_DESCRIPTOR.index -> builder.inputRecordTables =
deserializer.deserializeList(INPUTRECORDTABLES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeGlueTableDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
LABELCOUNT_DESCRIPTOR.index -> builder.labelCount = deserializeInt()
LASTMODIFIEDON_DESCRIPTOR.index -> builder.lastModifiedOn = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
MAXCAPACITY_DESCRIPTOR.index -> builder.maxCapacity = deserializeDouble()
MAXRETRIES_DESCRIPTOR.index -> builder.maxRetries = deserializeInt()
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
NUMBEROFWORKERS_DESCRIPTOR.index -> builder.numberOfWorkers = deserializeInt()
PARAMETERS_DESCRIPTOR.index -> builder.parameters = deserializeTransformParametersDocument(deserializer)
ROLE_DESCRIPTOR.index -> builder.role = deserializeString()
SCHEMA_DESCRIPTOR.index -> builder.schema =
deserializer.deserializeList(SCHEMA_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeSchemaColumnDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { TransformStatusType.fromValue(it) }
TIMEOUT_DESCRIPTOR.index -> builder.timeout = deserializeInt()
TRANSFORMENCRYPTION_DESCRIPTOR.index -> builder.transformEncryption = deserializeTransformEncryptionDocument(deserializer)
TRANSFORMID_DESCRIPTOR.index -> builder.transformId = deserializeString()
WORKERTYPE_DESCRIPTOR.index -> builder.workerType = deserializeString().let { WorkerType.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}