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

com.pulumi.awsnative.wisdom.kotlin.KnowledgeBase.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.wisdom.kotlin

import com.pulumi.awsnative.kotlin.outputs.CreateOnlyTag
import com.pulumi.awsnative.wisdom.kotlin.enums.KnowledgeBaseType
import com.pulumi.awsnative.wisdom.kotlin.outputs.KnowledgeBaseRenderingConfiguration
import com.pulumi.awsnative.wisdom.kotlin.outputs.KnowledgeBaseServerSideEncryptionConfiguration
import com.pulumi.awsnative.wisdom.kotlin.outputs.KnowledgeBaseSourceConfiguration
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.kotlin.outputs.CreateOnlyTag.Companion.toKotlin as createOnlyTagToKotlin
import com.pulumi.awsnative.wisdom.kotlin.enums.KnowledgeBaseType.Companion.toKotlin as knowledgeBaseTypeToKotlin
import com.pulumi.awsnative.wisdom.kotlin.outputs.KnowledgeBaseRenderingConfiguration.Companion.toKotlin as knowledgeBaseRenderingConfigurationToKotlin
import com.pulumi.awsnative.wisdom.kotlin.outputs.KnowledgeBaseServerSideEncryptionConfiguration.Companion.toKotlin as knowledgeBaseServerSideEncryptionConfigurationToKotlin
import com.pulumi.awsnative.wisdom.kotlin.outputs.KnowledgeBaseSourceConfiguration.Companion.toKotlin as knowledgeBaseSourceConfigurationToKotlin

/**
 * Builder for [KnowledgeBase].
 */
@PulumiTagMarker
public class KnowledgeBaseResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: KnowledgeBaseArgs = KnowledgeBaseArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend KnowledgeBaseArgsBuilder.() -> Unit) {
        val builder = KnowledgeBaseArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): KnowledgeBase {
        val builtJavaResource = com.pulumi.awsnative.wisdom.KnowledgeBase(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return KnowledgeBase(builtJavaResource)
    }
}

/**
 * Definition of AWS::Wisdom::KnowledgeBase Resource Type
 */
public class KnowledgeBase internal constructor(
    override val javaResource: com.pulumi.awsnative.wisdom.KnowledgeBase,
) : KotlinCustomResource(javaResource, KnowledgeBaseMapper) {
    /**
     * The description.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) of the knowledge base.
     */
    public val knowledgeBaseArn: Output
        get() = javaResource.knowledgeBaseArn().applyValue({ args0 -> args0 })

    /**
     * The ID of the knowledge base.
     */
    public val knowledgeBaseId: Output
        get() = javaResource.knowledgeBaseId().applyValue({ args0 -> args0 })

    /**
     * The type of knowledge base. Only CUSTOM knowledge bases allow you to upload your own content. EXTERNAL knowledge bases support integrations with third-party systems whose content is synchronized automatically.
     */
    public val knowledgeBaseType: Output
        get() = javaResource.knowledgeBaseType().applyValue({ args0 ->
            args0.let({ args0 ->
                knowledgeBaseTypeToKotlin(args0)
            })
        })

    /**
     * The name of the knowledge base.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Information about how to render the content.
     */
    public val renderingConfiguration: Output?
        get() = javaResource.renderingConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> knowledgeBaseRenderingConfigurationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * This customer managed key must have a policy that allows `kms:CreateGrant` and `kms:DescribeKey` permissions to the IAM identity using the key to invoke Wisdom. For more information about setting up a customer managed key for Wisdom, see [Enable Amazon Connect Wisdom for your instance](https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html) . For information about valid ID values, see [Key identifiers (KeyId)](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id) in the *AWS Key Management Service Developer Guide* .
     */
    public val serverSideEncryptionConfiguration:
        Output?
        get() = javaResource.serverSideEncryptionConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    knowledgeBaseServerSideEncryptionConfigurationToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The source of the knowledge base content. Only set this argument for EXTERNAL knowledge bases.
     */
    public val sourceConfiguration: Output?
        get() = javaResource.sourceConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> knowledgeBaseSourceConfigurationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The tags used to organize, track, or control access for this resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> createOnlyTagToKotlin(args0) })
                })
            }).orElse(null)
        })
}

public object KnowledgeBaseMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.wisdom.KnowledgeBase::class == javaResource::class

    override fun map(javaResource: Resource): KnowledgeBase = KnowledgeBase(
        javaResource as
            com.pulumi.awsnative.wisdom.KnowledgeBase,
    )
}

/**
 * @see [KnowledgeBase].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [KnowledgeBase].
 */
public suspend fun knowledgeBase(
    name: String,
    block: suspend KnowledgeBaseResourceBuilder.() -> Unit,
): KnowledgeBase {
    val builder = KnowledgeBaseResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [KnowledgeBase].
 * @param name The _unique_ name of the resulting resource.
 */
public fun knowledgeBase(name: String): KnowledgeBase {
    val builder = KnowledgeBaseResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy