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

commonMain.aws.sdk.kotlin.services.freetier.serde.FreeTierUsageDocumentDeserializer.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.freetier.serde

import aws.sdk.kotlin.services.freetier.model.FreeTierUsage
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 deserializeFreeTierUsageDocument(deserializer: Deserializer): FreeTierUsage {
    val builder = FreeTierUsage.Builder()
    val ACTUALUSAGEAMOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("actualUsageAmount"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("description"))
    val FORECASTEDUSAGEAMOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("forecastedUsageAmount"))
    val FREETIERTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("freeTierType"))
    val LIMIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("limit"))
    val OPERATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("operation"))
    val REGION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("region"))
    val SERVICE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("service"))
    val UNIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("unit"))
    val USAGETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("usageType"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACTUALUSAGEAMOUNT_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(FORECASTEDUSAGEAMOUNT_DESCRIPTOR)
        field(FREETIERTYPE_DESCRIPTOR)
        field(LIMIT_DESCRIPTOR)
        field(OPERATION_DESCRIPTOR)
        field(REGION_DESCRIPTOR)
        field(SERVICE_DESCRIPTOR)
        field(UNIT_DESCRIPTOR)
        field(USAGETYPE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ACTUALUSAGEAMOUNT_DESCRIPTOR.index -> builder.actualUsageAmount = deserializeDouble()
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                FORECASTEDUSAGEAMOUNT_DESCRIPTOR.index -> builder.forecastedUsageAmount = deserializeDouble()
                FREETIERTYPE_DESCRIPTOR.index -> builder.freeTierType = deserializeString()
                LIMIT_DESCRIPTOR.index -> builder.limit = deserializeDouble()
                OPERATION_DESCRIPTOR.index -> builder.operation = deserializeString()
                REGION_DESCRIPTOR.index -> builder.region = deserializeString()
                SERVICE_DESCRIPTOR.index -> builder.service = deserializeString()
                UNIT_DESCRIPTOR.index -> builder.unit = deserializeString()
                USAGETYPE_DESCRIPTOR.index -> builder.usageType = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy