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

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

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

package com.pulumi.awsnative.bedrock.kotlin

import com.pulumi.awsnative.bedrock.kotlin.enums.KnowledgeBaseStatus
import com.pulumi.awsnative.bedrock.kotlin.outputs.KnowledgeBaseConfiguration
import com.pulumi.awsnative.bedrock.kotlin.outputs.KnowledgeBaseStorageConfiguration
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 kotlin.collections.Map
import com.pulumi.awsnative.bedrock.kotlin.enums.KnowledgeBaseStatus.Companion.toKotlin as knowledgeBaseStatusToKotlin
import com.pulumi.awsnative.bedrock.kotlin.outputs.KnowledgeBaseConfiguration.Companion.toKotlin as knowledgeBaseConfigurationToKotlin
import com.pulumi.awsnative.bedrock.kotlin.outputs.KnowledgeBaseStorageConfiguration.Companion.toKotlin as knowledgeBaseStorageConfigurationToKotlin

/**
 * 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.bedrock.KnowledgeBase(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return KnowledgeBase(builtJavaResource)
    }
}

/**
 * Definition of AWS::Bedrock::KnowledgeBase Resource Type
 */
public class KnowledgeBase internal constructor(
    override val javaResource: com.pulumi.awsnative.bedrock.KnowledgeBase,
) : KotlinCustomResource(javaResource, KnowledgeBaseMapper) {
    /**
     * The time at which the knowledge base was created.
     */
    public val createdAt: Output
        get() = javaResource.createdAt().applyValue({ args0 -> args0 })

    /**
     * Description of the Resource.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A list of reasons that the API operation on the knowledge base failed.
     */
    public val failureReasons: Output>
        get() = javaResource.failureReasons().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

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

    /**
     * Contains details about the embeddings configuration of the knowledge base.
     */
    public val knowledgeBaseConfiguration: Output
        get() = javaResource.knowledgeBaseConfiguration().applyValue({ args0 ->
            args0.let({ args0 ->
                knowledgeBaseConfigurationToKotlin(args0)
            })
        })

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

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

    /**
     * The ARN of the IAM role with permissions to invoke API operations on the knowledge base. The ARN must begin with AmazonBedrockExecutionRoleForKnowledgeBase_
     */
    public val roleArn: Output
        get() = javaResource.roleArn().applyValue({ args0 -> args0 })

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

    /**
     * Contains details about the storage configuration of the knowledge base.
     */
    public val storageConfiguration: Output
        get() = javaResource.storageConfiguration().applyValue({ args0 ->
            args0.let({ args0 ->
                knowledgeBaseStorageConfigurationToKotlin(args0)
            })
        })

    /**
     * Metadata that you can assign to a resource as key-value pairs. For more information, see the following resources:
     * - [Tag naming limits and requirements](https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html#tag-conventions)
     * - [Tagging best practices](https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html#tag-best-practices)
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The time at which the knowledge base was last updated.
     */
    public val updatedAt: Output
        get() = javaResource.updatedAt().applyValue({ args0 -> args0 })
}

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

    override fun map(javaResource: Resource): KnowledgeBase = KnowledgeBase(
        javaResource as
            com.pulumi.awsnative.bedrock.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