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

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

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

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



/**
 * Provides the configuration information for users or groups in your IAM Identity Center identity source to grant access your Amazon Kendra experience.
 */
public class EntityConfiguration private constructor(builder: Builder) {
    /**
     * The identifier of a user or group in your IAM Identity Center identity source. For example, a user ID could be an email.
     */
    public val entityId: kotlin.String = requireNotNull(builder.entityId) { "A non-null value must be provided for entityId" }
    /**
     * Specifies whether you are configuring a `User` or a `Group`.
     */
    public val entityType: aws.sdk.kotlin.services.kendra.model.EntityType = requireNotNull(builder.entityType) { "A non-null value must be provided for entityType" }

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

    override fun toString(): kotlin.String = buildString {
        append("EntityConfiguration(")
        append("entityId=$entityId,")
        append("entityType=$entityType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = entityId.hashCode()
        result = 31 * result + (entityType.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 EntityConfiguration

        if (entityId != other.entityId) return false
        if (entityType != other.entityType) return false

        return true
    }

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

    public class Builder {
        /**
         * The identifier of a user or group in your IAM Identity Center identity source. For example, a user ID could be an email.
         */
        public var entityId: kotlin.String? = null
        /**
         * Specifies whether you are configuring a `User` or a `Group`.
         */
        public var entityType: aws.sdk.kotlin.services.kendra.model.EntityType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.kendra.model.EntityConfiguration) : this() {
            this.entityId = x.entityId
            this.entityType = x.entityType
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy