commonMain.aws.sdk.kotlin.services.lookoutvision.serde.GreengrassConfigurationDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lookoutvision-jvm Show documentation
Show all versions of lookoutvision-jvm Show documentation
The AWS SDK for Kotlin client for LookoutVision
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.lookoutvision.serde
import aws.sdk.kotlin.services.lookoutvision.model.GreengrassConfiguration
import aws.sdk.kotlin.services.lookoutvision.model.Tag
import aws.sdk.kotlin.services.lookoutvision.model.TargetDevice
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 deserializeGreengrassConfigurationDocument(deserializer: Deserializer): GreengrassConfiguration {
val builder = GreengrassConfiguration.Builder()
val COMPILEROPTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CompilerOptions"))
val COMPONENTDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ComponentDescription"))
val COMPONENTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ComponentName"))
val COMPONENTVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ComponentVersion"))
val S3OUTPUTLOCATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("S3OutputLocation"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Tags"))
val TARGETDEVICE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("TargetDevice"))
val TARGETPLATFORM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("TargetPlatform"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(COMPILEROPTIONS_DESCRIPTOR)
field(COMPONENTDESCRIPTION_DESCRIPTOR)
field(COMPONENTNAME_DESCRIPTOR)
field(COMPONENTVERSION_DESCRIPTOR)
field(S3OUTPUTLOCATION_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(TARGETDEVICE_DESCRIPTOR)
field(TARGETPLATFORM_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
COMPILEROPTIONS_DESCRIPTOR.index -> builder.compilerOptions = deserializeString()
COMPONENTDESCRIPTION_DESCRIPTOR.index -> builder.componentDescription = deserializeString()
COMPONENTNAME_DESCRIPTOR.index -> builder.componentName = deserializeString()
COMPONENTVERSION_DESCRIPTOR.index -> builder.componentVersion = deserializeString()
S3OUTPUTLOCATION_DESCRIPTOR.index -> builder.s3OutputLocation = deserializeS3LocationDocument(deserializer)
TAGS_DESCRIPTOR.index -> builder.tags =
deserializer.deserializeList(TAGS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeTagDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
TARGETDEVICE_DESCRIPTOR.index -> builder.targetDevice = deserializeString().let { TargetDevice.fromValue(it) }
TARGETPLATFORM_DESCRIPTOR.index -> builder.targetPlatform = deserializeTargetPlatformDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}