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

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

import com.pulumi.cloudflare.inputs.LoadBalancerRuleArgs.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.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property condition The statement to evaluate to determine if this rule's effects should be applied. An empty condition is always true. See [load balancing rules](https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules).
 * @property disabled A disabled rule will not be executed.
 * @property fixedResponse Settings for a HTTP response to return directly to the eyeball if the condition is true. Note: `overrides` or `fixed_response` must be set.
 * @property name Human readable name for this rule.
 * @property overrides The load balancer settings to alter if this rule's `condition` is true. Note: `overrides` or `fixed_response` must be set.
 * @property priority Priority used when determining the order of rule execution. Lower values are executed first. If not provided, the list order will be used.
 * @property terminates Terminates indicates that if this rule is true no further rules should be executed. Note: setting a `fixed_response` forces this field to `true`.
 */
public data class LoadBalancerRuleArgs(
    public val condition: Output? = null,
    public val disabled: Output? = null,
    public val fixedResponse: Output? = null,
    public val name: Output,
    public val overrides: Output>? = null,
    public val priority: Output? = null,
    public val terminates: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.inputs.LoadBalancerRuleArgs =
        com.pulumi.cloudflare.inputs.LoadBalancerRuleArgs.builder()
            .condition(condition?.applyValue({ args0 -> args0 }))
            .disabled(disabled?.applyValue({ args0 -> args0 }))
            .fixedResponse(fixedResponse?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .name(name.applyValue({ args0 -> args0 }))
            .overrides(
                overrides?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .priority(priority?.applyValue({ args0 -> args0 }))
            .terminates(terminates?.applyValue({ args0 -> args0 })).build()
}

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

    private var disabled: Output? = null

    private var fixedResponse: Output? = null

    private var name: Output? = null

    private var overrides: Output>? = null

    private var priority: Output? = null

    private var terminates: Output? = null

    /**
     * @param value The statement to evaluate to determine if this rule's effects should be applied. An empty condition is always true. See [load balancing rules](https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules).
     */
    @JvmName("ttqxipolhpqvjnjn")
    public suspend fun condition(`value`: Output) {
        this.condition = value
    }

    /**
     * @param value A disabled rule will not be executed.
     */
    @JvmName("rxhsrenthxhayqfe")
    public suspend fun disabled(`value`: Output) {
        this.disabled = value
    }

    /**
     * @param value Settings for a HTTP response to return directly to the eyeball if the condition is true. Note: `overrides` or `fixed_response` must be set.
     */
    @JvmName("qrusmyednqwmkfkg")
    public suspend fun fixedResponse(`value`: Output) {
        this.fixedResponse = value
    }

    /**
     * @param value Human readable name for this rule.
     */
    @JvmName("mxxmdubmrbcccnrw")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The load balancer settings to alter if this rule's `condition` is true. Note: `overrides` or `fixed_response` must be set.
     */
    @JvmName("xtfugdxgqvhqrulm")
    public suspend fun overrides(`value`: Output>) {
        this.overrides = value
    }

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

    /**
     * @param values The load balancer settings to alter if this rule's `condition` is true. Note: `overrides` or `fixed_response` must be set.
     */
    @JvmName("vqxwiwnkwkoadyox")
    public suspend fun overrides(values: List>) {
        this.overrides = Output.all(values)
    }

    /**
     * @param value Priority used when determining the order of rule execution. Lower values are executed first. If not provided, the list order will be used.
     */
    @JvmName("xowtcovuposhfetm")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

    /**
     * @param value Terminates indicates that if this rule is true no further rules should be executed. Note: setting a `fixed_response` forces this field to `true`.
     */
    @JvmName("bagyjtwnaooreice")
    public suspend fun terminates(`value`: Output) {
        this.terminates = value
    }

    /**
     * @param value The statement to evaluate to determine if this rule's effects should be applied. An empty condition is always true. See [load balancing rules](https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules).
     */
    @JvmName("wbwfiodnoxxduiqv")
    public suspend fun condition(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.condition = mapped
    }

    /**
     * @param value A disabled rule will not be executed.
     */
    @JvmName("tjwslgpllyerfphu")
    public suspend fun disabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disabled = mapped
    }

    /**
     * @param value Settings for a HTTP response to return directly to the eyeball if the condition is true. Note: `overrides` or `fixed_response` must be set.
     */
    @JvmName("skecwsryqarghfof")
    public suspend fun fixedResponse(`value`: LoadBalancerRuleFixedResponseArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.fixedResponse = mapped
    }

    /**
     * @param argument Settings for a HTTP response to return directly to the eyeball if the condition is true. Note: `overrides` or `fixed_response` must be set.
     */
    @JvmName("jqespalmegjqnrmy")
    public suspend fun fixedResponse(argument: suspend LoadBalancerRuleFixedResponseArgsBuilder.() -> Unit) {
        val toBeMapped = LoadBalancerRuleFixedResponseArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.fixedResponse = mapped
    }

    /**
     * @param value Human readable name for this rule.
     */
    @JvmName("kgxlfnuydjmjymmt")
    public suspend fun name(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The load balancer settings to alter if this rule's `condition` is true. Note: `overrides` or `fixed_response` must be set.
     */
    @JvmName("frbehgbuidtobihn")
    public suspend fun overrides(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.overrides = mapped
    }

    /**
     * @param argument The load balancer settings to alter if this rule's `condition` is true. Note: `overrides` or `fixed_response` must be set.
     */
    @JvmName("yjisulbwtslypqsm")
    public suspend fun overrides(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerRuleOverrideArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.overrides = mapped
    }

    /**
     * @param argument The load balancer settings to alter if this rule's `condition` is true. Note: `overrides` or `fixed_response` must be set.
     */
    @JvmName("fbldesxeirwhxwie")
    public suspend fun overrides(vararg argument: suspend LoadBalancerRuleOverrideArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerRuleOverrideArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.overrides = mapped
    }

    /**
     * @param argument The load balancer settings to alter if this rule's `condition` is true. Note: `overrides` or `fixed_response` must be set.
     */
    @JvmName("nwiejojyjstqscww")
    public suspend fun overrides(argument: suspend LoadBalancerRuleOverrideArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            LoadBalancerRuleOverrideArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.overrides = mapped
    }

    /**
     * @param values The load balancer settings to alter if this rule's `condition` is true. Note: `overrides` or `fixed_response` must be set.
     */
    @JvmName("ifpbqsvknvgwkbyw")
    public suspend fun overrides(vararg values: LoadBalancerRuleOverrideArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.overrides = mapped
    }

    /**
     * @param value Priority used when determining the order of rule execution. Lower values are executed first. If not provided, the list order will be used.
     */
    @JvmName("upmriepiirsplmko")
    public suspend fun priority(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.priority = mapped
    }

    /**
     * @param value Terminates indicates that if this rule is true no further rules should be executed. Note: setting a `fixed_response` forces this field to `true`.
     */
    @JvmName("eaqlfpaifmcmibht")
    public suspend fun terminates(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.terminates = mapped
    }

    internal fun build(): LoadBalancerRuleArgs = LoadBalancerRuleArgs(
        condition = condition,
        disabled = disabled,
        fixedResponse = fixedResponse,
        name = name ?: throw PulumiNullFieldException("name"),
        overrides = overrides,
        priority = priority,
        terminates = terminates,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy