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

commonMain.aws.sdk.kotlin.services.snowball.serde.ClusterMetadataDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.snowball.serde

import aws.sdk.kotlin.services.snowball.model.ClusterMetadata
import aws.sdk.kotlin.services.snowball.model.ClusterState
import aws.sdk.kotlin.services.snowball.model.JobType
import aws.sdk.kotlin.services.snowball.model.ShippingOption
import aws.sdk.kotlin.services.snowball.model.SnowballType
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 deserializeClusterMetadataDocument(deserializer: Deserializer): ClusterMetadata {
    val builder = ClusterMetadata.Builder()
    val ADDRESSID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AddressId"))
    val CLUSTERID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ClusterId"))
    val CLUSTERSTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ClusterState"))
    val CREATIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationDate"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
    val FORWARDINGADDRESSID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ForwardingAddressId"))
    val JOBTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("JobType"))
    val KMSKEYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("KmsKeyARN"))
    val NOTIFICATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Notification"))
    val ONDEVICESERVICECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("OnDeviceServiceConfiguration"))
    val RESOURCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Resources"))
    val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RoleARN"))
    val SHIPPINGOPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ShippingOption"))
    val SNOWBALLTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("SnowballType"))
    val TAXDOCUMENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("TaxDocuments"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ADDRESSID_DESCRIPTOR)
        field(CLUSTERID_DESCRIPTOR)
        field(CLUSTERSTATE_DESCRIPTOR)
        field(CREATIONDATE_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(FORWARDINGADDRESSID_DESCRIPTOR)
        field(JOBTYPE_DESCRIPTOR)
        field(KMSKEYARN_DESCRIPTOR)
        field(NOTIFICATION_DESCRIPTOR)
        field(ONDEVICESERVICECONFIGURATION_DESCRIPTOR)
        field(RESOURCES_DESCRIPTOR)
        field(ROLEARN_DESCRIPTOR)
        field(SHIPPINGOPTION_DESCRIPTOR)
        field(SNOWBALLTYPE_DESCRIPTOR)
        field(TAXDOCUMENTS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ADDRESSID_DESCRIPTOR.index -> builder.addressId = deserializeString()
                CLUSTERID_DESCRIPTOR.index -> builder.clusterId = deserializeString()
                CLUSTERSTATE_DESCRIPTOR.index -> builder.clusterState = deserializeString().let { ClusterState.fromValue(it) }
                CREATIONDATE_DESCRIPTOR.index -> builder.creationDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                FORWARDINGADDRESSID_DESCRIPTOR.index -> builder.forwardingAddressId = deserializeString()
                JOBTYPE_DESCRIPTOR.index -> builder.jobType = deserializeString().let { JobType.fromValue(it) }
                KMSKEYARN_DESCRIPTOR.index -> builder.kmsKeyArn = deserializeString()
                NOTIFICATION_DESCRIPTOR.index -> builder.notification = deserializeNotificationDocument(deserializer)
                ONDEVICESERVICECONFIGURATION_DESCRIPTOR.index -> builder.onDeviceServiceConfiguration = deserializeOnDeviceServiceConfigurationDocument(deserializer)
                RESOURCES_DESCRIPTOR.index -> builder.resources = deserializeJobResourceDocument(deserializer)
                ROLEARN_DESCRIPTOR.index -> builder.roleArn = deserializeString()
                SHIPPINGOPTION_DESCRIPTOR.index -> builder.shippingOption = deserializeString().let { ShippingOption.fromValue(it) }
                SNOWBALLTYPE_DESCRIPTOR.index -> builder.snowballType = deserializeString().let { SnowballType.fromValue(it) }
                TAXDOCUMENTS_DESCRIPTOR.index -> builder.taxDocuments = deserializeTaxDocumentsDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy