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

com.pulumi.gcp.networkservices.kotlin.inputs.EdgeCacheServiceRoutingPathMatcherRouteRuleArgs.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: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.networkservices.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.networkservices.inputs.EdgeCacheServiceRoutingPathMatcherRouteRuleArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
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

/**
 *
 * @property description A human-readable description of the routeRule.
 * @property headerAction The header actions, including adding & removing headers, for requests that match this route.
 * Structure is documented below.
 * @property matchRules The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates
 * within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule.
 * Structure is documented below.
 * @property origin The Origin resource that requests to this route should fetch from when a matching response is not in cache. Origins can be defined as short names ("my-origin") or fully-qualified resource URLs - e.g. "networkservices.googleapis.com/projects/my-project/global/edgecacheorigins/my-origin"
 * Only one of origin or urlRedirect can be set.
 * @property priority The priority of this route rule, where 1 is the highest priority.
 * You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number between 1 and 999 inclusive.
 * Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers
 * to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules.
 * @property routeAction In response to a matching path, the routeAction performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected origin.
 * Structure is documented below.
 * @property urlRedirect The URL redirect configuration for requests that match this route.
 * Structure is documented below.
 */
public data class EdgeCacheServiceRoutingPathMatcherRouteRuleArgs(
    public val description: Output? = null,
    public val headerAction: Output? =
        null,
    public val matchRules: Output>,
    public val origin: Output? = null,
    public val priority: Output,
    public val routeAction: Output? =
        null,
    public val urlRedirect: Output? =
        null,
) :
    ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.networkservices.inputs.EdgeCacheServiceRoutingPathMatcherRouteRuleArgs =
        com.pulumi.gcp.networkservices.inputs.EdgeCacheServiceRoutingPathMatcherRouteRuleArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .headerAction(headerAction?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .matchRules(
                matchRules.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .origin(origin?.applyValue({ args0 -> args0 }))
            .priority(priority.applyValue({ args0 -> args0 }))
            .routeAction(routeAction?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .urlRedirect(urlRedirect?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [EdgeCacheServiceRoutingPathMatcherRouteRuleArgs].
 */
@PulumiTagMarker
public class EdgeCacheServiceRoutingPathMatcherRouteRuleArgsBuilder internal constructor() {
    private var description: Output? = null

    private var headerAction: Output? =
        null

    private var matchRules: Output>? =
        null

    private var origin: Output? = null

    private var priority: Output? = null

    private var routeAction: Output? =
        null

    private var urlRedirect: Output? =
        null

    /**
     * @param value A human-readable description of the routeRule.
     */
    @JvmName("srsjxrlbyfngnwpj")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The header actions, including adding & removing headers, for requests that match this route.
     * Structure is documented below.
     */
    @JvmName("hecfbsiguvjtlotx")
    public suspend fun headerAction(`value`: Output) {
        this.headerAction = value
    }

    /**
     * @param value The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates
     * within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule.
     * Structure is documented below.
     */
    @JvmName("ixqdnmxmgnfehohh")
    public suspend fun matchRules(`value`: Output>) {
        this.matchRules = value
    }

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

    /**
     * @param values The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates
     * within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule.
     * Structure is documented below.
     */
    @JvmName("hcueovnkfbhgnqbl")
    public suspend fun matchRules(values: List>) {
        this.matchRules = Output.all(values)
    }

    /**
     * @param value The Origin resource that requests to this route should fetch from when a matching response is not in cache. Origins can be defined as short names ("my-origin") or fully-qualified resource URLs - e.g. "networkservices.googleapis.com/projects/my-project/global/edgecacheorigins/my-origin"
     * Only one of origin or urlRedirect can be set.
     */
    @JvmName("vrojvbplqdvorwut")
    public suspend fun origin(`value`: Output) {
        this.origin = value
    }

    /**
     * @param value The priority of this route rule, where 1 is the highest priority.
     * You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number between 1 and 999 inclusive.
     * Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers
     * to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules.
     */
    @JvmName("swvmtplhmotbnoqc")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

    /**
     * @param value In response to a matching path, the routeAction performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected origin.
     * Structure is documented below.
     */
    @JvmName("xhislbvohutamffw")
    public suspend fun routeAction(`value`: Output) {
        this.routeAction = value
    }

    /**
     * @param value The URL redirect configuration for requests that match this route.
     * Structure is documented below.
     */
    @JvmName("xhnmvobpfcugebhu")
    public suspend fun urlRedirect(`value`: Output) {
        this.urlRedirect = value
    }

    /**
     * @param value A human-readable description of the routeRule.
     */
    @JvmName("rkrhqwgqmmxjiqix")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The header actions, including adding & removing headers, for requests that match this route.
     * Structure is documented below.
     */
    @JvmName("nayxorppsmvqnfbk")
    public suspend fun headerAction(`value`: EdgeCacheServiceRoutingPathMatcherRouteRuleHeaderActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.headerAction = mapped
    }

    /**
     * @param argument The header actions, including adding & removing headers, for requests that match this route.
     * Structure is documented below.
     */
    @JvmName("iquiiybvnwsbbihj")
    public suspend fun headerAction(argument: suspend EdgeCacheServiceRoutingPathMatcherRouteRuleHeaderActionArgsBuilder.() -> Unit) {
        val toBeMapped =
            EdgeCacheServiceRoutingPathMatcherRouteRuleHeaderActionArgsBuilder().applySuspend {
                argument()
            }.build()
        val mapped = of(toBeMapped)
        this.headerAction = mapped
    }

    /**
     * @param value The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates
     * within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule.
     * Structure is documented below.
     */
    @JvmName("uikgpdeateucfoxx")
    public suspend fun matchRules(`value`: List) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.matchRules = mapped
    }

    /**
     * @param argument The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates
     * within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule.
     * Structure is documented below.
     */
    @JvmName("suohldrrtjwmfmqi")
    public suspend fun matchRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.matchRules = mapped
    }

    /**
     * @param argument The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates
     * within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule.
     * Structure is documented below.
     */
    @JvmName("bafawxitfxkratng")
    public suspend fun matchRules(vararg argument: suspend EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.matchRules = mapped
    }

    /**
     * @param argument The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates
     * within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule.
     * Structure is documented below.
     */
    @JvmName("cottditkvxuwbkys")
    public suspend fun matchRules(argument: suspend EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleArgsBuilder().applySuspend {
                    argument()
                }.build(),
            )
        val mapped = of(toBeMapped)
        this.matchRules = mapped
    }

    /**
     * @param values The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates
     * within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule.
     * Structure is documented below.
     */
    @JvmName("pjgrktuwyfjmccwa")
    public suspend fun matchRules(vararg values: EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.matchRules = mapped
    }

    /**
     * @param value The Origin resource that requests to this route should fetch from when a matching response is not in cache. Origins can be defined as short names ("my-origin") or fully-qualified resource URLs - e.g. "networkservices.googleapis.com/projects/my-project/global/edgecacheorigins/my-origin"
     * Only one of origin or urlRedirect can be set.
     */
    @JvmName("vcqnycmutodqtviy")
    public suspend fun origin(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.origin = mapped
    }

    /**
     * @param value The priority of this route rule, where 1 is the highest priority.
     * You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number between 1 and 999 inclusive.
     * Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers
     * to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules.
     */
    @JvmName("xbnhdofqwpnyisep")
    public suspend fun priority(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.priority = mapped
    }

    /**
     * @param value In response to a matching path, the routeAction performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected origin.
     * Structure is documented below.
     */
    @JvmName("vqlkoigtnbrsibrl")
    public suspend fun routeAction(`value`: EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.routeAction = mapped
    }

    /**
     * @param argument In response to a matching path, the routeAction performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected origin.
     * Structure is documented below.
     */
    @JvmName("uitdtabrfjnfvxlj")
    public suspend fun routeAction(argument: suspend EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionArgsBuilder.() -> Unit) {
        val toBeMapped =
            EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionArgsBuilder().applySuspend {
                argument()
            }.build()
        val mapped = of(toBeMapped)
        this.routeAction = mapped
    }

    /**
     * @param value The URL redirect configuration for requests that match this route.
     * Structure is documented below.
     */
    @JvmName("rbbchpkwbeskonfi")
    public suspend fun urlRedirect(`value`: EdgeCacheServiceRoutingPathMatcherRouteRuleUrlRedirectArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.urlRedirect = mapped
    }

    /**
     * @param argument The URL redirect configuration for requests that match this route.
     * Structure is documented below.
     */
    @JvmName("tgbnmawcvgobpmfy")
    public suspend fun urlRedirect(argument: suspend EdgeCacheServiceRoutingPathMatcherRouteRuleUrlRedirectArgsBuilder.() -> Unit) {
        val toBeMapped =
            EdgeCacheServiceRoutingPathMatcherRouteRuleUrlRedirectArgsBuilder().applySuspend {
                argument()
            }.build()
        val mapped = of(toBeMapped)
        this.urlRedirect = mapped
    }

    internal fun build(): EdgeCacheServiceRoutingPathMatcherRouteRuleArgs =
        EdgeCacheServiceRoutingPathMatcherRouteRuleArgs(
            description = description,
            headerAction = headerAction,
            matchRules = matchRules ?: throw PulumiNullFieldException("matchRules"),
            origin = origin,
            priority = priority ?: throw PulumiNullFieldException("priority"),
            routeAction = routeAction,
            urlRedirect = urlRedirect,
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy