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

commonMain.aws.sdk.kotlin.services.proton.serde.EnvironmentAccountConnectionSummaryDocumentDeserializer.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.EnvironmentAccountConnectionStatus
import aws.sdk.kotlin.services.proton.model.EnvironmentAccountConnectionSummary
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 deserializeEnvironmentAccountConnectionSummaryDocument(deserializer: Deserializer): EnvironmentAccountConnectionSummary {
    val builder = EnvironmentAccountConnectionSummary.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val COMPONENTROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("componentRoleArn"))
    val ENVIRONMENTACCOUNTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("environmentAccountId"))
    val ENVIRONMENTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("environmentName"))
    val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("id"))
    val LASTMODIFIEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastModifiedAt"))
    val MANAGEMENTACCOUNTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("managementAccountId"))
    val REQUESTEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("requestedAt"))
    val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("roleArn"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(COMPONENTROLEARN_DESCRIPTOR)
        field(ENVIRONMENTACCOUNTID_DESCRIPTOR)
        field(ENVIRONMENTNAME_DESCRIPTOR)
        field(ID_DESCRIPTOR)
        field(LASTMODIFIEDAT_DESCRIPTOR)
        field(MANAGEMENTACCOUNTID_DESCRIPTOR)
        field(REQUESTEDAT_DESCRIPTOR)
        field(ROLEARN_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                COMPONENTROLEARN_DESCRIPTOR.index -> builder.componentRoleArn = deserializeString()
                ENVIRONMENTACCOUNTID_DESCRIPTOR.index -> builder.environmentAccountId = deserializeString()
                ENVIRONMENTNAME_DESCRIPTOR.index -> builder.environmentName = deserializeString()
                ID_DESCRIPTOR.index -> builder.id = deserializeString()
                LASTMODIFIEDAT_DESCRIPTOR.index -> builder.lastModifiedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                MANAGEMENTACCOUNTID_DESCRIPTOR.index -> builder.managementAccountId = deserializeString()
                REQUESTEDAT_DESCRIPTOR.index -> builder.requestedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                ROLEARN_DESCRIPTOR.index -> builder.roleArn = deserializeString()
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { EnvironmentAccountConnectionStatus.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy