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

commonMain.aws.sdk.kotlin.services.qbusiness.model.PrincipalUser.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.qbusiness.model



/**
 * Provides information about a user associated with a principal.
 */
public class PrincipalUser private constructor(builder: Builder) {
    /**
     * Provides information about whether to allow or deny access to the principal.
     */
    public val access: aws.sdk.kotlin.services.qbusiness.model.ReadAccessType = requireNotNull(builder.access) { "A non-null value must be provided for access" }
    /**
     * The identifier of the user.
     */
    public val id: kotlin.String? = builder.id
    /**
     * The type of group.
     */
    public val membershipType: aws.sdk.kotlin.services.qbusiness.model.MembershipType? = builder.membershipType

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

    override fun toString(): kotlin.String = buildString {
        append("PrincipalUser(")
        append("access=$access,")
        append("id=$id,")
        append("membershipType=$membershipType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = access.hashCode()
        result = 31 * result + (id?.hashCode() ?: 0)
        result = 31 * result + (membershipType?.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 PrincipalUser

        if (access != other.access) return false
        if (id != other.id) return false
        if (membershipType != other.membershipType) return false

        return true
    }

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

    public class Builder {
        /**
         * Provides information about whether to allow or deny access to the principal.
         */
        public var access: aws.sdk.kotlin.services.qbusiness.model.ReadAccessType? = null
        /**
         * The identifier of the user.
         */
        public var id: kotlin.String? = null
        /**
         * The type of group.
         */
        public var membershipType: aws.sdk.kotlin.services.qbusiness.model.MembershipType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.qbusiness.model.PrincipalUser) : this() {
            this.access = x.access
            this.id = x.id
            this.membershipType = x.membershipType
        }

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

        internal fun correctErrors(): Builder {
            if (access == null) access = ReadAccessType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy