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

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

There is a newer version: 1.3.99
Show 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.ServiceInstanceState
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 deserializeServiceInstanceStateDocument(deserializer: Deserializer): ServiceInstanceState {
    val builder = ServiceInstanceState.Builder()
    val LASTSUCCESSFULCOMPONENTDEPLOYMENTIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("lastSuccessfulComponentDeploymentIds"))
    val LASTSUCCESSFULENVIRONMENTDEPLOYMENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("lastSuccessfulEnvironmentDeploymentId"))
    val LASTSUCCESSFULSERVICEPIPELINEDEPLOYMENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("lastSuccessfulServicePipelineDeploymentId"))
    val SPEC_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("spec"))
    val TEMPLATEMAJORVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("templateMajorVersion"))
    val TEMPLATEMINORVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("templateMinorVersion"))
    val TEMPLATENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("templateName"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(LASTSUCCESSFULCOMPONENTDEPLOYMENTIDS_DESCRIPTOR)
        field(LASTSUCCESSFULENVIRONMENTDEPLOYMENTID_DESCRIPTOR)
        field(LASTSUCCESSFULSERVICEPIPELINEDEPLOYMENTID_DESCRIPTOR)
        field(SPEC_DESCRIPTOR)
        field(TEMPLATEMAJORVERSION_DESCRIPTOR)
        field(TEMPLATEMINORVERSION_DESCRIPTOR)
        field(TEMPLATENAME_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                LASTSUCCESSFULCOMPONENTDEPLOYMENTIDS_DESCRIPTOR.index -> builder.lastSuccessfulComponentDeploymentIds =
                    deserializer.deserializeList(LASTSUCCESSFULCOMPONENTDEPLOYMENTIDS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                LASTSUCCESSFULENVIRONMENTDEPLOYMENTID_DESCRIPTOR.index -> builder.lastSuccessfulEnvironmentDeploymentId = deserializeString()
                LASTSUCCESSFULSERVICEPIPELINEDEPLOYMENTID_DESCRIPTOR.index -> builder.lastSuccessfulServicePipelineDeploymentId = deserializeString()
                SPEC_DESCRIPTOR.index -> builder.spec = deserializeString()
                TEMPLATEMAJORVERSION_DESCRIPTOR.index -> builder.templateMajorVersion = deserializeString()
                TEMPLATEMINORVERSION_DESCRIPTOR.index -> builder.templateMinorVersion = deserializeString()
                TEMPLATENAME_DESCRIPTOR.index -> builder.templateName = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy