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

commonMain.aws.sdk.kotlin.services.nimble.serde.StudioDocumentDeserializer.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.nimble.serde

import aws.sdk.kotlin.services.nimble.model.Studio
import aws.sdk.kotlin.services.nimble.model.StudioState
import aws.sdk.kotlin.services.nimble.model.StudioStatusCode
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.mutableMapOf

internal fun deserializeStudioDocument(deserializer: Deserializer): Studio {
    val builder = Studio.Builder()
    val ADMINROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("adminRoleArn"))
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
    val DISPLAYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("displayName"))
    val HOMEREGION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("homeRegion"))
    val SSOCLIENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ssoClientId"))
    val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("state"))
    val STATUSCODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("statusCode"))
    val STATUSMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("statusMessage"))
    val STUDIOENCRYPTIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("studioEncryptionConfiguration"))
    val STUDIOID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("studioId"))
    val STUDIONAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("studioName"))
    val STUDIOURL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("studioUrl"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("tags"))
    val UPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("updatedAt"))
    val USERROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("userRoleArn"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ADMINROLEARN_DESCRIPTOR)
        field(ARN_DESCRIPTOR)
        field(CREATEDAT_DESCRIPTOR)
        field(DISPLAYNAME_DESCRIPTOR)
        field(HOMEREGION_DESCRIPTOR)
        field(SSOCLIENTID_DESCRIPTOR)
        field(STATE_DESCRIPTOR)
        field(STATUSCODE_DESCRIPTOR)
        field(STATUSMESSAGE_DESCRIPTOR)
        field(STUDIOENCRYPTIONCONFIGURATION_DESCRIPTOR)
        field(STUDIOID_DESCRIPTOR)
        field(STUDIONAME_DESCRIPTOR)
        field(STUDIOURL_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
        field(UPDATEDAT_DESCRIPTOR)
        field(USERROLEARN_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ADMINROLEARN_DESCRIPTOR.index -> builder.adminRoleArn = deserializeString()
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.ISO_8601)
                DISPLAYNAME_DESCRIPTOR.index -> builder.displayName = deserializeString()
                HOMEREGION_DESCRIPTOR.index -> builder.homeRegion = deserializeString()
                SSOCLIENTID_DESCRIPTOR.index -> builder.ssoClientId = deserializeString()
                STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { StudioState.fromValue(it) }
                STATUSCODE_DESCRIPTOR.index -> builder.statusCode = deserializeString().let { StudioStatusCode.fromValue(it) }
                STATUSMESSAGE_DESCRIPTOR.index -> builder.statusMessage = deserializeString()
                STUDIOENCRYPTIONCONFIGURATION_DESCRIPTOR.index -> builder.studioEncryptionConfiguration = deserializeStudioEncryptionConfigurationDocument(deserializer)
                STUDIOID_DESCRIPTOR.index -> builder.studioId = deserializeString()
                STUDIONAME_DESCRIPTOR.index -> builder.studioName = deserializeString()
                STUDIOURL_DESCRIPTOR.index -> builder.studioUrl = deserializeString()
                TAGS_DESCRIPTOR.index -> builder.tags =
                    deserializer.deserializeMap(TAGS_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                UPDATEDAT_DESCRIPTOR.index -> builder.updatedAt = deserializeInstant(TimestampFormat.ISO_8601)
                USERROLEARN_DESCRIPTOR.index -> builder.userRoleArn = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy