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

com.pulumi.cloudflare.kotlin.ApiTokenArgs.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.cloudflare.ApiTokenArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.ApiTokenConditionArgs
import com.pulumi.cloudflare.kotlin.inputs.ApiTokenConditionArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.ApiTokenPolicyArgs
import com.pulumi.cloudflare.kotlin.inputs.ApiTokenPolicyArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a resource which manages Cloudflare API tokens.
 * Read more about permission groups and their applicable scopes in the
 * [developer documentation](https://developers.cloudflare.com/api/tokens/create/permissions).
 * @property condition Conditions under which the token should be considered valid.
 * @property expiresOn The expiration time on or after which the token MUST NOT be accepted for processing.
 * @property name Name of the API Token.
 * @property notBefore The time before which the token MUST NOT be accepted for processing.
 * @property policies Permissions policy. Multiple policy blocks can be defined.
 */
public data class ApiTokenArgs(
    public val condition: Output? = null,
    public val expiresOn: Output? = null,
    public val name: Output? = null,
    public val notBefore: Output? = null,
    public val policies: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.ApiTokenArgs =
        com.pulumi.cloudflare.ApiTokenArgs.builder()
            .condition(condition?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .expiresOn(expiresOn?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .notBefore(notBefore?.applyValue({ args0 -> args0 }))
            .policies(
                policies?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [ApiTokenArgs].
 */
@PulumiTagMarker
public class ApiTokenArgsBuilder internal constructor() {
    private var condition: Output? = null

    private var expiresOn: Output? = null

    private var name: Output? = null

    private var notBefore: Output? = null

    private var policies: Output>? = null

    /**
     * @param value Conditions under which the token should be considered valid.
     */
    @JvmName("qeyewghuwbkbrpfp")
    public suspend fun condition(`value`: Output) {
        this.condition = value
    }

    /**
     * @param value The expiration time on or after which the token MUST NOT be accepted for processing.
     */
    @JvmName("utxlyhewwoosihvq")
    public suspend fun expiresOn(`value`: Output) {
        this.expiresOn = value
    }

    /**
     * @param value Name of the API Token.
     */
    @JvmName("sqbygjwyytgsbfpp")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The time before which the token MUST NOT be accepted for processing.
     */
    @JvmName("qhtfqmlmqcjcxqnx")
    public suspend fun notBefore(`value`: Output) {
        this.notBefore = value
    }

    /**
     * @param value Permissions policy. Multiple policy blocks can be defined.
     */
    @JvmName("gcslwpkfoavrekyq")
    public suspend fun policies(`value`: Output>) {
        this.policies = value
    }

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

    /**
     * @param values Permissions policy. Multiple policy blocks can be defined.
     */
    @JvmName("dsyevjhsnuqstjwd")
    public suspend fun policies(values: List>) {
        this.policies = Output.all(values)
    }

    /**
     * @param value Conditions under which the token should be considered valid.
     */
    @JvmName("ijcyxbwqjpnnysce")
    public suspend fun condition(`value`: ApiTokenConditionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.condition = mapped
    }

    /**
     * @param argument Conditions under which the token should be considered valid.
     */
    @JvmName("wtodtedcetvqeusn")
    public suspend fun condition(argument: suspend ApiTokenConditionArgsBuilder.() -> Unit) {
        val toBeMapped = ApiTokenConditionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.condition = mapped
    }

    /**
     * @param value The expiration time on or after which the token MUST NOT be accepted for processing.
     */
    @JvmName("abhlikhissbtovyv")
    public suspend fun expiresOn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expiresOn = mapped
    }

    /**
     * @param value Name of the API Token.
     */
    @JvmName("mwkreygbmpxrtnib")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The time before which the token MUST NOT be accepted for processing.
     */
    @JvmName("absljxswdeptfkpk")
    public suspend fun notBefore(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.notBefore = mapped
    }

    /**
     * @param value Permissions policy. Multiple policy blocks can be defined.
     */
    @JvmName("kfhfxrlfedunywsr")
    public suspend fun policies(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.policies = mapped
    }

    /**
     * @param argument Permissions policy. Multiple policy blocks can be defined.
     */
    @JvmName("olvswaqtydtsonvx")
    public suspend fun policies(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ApiTokenPolicyArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.policies = mapped
    }

    /**
     * @param argument Permissions policy. Multiple policy blocks can be defined.
     */
    @JvmName("knnqwufhepjavjiu")
    public suspend fun policies(vararg argument: suspend ApiTokenPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ApiTokenPolicyArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.policies = mapped
    }

    /**
     * @param argument Permissions policy. Multiple policy blocks can be defined.
     */
    @JvmName("plgioqetdgkjlsaa")
    public suspend fun policies(argument: suspend ApiTokenPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ApiTokenPolicyArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.policies = mapped
    }

    /**
     * @param values Permissions policy. Multiple policy blocks can be defined.
     */
    @JvmName("yplenevemrnvmtmn")
    public suspend fun policies(vararg values: ApiTokenPolicyArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.policies = mapped
    }

    internal fun build(): ApiTokenArgs = ApiTokenArgs(
        condition = condition,
        expiresOn = expiresOn,
        name = name,
        notBefore = notBefore,
        policies = policies,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy