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

commonMain.aws.sdk.kotlin.services.datazone.serde.PolicyGrantDetailDocumentDeserializer.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.datazone.serde

import aws.sdk.kotlin.services.datazone.model.PolicyGrantDetail
import aws.smithy.kotlin.runtime.serde.DeserializationException
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.IgnoreKey
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 deserializePolicyGrantDetailDocument(deserializer: Deserializer): PolicyGrantDetail {
    var value: PolicyGrantDetail? = null
    val ADDTOPROJECTMEMBERPOOL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("addToProjectMemberPool"))
    val CREATEASSETTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("createAssetType"))
    val CREATEDOMAINUNIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("createDomainUnit"))
    val CREATEENVIRONMENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("createEnvironment"))
    val CREATEENVIRONMENTPROFILE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("createEnvironmentProfile"))
    val CREATEFORMTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("createFormType"))
    val CREATEGLOSSARY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("createGlossary"))
    val CREATEPROJECT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("createProject"))
    val DELEGATECREATEENVIRONMENTPROFILE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("delegateCreateEnvironmentProfile"))
    val OVERRIDEDOMAINUNITOWNERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("overrideDomainUnitOwners"))
    val OVERRIDEPROJECTOWNERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("overrideProjectOwners"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        trait(IgnoreKey("__type"))
        field(ADDTOPROJECTMEMBERPOOL_DESCRIPTOR)
        field(CREATEASSETTYPE_DESCRIPTOR)
        field(CREATEDOMAINUNIT_DESCRIPTOR)
        field(CREATEENVIRONMENT_DESCRIPTOR)
        field(CREATEENVIRONMENTPROFILE_DESCRIPTOR)
        field(CREATEFORMTYPE_DESCRIPTOR)
        field(CREATEGLOSSARY_DESCRIPTOR)
        field(CREATEPROJECT_DESCRIPTOR)
        field(DELEGATECREATEENVIRONMENTPROFILE_DESCRIPTOR)
        field(OVERRIDEDOMAINUNITOWNERS_DESCRIPTOR)
        field(OVERRIDEPROJECTOWNERS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while(true) {
            when(findNextFieldIndex()) {
                ADDTOPROJECTMEMBERPOOL_DESCRIPTOR.index -> value = PolicyGrantDetail.AddToProjectMemberPool(deserializeAddToProjectMemberPoolPolicyGrantDetailDocument(deserializer))
                CREATEASSETTYPE_DESCRIPTOR.index -> value = PolicyGrantDetail.CreateAssetType(deserializeCreateAssetTypePolicyGrantDetailDocument(deserializer))
                CREATEDOMAINUNIT_DESCRIPTOR.index -> value = PolicyGrantDetail.CreateDomainUnit(deserializeCreateDomainUnitPolicyGrantDetailDocument(deserializer))
                CREATEENVIRONMENT_DESCRIPTOR.index -> value = PolicyGrantDetail.CreateEnvironment(deserializeDataZoneUnitDocument(deserializer))
                CREATEENVIRONMENTPROFILE_DESCRIPTOR.index -> value = PolicyGrantDetail.CreateEnvironmentProfile(deserializeCreateEnvironmentProfilePolicyGrantDetailDocument(deserializer))
                CREATEFORMTYPE_DESCRIPTOR.index -> value = PolicyGrantDetail.CreateFormType(deserializeCreateFormTypePolicyGrantDetailDocument(deserializer))
                CREATEGLOSSARY_DESCRIPTOR.index -> value = PolicyGrantDetail.CreateGlossary(deserializeCreateGlossaryPolicyGrantDetailDocument(deserializer))
                CREATEPROJECT_DESCRIPTOR.index -> value = PolicyGrantDetail.CreateProject(deserializeCreateProjectPolicyGrantDetailDocument(deserializer))
                DELEGATECREATEENVIRONMENTPROFILE_DESCRIPTOR.index -> value = PolicyGrantDetail.DelegateCreateEnvironmentProfile(deserializeDataZoneUnitDocument(deserializer))
                OVERRIDEDOMAINUNITOWNERS_DESCRIPTOR.index -> value = PolicyGrantDetail.OverrideDomainUnitOwners(deserializeOverrideDomainUnitOwnersPolicyGrantDetailDocument(deserializer))
                OVERRIDEPROJECTOWNERS_DESCRIPTOR.index -> value = PolicyGrantDetail.OverrideProjectOwners(deserializeOverrideProjectOwnersPolicyGrantDetailDocument(deserializer))
                null -> break@loop
                else -> value = PolicyGrantDetail.SdkUnknown.also { skipValue() }
            }
        }
    }
    return value ?: throw DeserializationException("Deserialized union value unexpectedly null: PolicyGrantDetail")
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy