All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.codegurureviewer.serde.RecommendationSummaryDocumentDeserializer.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.codegurureviewer.serde

import aws.sdk.kotlin.services.codegurureviewer.model.RecommendationCategory
import aws.sdk.kotlin.services.codegurureviewer.model.RecommendationSummary
import aws.sdk.kotlin.services.codegurureviewer.model.Severity
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 deserializeRecommendationSummaryDocument(deserializer: Deserializer): RecommendationSummary {
    val builder = RecommendationSummary.Builder()
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
    val ENDLINE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("EndLine"))
    val FILEPATH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FilePath"))
    val RECOMMENDATIONCATEGORY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("RecommendationCategory"))
    val RECOMMENDATIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RecommendationId"))
    val RULEMETADATA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("RuleMetadata"))
    val SEVERITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Severity"))
    val STARTLINE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("StartLine"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DESCRIPTION_DESCRIPTOR)
        field(ENDLINE_DESCRIPTOR)
        field(FILEPATH_DESCRIPTOR)
        field(RECOMMENDATIONCATEGORY_DESCRIPTOR)
        field(RECOMMENDATIONID_DESCRIPTOR)
        field(RULEMETADATA_DESCRIPTOR)
        field(SEVERITY_DESCRIPTOR)
        field(STARTLINE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                ENDLINE_DESCRIPTOR.index -> builder.endLine = deserializeInt()
                FILEPATH_DESCRIPTOR.index -> builder.filePath = deserializeString()
                RECOMMENDATIONCATEGORY_DESCRIPTOR.index -> builder.recommendationCategory = deserializeString().let { RecommendationCategory.fromValue(it) }
                RECOMMENDATIONID_DESCRIPTOR.index -> builder.recommendationId = deserializeString()
                RULEMETADATA_DESCRIPTOR.index -> builder.ruleMetadata = deserializeRuleMetadataDocument(deserializer)
                SEVERITY_DESCRIPTOR.index -> builder.severity = deserializeString().let { Severity.fromValue(it) }
                STARTLINE_DESCRIPTOR.index -> builder.startLine = deserializeInt()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy