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

com.pulumi.azurenative.documentdb.kotlin.inputs.MongoDBCollectionResourceArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.documentdb.kotlin.inputs

import com.pulumi.azurenative.documentdb.inputs.MongoDBCollectionResourceArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Cosmos DB MongoDB collection resource object
 * @property analyticalStorageTtl Analytical TTL.
 * @property id Name of the Cosmos DB MongoDB collection
 * @property indexes List of index keys
 * @property shardKey A key-value pair of shard keys to be applied for the request.
 */
public data class MongoDBCollectionResourceArgs(
    public val analyticalStorageTtl: Output? = null,
    public val id: Output,
    public val indexes: Output>? = null,
    public val shardKey: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.documentdb.inputs.MongoDBCollectionResourceArgs =
        com.pulumi.azurenative.documentdb.inputs.MongoDBCollectionResourceArgs.builder()
            .analyticalStorageTtl(analyticalStorageTtl?.applyValue({ args0 -> args0 }))
            .id(id.applyValue({ args0 -> args0 }))
            .indexes(
                indexes?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .shardKey(
                shardKey?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [MongoDBCollectionResourceArgs].
 */
@PulumiTagMarker
public class MongoDBCollectionResourceArgsBuilder internal constructor() {
    private var analyticalStorageTtl: Output? = null

    private var id: Output? = null

    private var indexes: Output>? = null

    private var shardKey: Output>? = null

    /**
     * @param value Analytical TTL.
     */
    @JvmName("frhtutnpfgyukkmp")
    public suspend fun analyticalStorageTtl(`value`: Output) {
        this.analyticalStorageTtl = value
    }

    /**
     * @param value Name of the Cosmos DB MongoDB collection
     */
    @JvmName("awmfppobxunvcipp")
    public suspend fun id(`value`: Output) {
        this.id = value
    }

    /**
     * @param value List of index keys
     */
    @JvmName("gtljlpxwgveohera")
    public suspend fun indexes(`value`: Output>) {
        this.indexes = value
    }

    @JvmName("qusedieklwfywgwj")
    public suspend fun indexes(vararg values: Output) {
        this.indexes = Output.all(values.asList())
    }

    /**
     * @param values List of index keys
     */
    @JvmName("biynfvwnpkglxkkq")
    public suspend fun indexes(values: List>) {
        this.indexes = Output.all(values)
    }

    /**
     * @param value A key-value pair of shard keys to be applied for the request.
     */
    @JvmName("rjleeibxifufkgcc")
    public suspend fun shardKey(`value`: Output>) {
        this.shardKey = value
    }

    /**
     * @param value Analytical TTL.
     */
    @JvmName("stjgkjvkgehnvmll")
    public suspend fun analyticalStorageTtl(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.analyticalStorageTtl = mapped
    }

    /**
     * @param value Name of the Cosmos DB MongoDB collection
     */
    @JvmName("jjcnetagajqpttsa")
    public suspend fun id(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.id = mapped
    }

    /**
     * @param value List of index keys
     */
    @JvmName("bpdqkkuuhkiecrup")
    public suspend fun indexes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.indexes = mapped
    }

    /**
     * @param argument List of index keys
     */
    @JvmName("sptbhptjhemlermt")
    public suspend fun indexes(argument: List Unit>) {
        val toBeMapped = argument.toList().map { MongoIndexArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.indexes = mapped
    }

    /**
     * @param argument List of index keys
     */
    @JvmName("buohinlqnpfmiren")
    public suspend fun indexes(vararg argument: suspend MongoIndexArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { MongoIndexArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.indexes = mapped
    }

    /**
     * @param argument List of index keys
     */
    @JvmName("wvebsymwlgegpiat")
    public suspend fun indexes(argument: suspend MongoIndexArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(MongoIndexArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.indexes = mapped
    }

    /**
     * @param values List of index keys
     */
    @JvmName("oxakeyicdckkwmmd")
    public suspend fun indexes(vararg values: MongoIndexArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.indexes = mapped
    }

    /**
     * @param value A key-value pair of shard keys to be applied for the request.
     */
    @JvmName("hepvylkwgigolbog")
    public suspend fun shardKey(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.shardKey = mapped
    }

    /**
     * @param values A key-value pair of shard keys to be applied for the request.
     */
    @JvmName("cypwsxetimldrtjd")
    public fun shardKey(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.shardKey = mapped
    }

    internal fun build(): MongoDBCollectionResourceArgs = MongoDBCollectionResourceArgs(
        analyticalStorageTtl = analyticalStorageTtl,
        id = id ?: throw PulumiNullFieldException("id"),
        indexes = indexes,
        shardKey = shardKey,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy