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

commonMain.aws.sdk.kotlin.services.finspacedata.serde.UserByPermissionGroupDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.finspacedata.serde

import aws.sdk.kotlin.services.finspacedata.model.ApiAccess
import aws.sdk.kotlin.services.finspacedata.model.PermissionGroupMembershipStatus
import aws.sdk.kotlin.services.finspacedata.model.UserByPermissionGroup
import aws.sdk.kotlin.services.finspacedata.model.UserStatus
import aws.sdk.kotlin.services.finspacedata.model.UserType
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 deserializeUserByPermissionGroupDocument(deserializer: Deserializer): UserByPermissionGroup {
    val builder = UserByPermissionGroup.Builder()
    val APIACCESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("apiAccess"))
    val APIACCESSPRINCIPALARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("apiAccessPrincipalArn"))
    val EMAILADDRESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("emailAddress"))
    val FIRSTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("firstName"))
    val LASTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("lastName"))
    val MEMBERSHIPSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("membershipStatus"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("status"))
    val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("type"))
    val USERID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("userId"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(APIACCESS_DESCRIPTOR)
        field(APIACCESSPRINCIPALARN_DESCRIPTOR)
        field(EMAILADDRESS_DESCRIPTOR)
        field(FIRSTNAME_DESCRIPTOR)
        field(LASTNAME_DESCRIPTOR)
        field(MEMBERSHIPSTATUS_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(TYPE_DESCRIPTOR)
        field(USERID_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                APIACCESS_DESCRIPTOR.index -> builder.apiAccess = deserializeString().let { ApiAccess.fromValue(it) }
                APIACCESSPRINCIPALARN_DESCRIPTOR.index -> builder.apiAccessPrincipalArn = deserializeString()
                EMAILADDRESS_DESCRIPTOR.index -> builder.emailAddress = deserializeString()
                FIRSTNAME_DESCRIPTOR.index -> builder.firstName = deserializeString()
                LASTNAME_DESCRIPTOR.index -> builder.lastName = deserializeString()
                MEMBERSHIPSTATUS_DESCRIPTOR.index -> builder.membershipStatus = deserializeString().let { PermissionGroupMembershipStatus.fromValue(it) }
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { UserStatus.fromValue(it) }
                TYPE_DESCRIPTOR.index -> builder.type = deserializeString().let { UserType.fromValue(it) }
                USERID_DESCRIPTOR.index -> builder.userId = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy