commonMain.aws.sdk.kotlin.services.comprehend.serde.DocumentClassifierPropertiesDocumentDeserializer.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.DocumentClassifierMode
import aws.sdk.kotlin.services.comprehend.model.DocumentClassifierProperties
import aws.sdk.kotlin.services.comprehend.model.LanguageCode
import aws.sdk.kotlin.services.comprehend.model.ModelStatus
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 deserializeDocumentClassifierPropertiesDocument(deserializer: Deserializer): DocumentClassifierProperties {
val builder = DocumentClassifierProperties.Builder()
val CLASSIFIERMETADATA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ClassifierMetadata"))
val DATAACCESSROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DataAccessRoleArn"))
val DOCUMENTCLASSIFIERARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DocumentClassifierArn"))
val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("EndTime"))
val FLYWHEELARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FlywheelArn"))
val INPUTDATACONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("InputDataConfig"))
val LANGUAGECODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("LanguageCode"))
val MESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Message"))
val MODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Mode"))
val MODELKMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ModelKmsKeyId"))
val OUTPUTDATACONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("OutputDataConfig"))
val SOURCEMODELARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SourceModelArn"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
val SUBMITTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("SubmitTime"))
val TRAININGENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("TrainingEndTime"))
val TRAININGSTARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("TrainingStartTime"))
val VERSIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("VersionName"))
val VOLUMEKMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("VolumeKmsKeyId"))
val VPCCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("VpcConfig"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CLASSIFIERMETADATA_DESCRIPTOR)
field(DATAACCESSROLEARN_DESCRIPTOR)
field(DOCUMENTCLASSIFIERARN_DESCRIPTOR)
field(ENDTIME_DESCRIPTOR)
field(FLYWHEELARN_DESCRIPTOR)
field(INPUTDATACONFIG_DESCRIPTOR)
field(LANGUAGECODE_DESCRIPTOR)
field(MESSAGE_DESCRIPTOR)
field(MODE_DESCRIPTOR)
field(MODELKMSKEYID_DESCRIPTOR)
field(OUTPUTDATACONFIG_DESCRIPTOR)
field(SOURCEMODELARN_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(SUBMITTIME_DESCRIPTOR)
field(TRAININGENDTIME_DESCRIPTOR)
field(TRAININGSTARTTIME_DESCRIPTOR)
field(VERSIONNAME_DESCRIPTOR)
field(VOLUMEKMSKEYID_DESCRIPTOR)
field(VPCCONFIG_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CLASSIFIERMETADATA_DESCRIPTOR.index -> builder.classifierMetadata = deserializeClassifierMetadataDocument(deserializer)
DATAACCESSROLEARN_DESCRIPTOR.index -> builder.dataAccessRoleArn = deserializeString()
DOCUMENTCLASSIFIERARN_DESCRIPTOR.index -> builder.documentClassifierArn = deserializeString()
ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
FLYWHEELARN_DESCRIPTOR.index -> builder.flywheelArn = deserializeString()
INPUTDATACONFIG_DESCRIPTOR.index -> builder.inputDataConfig = deserializeDocumentClassifierInputDataConfigDocument(deserializer)
LANGUAGECODE_DESCRIPTOR.index -> builder.languageCode = deserializeString().let { LanguageCode.fromValue(it) }
MESSAGE_DESCRIPTOR.index -> builder.message = deserializeString()
MODE_DESCRIPTOR.index -> builder.mode = deserializeString().let { DocumentClassifierMode.fromValue(it) }
MODELKMSKEYID_DESCRIPTOR.index -> builder.modelKmsKeyId = deserializeString()
OUTPUTDATACONFIG_DESCRIPTOR.index -> builder.outputDataConfig = deserializeDocumentClassifierOutputDataConfigDocument(deserializer)
SOURCEMODELARN_DESCRIPTOR.index -> builder.sourceModelArn = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { ModelStatus.fromValue(it) }
SUBMITTIME_DESCRIPTOR.index -> builder.submitTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
TRAININGENDTIME_DESCRIPTOR.index -> builder.trainingEndTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
TRAININGSTARTTIME_DESCRIPTOR.index -> builder.trainingStartTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
VERSIONNAME_DESCRIPTOR.index -> builder.versionName = deserializeString()
VOLUMEKMSKEYID_DESCRIPTOR.index -> builder.volumeKmsKeyId = deserializeString()
VPCCONFIG_DESCRIPTOR.index -> builder.vpcConfig = deserializeVpcConfigDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}