commonMain.aws.sdk.kotlin.services.resiliencehub.serde.AppInputSourceDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resiliencehub-jvm Show documentation
Show all versions of resiliencehub-jvm Show documentation
The AWS SDK for Kotlin client for resiliencehub
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.resiliencehub.serde
import aws.sdk.kotlin.services.resiliencehub.model.AppInputSource
import aws.sdk.kotlin.services.resiliencehub.model.ResourceMappingType
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
internal fun deserializeAppInputSourceDocument(deserializer: Deserializer): AppInputSource {
val builder = AppInputSource.Builder()
val EKSSOURCECLUSTERNAMESPACE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("eksSourceClusterNamespace"))
val IMPORTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("importType"))
val RESOURCECOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("resourceCount"))
val SOURCEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("sourceArn"))
val SOURCENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("sourceName"))
val TERRAFORMSOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("terraformSource"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(EKSSOURCECLUSTERNAMESPACE_DESCRIPTOR)
field(IMPORTTYPE_DESCRIPTOR)
field(RESOURCECOUNT_DESCRIPTOR)
field(SOURCEARN_DESCRIPTOR)
field(SOURCENAME_DESCRIPTOR)
field(TERRAFORMSOURCE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
EKSSOURCECLUSTERNAMESPACE_DESCRIPTOR.index -> builder.eksSourceClusterNamespace = deserializeEksSourceClusterNamespaceDocument(deserializer)
IMPORTTYPE_DESCRIPTOR.index -> builder.importType = deserializeString().let { ResourceMappingType.fromValue(it) }
RESOURCECOUNT_DESCRIPTOR.index -> builder.resourceCount = deserializeInt()
SOURCEARN_DESCRIPTOR.index -> builder.sourceArn = deserializeString()
SOURCENAME_DESCRIPTOR.index -> builder.sourceName = deserializeString()
TERRAFORMSOURCE_DESCRIPTOR.index -> builder.terraformSource = deserializeTerraformSourceDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}