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

commonMain.aws.sdk.kotlin.services.devicefarm.serde.NetworkProfileDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.devicefarm.serde

import aws.sdk.kotlin.services.devicefarm.model.NetworkProfile
import aws.sdk.kotlin.services.devicefarm.model.NetworkProfileType
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 deserializeNetworkProfileDocument(deserializer: Deserializer): NetworkProfile {
    val builder = NetworkProfile.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("description"))
    val DOWNLINKBANDWIDTHBITS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("downlinkBandwidthBits"))
    val DOWNLINKDELAYMS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("downlinkDelayMs"))
    val DOWNLINKJITTERMS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("downlinkJitterMs"))
    val DOWNLINKLOSSPERCENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("downlinkLossPercent"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("type"))
    val UPLINKBANDWIDTHBITS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("uplinkBandwidthBits"))
    val UPLINKDELAYMS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("uplinkDelayMs"))
    val UPLINKJITTERMS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("uplinkJitterMs"))
    val UPLINKLOSSPERCENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("uplinkLossPercent"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(DOWNLINKBANDWIDTHBITS_DESCRIPTOR)
        field(DOWNLINKDELAYMS_DESCRIPTOR)
        field(DOWNLINKJITTERMS_DESCRIPTOR)
        field(DOWNLINKLOSSPERCENT_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(TYPE_DESCRIPTOR)
        field(UPLINKBANDWIDTHBITS_DESCRIPTOR)
        field(UPLINKDELAYMS_DESCRIPTOR)
        field(UPLINKJITTERMS_DESCRIPTOR)
        field(UPLINKLOSSPERCENT_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                DOWNLINKBANDWIDTHBITS_DESCRIPTOR.index -> builder.downlinkBandwidthBits = deserializeLong()
                DOWNLINKDELAYMS_DESCRIPTOR.index -> builder.downlinkDelayMs = deserializeLong()
                DOWNLINKJITTERMS_DESCRIPTOR.index -> builder.downlinkJitterMs = deserializeLong()
                DOWNLINKLOSSPERCENT_DESCRIPTOR.index -> builder.downlinkLossPercent = deserializeInt()
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                TYPE_DESCRIPTOR.index -> builder.type = deserializeString().let { NetworkProfileType.fromValue(it) }
                UPLINKBANDWIDTHBITS_DESCRIPTOR.index -> builder.uplinkBandwidthBits = deserializeLong()
                UPLINKDELAYMS_DESCRIPTOR.index -> builder.uplinkDelayMs = deserializeLong()
                UPLINKJITTERMS_DESCRIPTOR.index -> builder.uplinkJitterMs = deserializeLong()
                UPLINKLOSSPERCENT_DESCRIPTOR.index -> builder.uplinkLossPercent = deserializeInt()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy