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

com.pulumi.alicloud.pvtz.kotlin.RuleArgs.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: 3.62.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.alicloud.pvtz.kotlin

import com.pulumi.alicloud.pvtz.RuleArgs.builder
import com.pulumi.alicloud.pvtz.kotlin.inputs.RuleForwardIpArgs
import com.pulumi.alicloud.pvtz.kotlin.inputs.RuleForwardIpArgsBuilder
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 Private Zone Rule resource.
 * For information about Private Zone Rule and how to use it, see [What is Rule](https://www.alibabacloud.com/help/en/privatezone/latest/add-forwarding-rule).
 * > **NOTE:** Available since v1.143.0.
 * ## Import
 * Private Zone Rule can be imported using the id, e.g.
 * ```sh
 * $ pulumi import alicloud:pvtz/rule:Rule example 
 * ```
 * @property endpointId The ID of the Endpoint.
 * @property forwardIps Forwarding target. See `forward_ips` below.
 * @property ruleName The name of the resource.
 * @property type The type of the rule. Valid values: `OUTBOUND`.
 * @property zoneName The name of the forwarding zone.
 */
public data class RuleArgs(
    public val endpointId: Output? = null,
    public val forwardIps: Output>? = null,
    public val ruleName: Output? = null,
    public val type: Output? = null,
    public val zoneName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.alicloud.pvtz.RuleArgs =
        com.pulumi.alicloud.pvtz.RuleArgs.builder()
            .endpointId(endpointId?.applyValue({ args0 -> args0 }))
            .forwardIps(
                forwardIps?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .ruleName(ruleName?.applyValue({ args0 -> args0 }))
            .type(type?.applyValue({ args0 -> args0 }))
            .zoneName(zoneName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [RuleArgs].
 */
@PulumiTagMarker
public class RuleArgsBuilder internal constructor() {
    private var endpointId: Output? = null

    private var forwardIps: Output>? = null

    private var ruleName: Output? = null

    private var type: Output? = null

    private var zoneName: Output? = null

    /**
     * @param value The ID of the Endpoint.
     */
    @JvmName("ifarkockgrekpxdv")
    public suspend fun endpointId(`value`: Output) {
        this.endpointId = value
    }

    /**
     * @param value Forwarding target. See `forward_ips` below.
     */
    @JvmName("mbhtegmutvolxmpq")
    public suspend fun forwardIps(`value`: Output>) {
        this.forwardIps = value
    }

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

    /**
     * @param values Forwarding target. See `forward_ips` below.
     */
    @JvmName("xqplobewradwetii")
    public suspend fun forwardIps(values: List>) {
        this.forwardIps = Output.all(values)
    }

    /**
     * @param value The name of the resource.
     */
    @JvmName("rmahytidoimpytmv")
    public suspend fun ruleName(`value`: Output) {
        this.ruleName = value
    }

    /**
     * @param value The type of the rule. Valid values: `OUTBOUND`.
     */
    @JvmName("igkgtomguqendkuo")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value The name of the forwarding zone.
     */
    @JvmName("wvxysydcnlkownci")
    public suspend fun zoneName(`value`: Output) {
        this.zoneName = value
    }

    /**
     * @param value The ID of the Endpoint.
     */
    @JvmName("vkibidgbyeohnjic")
    public suspend fun endpointId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.endpointId = mapped
    }

    /**
     * @param value Forwarding target. See `forward_ips` below.
     */
    @JvmName("qmftaxfviiyydehp")
    public suspend fun forwardIps(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.forwardIps = mapped
    }

    /**
     * @param argument Forwarding target. See `forward_ips` below.
     */
    @JvmName("obipupyjmlphospb")
    public suspend fun forwardIps(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            RuleForwardIpArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.forwardIps = mapped
    }

    /**
     * @param argument Forwarding target. See `forward_ips` below.
     */
    @JvmName("vtjwugotavnyplcp")
    public suspend fun forwardIps(vararg argument: suspend RuleForwardIpArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            RuleForwardIpArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.forwardIps = mapped
    }

    /**
     * @param argument Forwarding target. See `forward_ips` below.
     */
    @JvmName("gwhjunhjamhoduqo")
    public suspend fun forwardIps(argument: suspend RuleForwardIpArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(RuleForwardIpArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.forwardIps = mapped
    }

    /**
     * @param values Forwarding target. See `forward_ips` below.
     */
    @JvmName("iofenldcshjgnwby")
    public suspend fun forwardIps(vararg values: RuleForwardIpArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.forwardIps = mapped
    }

    /**
     * @param value The name of the resource.
     */
    @JvmName("fvswtkqglmotrnvk")
    public suspend fun ruleName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleName = mapped
    }

    /**
     * @param value The type of the rule. Valid values: `OUTBOUND`.
     */
    @JvmName("gwjujpbtbacejidu")
    public suspend fun type(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    /**
     * @param value The name of the forwarding zone.
     */
    @JvmName("snbvkovbqxdynibh")
    public suspend fun zoneName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zoneName = mapped
    }

    internal fun build(): RuleArgs = RuleArgs(
        endpointId = endpointId,
        forwardIps = forwardIps,
        ruleName = ruleName,
        type = type,
        zoneName = zoneName,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy