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

com.pulumi.awsnative.athena.kotlin.DataCatalog.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.athena.kotlin

import com.pulumi.awsnative.athena.kotlin.enums.DataCatalogType
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 kotlin.collections.Map
import com.pulumi.awsnative.athena.kotlin.enums.DataCatalogType.Companion.toKotlin as dataCatalogTypeToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: DataCatalogArgs = DataCatalogArgs()

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

/**
 * Resource schema for AWS::Athena::DataCatalog
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 */
public class DataCatalog internal constructor(
    override val javaResource: com.pulumi.awsnative.athena.DataCatalog,
) : KotlinCustomResource(javaResource, DataCatalogMapper) {
    /**
     * A description of the data catalog to be created.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the data catalog to create. The catalog name must be unique for the AWS account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Specifies the Lambda function or functions to use for creating the data catalog. This is a mapping whose values depend on the catalog type.
     */
    public val parameters: Output>?
        get() = javaResource.parameters().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * A list of comma separated tags to add to the data catalog that is created.
     */
    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 data catalog to create: LAMBDA for a federated catalog, GLUE for AWS Glue Catalog, or HIVE for an external hive metastore.
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 ->
            args0.let({ args0 ->
                dataCatalogTypeToKotlin(args0)
            })
        })
}

public object DataCatalogMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.athena.DataCatalog::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy