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

commonMain.aws.sdk.kotlin.services.quicksight.model.ResourcePermission.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.quicksight.model



/**
 * Permission for the resource.
 */
class ResourcePermission private constructor(builder: Builder) {
    /**
     * The IAM action to grant or revoke permissions on.
     */
    val actions: List? = builder.actions
    /**
     * The Amazon Resource Name (ARN) of the principal. This can be one of the following:
     * + The ARN of an Amazon QuickSight user or group associated with a data source or dataset. (This is common.)
     * + The ARN of an Amazon QuickSight user, group, or namespace associated with an analysis, dashboard, template, or theme. (This is common.)
     * + The ARN of an Amazon Web Services account root: This is an IAM ARN rather than a QuickSight ARN. Use this option only to share resources (templates) across Amazon Web Services accounts. (This is less common.)
     */
    val principal: kotlin.String? = builder.principal

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

    override fun toString(): kotlin.String = buildString {
        append("ResourcePermission(")
        append("actions=$actions,")
        append("principal=$principal)")
    }

    override fun hashCode(): kotlin.Int {
        var result = actions?.hashCode() ?: 0
        result = 31 * result + (principal?.hashCode() ?: 0)
        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 ResourcePermission

        if (actions != other.actions) return false
        if (principal != other.principal) return false

        return true
    }

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

    class Builder {
        /**
         * The IAM action to grant or revoke permissions on.
         */
        var actions: List? = null
        /**
         * The Amazon Resource Name (ARN) of the principal. This can be one of the following:
         * + The ARN of an Amazon QuickSight user or group associated with a data source or dataset. (This is common.)
         * + The ARN of an Amazon QuickSight user, group, or namespace associated with an analysis, dashboard, template, or theme. (This is common.)
         * + The ARN of an Amazon Web Services account root: This is an IAM ARN rather than a QuickSight ARN. Use this option only to share resources (templates) across Amazon Web Services accounts. (This is less common.)
         */
        var principal: kotlin.String? = null

        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.quicksight.model.ResourcePermission) : this() {
            this.actions = x.actions
            this.principal = x.principal
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.quicksight.model.ResourcePermission = ResourcePermission(this)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy