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.

There is a newer version: 5.40.0.0
Show 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("iiixlxanvrinilmx")
    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("bubhipvwutmkymrl")
    public suspend fun expiresOn(`value`: Output) {
        this.expiresOn = value
    }

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

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

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

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

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

    /**
     * @param value Conditions under which the token should be considered valid.
     */
    @JvmName("psaovfqphsbvqcqr")
    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("bwrgithxawauvmvr")
    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("wobsajhawudkfleb")
    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("kkxfeaohqrsokcse")
    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("ouhpswaujqnnwpji")
    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("llcbvjyxpwhdixyt")
    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("pwsnoctfdhnvjrcu")
    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("wfqtxhokeeckebiy")
    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("ymejggrsnsgjmrfy")
    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("wfhgwuliarlearpm")
    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