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

commonMain.aws.sdk.kotlin.services.proton.serde.CountsSummaryDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.proton.serde

import aws.sdk.kotlin.services.proton.model.CountsSummary
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 deserializeCountsSummaryDocument(deserializer: Deserializer): CountsSummary {
    val builder = CountsSummary.Builder()
    val COMPONENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("components"))
    val ENVIRONMENTTEMPLATES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("environmentTemplates"))
    val ENVIRONMENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("environments"))
    val PIPELINES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("pipelines"))
    val SERVICEINSTANCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("serviceInstances"))
    val SERVICETEMPLATES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("serviceTemplates"))
    val SERVICES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("services"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(COMPONENTS_DESCRIPTOR)
        field(ENVIRONMENTTEMPLATES_DESCRIPTOR)
        field(ENVIRONMENTS_DESCRIPTOR)
        field(PIPELINES_DESCRIPTOR)
        field(SERVICEINSTANCES_DESCRIPTOR)
        field(SERVICETEMPLATES_DESCRIPTOR)
        field(SERVICES_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                COMPONENTS_DESCRIPTOR.index -> builder.components = deserializeResourceCountsSummaryDocument(deserializer)
                ENVIRONMENTTEMPLATES_DESCRIPTOR.index -> builder.environmentTemplates = deserializeResourceCountsSummaryDocument(deserializer)
                ENVIRONMENTS_DESCRIPTOR.index -> builder.environments = deserializeResourceCountsSummaryDocument(deserializer)
                PIPELINES_DESCRIPTOR.index -> builder.pipelines = deserializeResourceCountsSummaryDocument(deserializer)
                SERVICEINSTANCES_DESCRIPTOR.index -> builder.serviceInstances = deserializeResourceCountsSummaryDocument(deserializer)
                SERVICETEMPLATES_DESCRIPTOR.index -> builder.serviceTemplates = deserializeResourceCountsSummaryDocument(deserializer)
                SERVICES_DESCRIPTOR.index -> builder.services = deserializeResourceCountsSummaryDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy