commonMain.aws.sdk.kotlin.services.backupgateway.serde.BandwidthRateLimitIntervalDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of backupgateway-jvm Show documentation
Show all versions of backupgateway-jvm Show documentation
The AWS SDK for Kotlin client for Backup Gateway
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.backupgateway.serde
import aws.sdk.kotlin.services.backupgateway.model.BandwidthRateLimitInterval
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 kotlin.collections.mutableListOf
internal fun deserializeBandwidthRateLimitIntervalDocument(deserializer: Deserializer): BandwidthRateLimitInterval {
val builder = BandwidthRateLimitInterval.Builder()
val AVERAGEUPLOADRATELIMITINBITSPERSEC_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("AverageUploadRateLimitInBitsPerSec"))
val DAYSOFWEEK_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DaysOfWeek"))
val ENDHOUROFDAY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("EndHourOfDay"))
val ENDMINUTEOFHOUR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("EndMinuteOfHour"))
val STARTHOUROFDAY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("StartHourOfDay"))
val STARTMINUTEOFHOUR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("StartMinuteOfHour"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(AVERAGEUPLOADRATELIMITINBITSPERSEC_DESCRIPTOR)
field(DAYSOFWEEK_DESCRIPTOR)
field(ENDHOUROFDAY_DESCRIPTOR)
field(ENDMINUTEOFHOUR_DESCRIPTOR)
field(STARTHOUROFDAY_DESCRIPTOR)
field(STARTMINUTEOFHOUR_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
AVERAGEUPLOADRATELIMITINBITSPERSEC_DESCRIPTOR.index -> builder.averageUploadRateLimitInBitsPerSec = deserializeLong()
DAYSOFWEEK_DESCRIPTOR.index -> builder.daysOfWeek =
deserializer.deserializeList(DAYSOFWEEK_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeInt() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
ENDHOUROFDAY_DESCRIPTOR.index -> builder.endHourOfDay = deserializeInt()
ENDMINUTEOFHOUR_DESCRIPTOR.index -> builder.endMinuteOfHour = deserializeInt()
STARTHOUROFDAY_DESCRIPTOR.index -> builder.startHourOfDay = deserializeInt()
STARTMINUTEOFHOUR_DESCRIPTOR.index -> builder.startMinuteOfHour = deserializeInt()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}