commonMain.aws.sdk.kotlin.services.cognitosync.serde.IdentityUsageDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cognitosync-jvm Show documentation
Show all versions of cognitosync-jvm Show documentation
The AWS SDK for Kotlin client for Cognito Sync
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cognitosync.serde
import aws.sdk.kotlin.services.cognitosync.model.IdentityUsage
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 deserializeIdentityUsageDocument(deserializer: Deserializer): IdentityUsage {
val builder = IdentityUsage.Builder()
val DATASTORAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("DataStorage"))
val DATASETCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("DatasetCount"))
val IDENTITYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("IdentityId"))
val IDENTITYPOOLID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("IdentityPoolId"))
val LASTMODIFIEDDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastModifiedDate"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DATASTORAGE_DESCRIPTOR)
field(DATASETCOUNT_DESCRIPTOR)
field(IDENTITYID_DESCRIPTOR)
field(IDENTITYPOOLID_DESCRIPTOR)
field(LASTMODIFIEDDATE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
DATASTORAGE_DESCRIPTOR.index -> builder.dataStorage = deserializeLong()
DATASETCOUNT_DESCRIPTOR.index -> builder.datasetCount = deserializeInt()
IDENTITYID_DESCRIPTOR.index -> builder.identityId = deserializeString()
IDENTITYPOOLID_DESCRIPTOR.index -> builder.identityPoolId = deserializeString()
LASTMODIFIEDDATE_DESCRIPTOR.index -> builder.lastModifiedDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}