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

commonMain.aws.sdk.kotlin.services.proton.serde.DeploymentSummaryDocumentDeserializer.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.DeploymentStatus
import aws.sdk.kotlin.services.proton.model.DeploymentSummary
import aws.sdk.kotlin.services.proton.model.DeploymentTargetResourceType
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat

internal fun deserializeDeploymentSummaryDocument(deserializer: Deserializer): DeploymentSummary {
    val builder = DeploymentSummary.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val COMPLETEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("completedAt"))
    val COMPONENTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("componentName"))
    val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
    val DEPLOYMENTSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("deploymentStatus"))
    val ENVIRONMENTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("environmentName"))
    val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("id"))
    val LASTATTEMPTEDDEPLOYMENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("lastAttemptedDeploymentId"))
    val LASTMODIFIEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastModifiedAt"))
    val LASTSUCCEEDEDDEPLOYMENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("lastSucceededDeploymentId"))
    val SERVICEINSTANCENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("serviceInstanceName"))
    val SERVICENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("serviceName"))
    val TARGETARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("targetArn"))
    val TARGETRESOURCECREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("targetResourceCreatedAt"))
    val TARGETRESOURCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("targetResourceType"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(COMPLETEDAT_DESCRIPTOR)
        field(COMPONENTNAME_DESCRIPTOR)
        field(CREATEDAT_DESCRIPTOR)
        field(DEPLOYMENTSTATUS_DESCRIPTOR)
        field(ENVIRONMENTNAME_DESCRIPTOR)
        field(ID_DESCRIPTOR)
        field(LASTATTEMPTEDDEPLOYMENTID_DESCRIPTOR)
        field(LASTMODIFIEDAT_DESCRIPTOR)
        field(LASTSUCCEEDEDDEPLOYMENTID_DESCRIPTOR)
        field(SERVICEINSTANCENAME_DESCRIPTOR)
        field(SERVICENAME_DESCRIPTOR)
        field(TARGETARN_DESCRIPTOR)
        field(TARGETRESOURCECREATEDAT_DESCRIPTOR)
        field(TARGETRESOURCETYPE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                COMPLETEDAT_DESCRIPTOR.index -> builder.completedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                COMPONENTNAME_DESCRIPTOR.index -> builder.componentName = deserializeString()
                CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DEPLOYMENTSTATUS_DESCRIPTOR.index -> builder.deploymentStatus = deserializeString().let { DeploymentStatus.fromValue(it) }
                ENVIRONMENTNAME_DESCRIPTOR.index -> builder.environmentName = deserializeString()
                ID_DESCRIPTOR.index -> builder.id = deserializeString()
                LASTATTEMPTEDDEPLOYMENTID_DESCRIPTOR.index -> builder.lastAttemptedDeploymentId = deserializeString()
                LASTMODIFIEDAT_DESCRIPTOR.index -> builder.lastModifiedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                LASTSUCCEEDEDDEPLOYMENTID_DESCRIPTOR.index -> builder.lastSucceededDeploymentId = deserializeString()
                SERVICEINSTANCENAME_DESCRIPTOR.index -> builder.serviceInstanceName = deserializeString()
                SERVICENAME_DESCRIPTOR.index -> builder.serviceName = deserializeString()
                TARGETARN_DESCRIPTOR.index -> builder.targetArn = deserializeString()
                TARGETRESOURCECREATEDAT_DESCRIPTOR.index -> builder.targetResourceCreatedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                TARGETRESOURCETYPE_DESCRIPTOR.index -> builder.targetResourceType = deserializeString().let { DeploymentTargetResourceType.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy