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

commonMain.aws.sdk.kotlin.services.kendra.model.HierarchicalPrincipal.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.kendra.model



/**
 * Information to define the hierarchy for which documents users should have access to.
 */
public class HierarchicalPrincipal private constructor(builder: Builder) {
    /**
     * A list of [principal](https://docs.aws.amazon.com/kendra/latest/dg/API_Principal.html) lists that define the hierarchy for which documents users should have access to. Each hierarchical list specifies which user or group has allow or deny access for each document.
     */
    public val principalList: List = requireNotNull(builder.principalList) { "A non-null value must be provided for principalList" }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.kendra.model.HierarchicalPrincipal = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("HierarchicalPrincipal(")
        append("principalList=$principalList")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = principalList.hashCode()
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as HierarchicalPrincipal

        if (principalList != other.principalList) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.kendra.model.HierarchicalPrincipal = Builder(this).apply(block).build()

    public class Builder {
        /**
         * A list of [principal](https://docs.aws.amazon.com/kendra/latest/dg/API_Principal.html) lists that define the hierarchy for which documents users should have access to. Each hierarchical list specifies which user or group has allow or deny access for each document.
         */
        public var principalList: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.kendra.model.HierarchicalPrincipal) : this() {
            this.principalList = x.principalList
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.kendra.model.HierarchicalPrincipal = HierarchicalPrincipal(this)

        internal fun correctErrors(): Builder {
            if (principalList == null) principalList = emptyList()
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy