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

com.pulumi.awsnative.kendra.kotlin.DataSource.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 1.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.kendra.kotlin

import com.pulumi.awsnative.kendra.kotlin.enums.DataSourceType
import com.pulumi.awsnative.kendra.kotlin.outputs.DataSourceConfiguration
import com.pulumi.awsnative.kendra.kotlin.outputs.DataSourceCustomDocumentEnrichmentConfiguration
import com.pulumi.awsnative.kotlin.outputs.Tag
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.kendra.kotlin.enums.DataSourceType.Companion.toKotlin as dataSourceTypeToKotlin
import com.pulumi.awsnative.kendra.kotlin.outputs.DataSourceConfiguration.Companion.toKotlin as dataSourceConfigurationToKotlin
import com.pulumi.awsnative.kendra.kotlin.outputs.DataSourceCustomDocumentEnrichmentConfiguration.Companion.toKotlin as dataSourceCustomDocumentEnrichmentConfigurationToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: DataSourceArgs = DataSourceArgs()

    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 DataSourceArgsBuilder.() -> Unit) {
        val builder = DataSourceArgsBuilder()
        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(): DataSource {
        val builtJavaResource = com.pulumi.awsnative.kendra.DataSource(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return DataSource(builtJavaResource)
    }
}

/**
 * Kendra DataSource
 */
public class DataSource internal constructor(
    override val javaResource: com.pulumi.awsnative.kendra.DataSource,
) : KotlinCustomResource(javaResource, DataSourceMapper) {
    /**
     * The Amazon Resource Name (ARN) of the data source. For example:
     * `arn:aws:kendra:us-west-2:111122223333:index/335c3741-41df-46a6-b5d3-61f85b787884/data-source/b8cae438-6787-4091-8897-684a652bbb0a`
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The identifier for the data source. For example:
     * `b8cae438-6787-4091-8897-684a652bbb0a` .
     */
    public val awsId: Output
        get() = javaResource.awsId().applyValue({ args0 -> args0 })

    /**
     * Configuration information for altering document metadata and content during the document ingestion process.
     */
    public val customDocumentEnrichmentConfiguration:
        Output?
        get() = javaResource.customDocumentEnrichmentConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    dataSourceCustomDocumentEnrichmentConfigurationToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Configuration information for an Amazon Kendra data source. The contents of the configuration depend on the type of data source. You can only specify one type of data source in the configuration.
     * You can't specify the `Configuration` parameter when the `Type` parameter is set to `CUSTOM` .
     * The `Configuration` parameter is required for all other data sources.
     */
    public val dataSourceConfiguration: Output?
        get() = javaResource.dataSourceConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> dataSourceConfigurationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * A description for the data source connector.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The identifier of the index you want to use with the data source connector.
     */
    public val indexId: Output
        get() = javaResource.indexId().applyValue({ args0 -> args0 })

    /**
     * The code for a language. This shows a supported language for all documents in the data source. English is supported by default. For more information on supported languages, including their codes, see [Adding documents in languages other than English](https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html) .
     */
    public val languageCode: Output?
        get() = javaResource.languageCode().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

    /**
     * The Amazon Resource Name (ARN) of a role with permission to access the data source.
     * You can't specify the `RoleArn` parameter when the `Type` parameter is set to `CUSTOM` .
     * The `RoleArn` parameter is required for all other data sources.
     */
    public val roleArn: Output?
        get() = javaResource.roleArn().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Sets the frequency that Amazon Kendra checks the documents in your data source and updates the index. If you don't set a schedule, Amazon Kendra doesn't periodically update the index.
     */
    public val schedule: Output?
        get() = javaResource.schedule().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Tags for labeling the data source
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The type of the data source.
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 ->
            args0.let({ args0 ->
                dataSourceTypeToKotlin(args0)
            })
        })
}

public object DataSourceMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.kendra.DataSource::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy