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

commonMain.aws.sdk.kotlin.services.ssm.serde.ResourceDataSyncS3DestinationDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.ssm.serde

import aws.sdk.kotlin.services.ssm.model.ResourceDataSyncS3Destination
import aws.sdk.kotlin.services.ssm.model.ResourceDataSyncS3Format
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 deserializeResourceDataSyncS3DestinationDocument(deserializer: Deserializer): ResourceDataSyncS3Destination {
    val builder = ResourceDataSyncS3Destination.Builder()
    val AWSKMSKEYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AWSKMSKeyARN"))
    val BUCKETNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("BucketName"))
    val DESTINATIONDATASHARING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DestinationDataSharing"))
    val PREFIX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Prefix"))
    val REGION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Region"))
    val SYNCFORMAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("SyncFormat"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AWSKMSKEYARN_DESCRIPTOR)
        field(BUCKETNAME_DESCRIPTOR)
        field(DESTINATIONDATASHARING_DESCRIPTOR)
        field(PREFIX_DESCRIPTOR)
        field(REGION_DESCRIPTOR)
        field(SYNCFORMAT_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AWSKMSKEYARN_DESCRIPTOR.index -> builder.awskmsKeyArn = deserializeString()
                BUCKETNAME_DESCRIPTOR.index -> builder.bucketName = deserializeString()
                DESTINATIONDATASHARING_DESCRIPTOR.index -> builder.destinationDataSharing = deserializeResourceDataSyncDestinationDataSharingDocument(deserializer)
                PREFIX_DESCRIPTOR.index -> builder.prefix = deserializeString()
                REGION_DESCRIPTOR.index -> builder.region = deserializeString()
                SYNCFORMAT_DESCRIPTOR.index -> builder.syncFormat = deserializeString().let { ResourceDataSyncS3Format.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy