commonMain.aws.sdk.kotlin.services.timestreaminfluxdb.serde.DbInstanceSummaryDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of timestreaminfluxdb-jvm Show documentation
Show all versions of timestreaminfluxdb-jvm Show documentation
The AWS SDK for Kotlin client for Timestream InfluxDB
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.timestreaminfluxdb.serde
import aws.sdk.kotlin.services.timestreaminfluxdb.model.DbInstanceSummary
import aws.sdk.kotlin.services.timestreaminfluxdb.model.DbInstanceType
import aws.sdk.kotlin.services.timestreaminfluxdb.model.DbStorageType
import aws.sdk.kotlin.services.timestreaminfluxdb.model.DeploymentType
import aws.sdk.kotlin.services.timestreaminfluxdb.model.Status
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 deserializeDbInstanceSummaryDocument(deserializer: Deserializer): DbInstanceSummary {
val builder = DbInstanceSummary.Builder()
val ALLOCATEDSTORAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("allocatedStorage"))
val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
val DBINSTANCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("dbInstanceType"))
val DBSTORAGETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("dbStorageType"))
val DEPLOYMENTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("deploymentType"))
val ENDPOINT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("endpoint"))
val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("id"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("status"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ALLOCATEDSTORAGE_DESCRIPTOR)
field(ARN_DESCRIPTOR)
field(DBINSTANCETYPE_DESCRIPTOR)
field(DBSTORAGETYPE_DESCRIPTOR)
field(DEPLOYMENTTYPE_DESCRIPTOR)
field(ENDPOINT_DESCRIPTOR)
field(ID_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ALLOCATEDSTORAGE_DESCRIPTOR.index -> builder.allocatedStorage = deserializeInt()
ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
DBINSTANCETYPE_DESCRIPTOR.index -> builder.dbInstanceType = deserializeString().let { DbInstanceType.fromValue(it) }
DBSTORAGETYPE_DESCRIPTOR.index -> builder.dbStorageType = deserializeString().let { DbStorageType.fromValue(it) }
DEPLOYMENTTYPE_DESCRIPTOR.index -> builder.deploymentType = deserializeString().let { DeploymentType.fromValue(it) }
ENDPOINT_DESCRIPTOR.index -> builder.endpoint = deserializeString()
ID_DESCRIPTOR.index -> builder.id = deserializeString()
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { Status.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}