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

commonMain.aws.sdk.kotlin.services.pinpointemail.serde.DomainDeliverabilityCampaignDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.77
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.pinpointemail.serde

import aws.sdk.kotlin.services.pinpointemail.model.DomainDeliverabilityCampaign
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
import kotlin.collections.mutableListOf

internal fun deserializeDomainDeliverabilityCampaignDocument(deserializer: Deserializer): DomainDeliverabilityCampaign {
    val builder = DomainDeliverabilityCampaign.Builder()
    val CAMPAIGNID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CampaignId"))
    val DELETERATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("DeleteRate"))
    val ESPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Esps"))
    val FIRSTSEENDATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("FirstSeenDateTime"))
    val FROMADDRESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FromAddress"))
    val IMAGEURL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ImageUrl"))
    val INBOXCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("InboxCount"))
    val LASTSEENDATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastSeenDateTime"))
    val PROJECTEDVOLUME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("ProjectedVolume"))
    val READDELETERATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("ReadDeleteRate"))
    val READRATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Double, JsonSerialName("ReadRate"))
    val SENDINGIPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("SendingIps"))
    val SPAMCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("SpamCount"))
    val SUBJECT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Subject"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CAMPAIGNID_DESCRIPTOR)
        field(DELETERATE_DESCRIPTOR)
        field(ESPS_DESCRIPTOR)
        field(FIRSTSEENDATETIME_DESCRIPTOR)
        field(FROMADDRESS_DESCRIPTOR)
        field(IMAGEURL_DESCRIPTOR)
        field(INBOXCOUNT_DESCRIPTOR)
        field(LASTSEENDATETIME_DESCRIPTOR)
        field(PROJECTEDVOLUME_DESCRIPTOR)
        field(READDELETERATE_DESCRIPTOR)
        field(READRATE_DESCRIPTOR)
        field(SENDINGIPS_DESCRIPTOR)
        field(SPAMCOUNT_DESCRIPTOR)
        field(SUBJECT_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CAMPAIGNID_DESCRIPTOR.index -> builder.campaignId = deserializeString()
                DELETERATE_DESCRIPTOR.index -> builder.deleteRate = deserializeDouble()
                ESPS_DESCRIPTOR.index -> builder.esps =
                    deserializer.deserializeList(ESPS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                FIRSTSEENDATETIME_DESCRIPTOR.index -> builder.firstSeenDateTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                FROMADDRESS_DESCRIPTOR.index -> builder.fromAddress = deserializeString()
                IMAGEURL_DESCRIPTOR.index -> builder.imageUrl = deserializeString()
                INBOXCOUNT_DESCRIPTOR.index -> builder.inboxCount = deserializeLong()
                LASTSEENDATETIME_DESCRIPTOR.index -> builder.lastSeenDateTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                PROJECTEDVOLUME_DESCRIPTOR.index -> builder.projectedVolume = deserializeLong()
                READDELETERATE_DESCRIPTOR.index -> builder.readDeleteRate = deserializeDouble()
                READRATE_DESCRIPTOR.index -> builder.readRate = deserializeDouble()
                SENDINGIPS_DESCRIPTOR.index -> builder.sendingIps =
                    deserializer.deserializeList(SENDINGIPS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                SPAMCOUNT_DESCRIPTOR.index -> builder.spamCount = deserializeLong()
                SUBJECT_DESCRIPTOR.index -> builder.subject = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy