commonMain.aws.sdk.kotlin.services.comprehend.serde.FlywheelIterationPropertiesDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of comprehend-jvm Show documentation
Show all versions of comprehend-jvm Show documentation
The AWS SDK for Kotlin client for Comprehend
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.comprehend.serde
import aws.sdk.kotlin.services.comprehend.model.FlywheelIterationProperties
import aws.sdk.kotlin.services.comprehend.model.FlywheelIterationStatus
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
internal fun deserializeFlywheelIterationPropertiesDocument(deserializer: Deserializer): FlywheelIterationProperties {
val builder = FlywheelIterationProperties.Builder()
val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTime"))
val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("EndTime"))
val EVALUATEDMODELARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EvaluatedModelArn"))
val EVALUATEDMODELMETRICS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("EvaluatedModelMetrics"))
val EVALUATIONMANIFESTS3PREFIX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EvaluationManifestS3Prefix"))
val FLYWHEELARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FlywheelArn"))
val FLYWHEELITERATIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FlywheelIterationId"))
val MESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Message"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
val TRAINEDMODELARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TrainedModelArn"))
val TRAINEDMODELMETRICS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("TrainedModelMetrics"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CREATIONTIME_DESCRIPTOR)
field(ENDTIME_DESCRIPTOR)
field(EVALUATEDMODELARN_DESCRIPTOR)
field(EVALUATEDMODELMETRICS_DESCRIPTOR)
field(EVALUATIONMANIFESTS3PREFIX_DESCRIPTOR)
field(FLYWHEELARN_DESCRIPTOR)
field(FLYWHEELITERATIONID_DESCRIPTOR)
field(MESSAGE_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(TRAINEDMODELARN_DESCRIPTOR)
field(TRAINEDMODELMETRICS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
EVALUATEDMODELARN_DESCRIPTOR.index -> builder.evaluatedModelArn = deserializeString()
EVALUATEDMODELMETRICS_DESCRIPTOR.index -> builder.evaluatedModelMetrics = deserializeFlywheelModelEvaluationMetricsDocument(deserializer)
EVALUATIONMANIFESTS3PREFIX_DESCRIPTOR.index -> builder.evaluationManifestS3Prefix = deserializeString()
FLYWHEELARN_DESCRIPTOR.index -> builder.flywheelArn = deserializeString()
FLYWHEELITERATIONID_DESCRIPTOR.index -> builder.flywheelIterationId = deserializeString()
MESSAGE_DESCRIPTOR.index -> builder.message = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { FlywheelIterationStatus.fromValue(it) }
TRAINEDMODELARN_DESCRIPTOR.index -> builder.trainedModelArn = deserializeString()
TRAINEDMODELMETRICS_DESCRIPTOR.index -> builder.trainedModelMetrics = deserializeFlywheelModelEvaluationMetricsDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}