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

com.pulumi.googlenative.compute.alpha.kotlin.inputs.UrlRewriteArgs.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.googlenative.compute.alpha.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.googlenative.compute.alpha.inputs.UrlRewriteArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * The spec for modifying the path before sending the request to the matched backend service.
 * @property hostRewrite Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters.
 * @property pathPrefixRewrite Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters.
 * @property pathTemplateRewrite  If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=*} or {var=**}. For example, a path_template_match of /static/{format=**} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=**} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified.
 */
public data class UrlRewriteArgs(
    public val hostRewrite: Output? = null,
    public val pathPrefixRewrite: Output? = null,
    public val pathTemplateRewrite: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.googlenative.compute.alpha.inputs.UrlRewriteArgs =
        com.pulumi.googlenative.compute.alpha.inputs.UrlRewriteArgs.builder()
            .hostRewrite(hostRewrite?.applyValue({ args0 -> args0 }))
            .pathPrefixRewrite(pathPrefixRewrite?.applyValue({ args0 -> args0 }))
            .pathTemplateRewrite(pathTemplateRewrite?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [UrlRewriteArgs].
 */
@PulumiTagMarker
public class UrlRewriteArgsBuilder internal constructor() {
    private var hostRewrite: Output? = null

    private var pathPrefixRewrite: Output? = null

    private var pathTemplateRewrite: Output? = null

    /**
     * @param value Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters.
     */
    @JvmName("ldkmeivufxhshrka")
    public suspend fun hostRewrite(`value`: Output) {
        this.hostRewrite = value
    }

    /**
     * @param value Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters.
     */
    @JvmName("bieegxdhuoehmmdk")
    public suspend fun pathPrefixRewrite(`value`: Output) {
        this.pathPrefixRewrite = value
    }

    /**
     * @param value  If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=*} or {var=**}. For example, a path_template_match of /static/{format=**} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=**} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified.
     */
    @JvmName("tixopjlfmnpyqsnv")
    public suspend fun pathTemplateRewrite(`value`: Output) {
        this.pathTemplateRewrite = value
    }

    /**
     * @param value Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters.
     */
    @JvmName("usaudwhjhokkxdvd")
    public suspend fun hostRewrite(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hostRewrite = mapped
    }

    /**
     * @param value Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters.
     */
    @JvmName("wqeymhdocsclywbo")
    public suspend fun pathPrefixRewrite(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.pathPrefixRewrite = mapped
    }

    /**
     * @param value  If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=*} or {var=**}. For example, a path_template_match of /static/{format=**} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=**} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified.
     */
    @JvmName("ldfwygccdxiortqp")
    public suspend fun pathTemplateRewrite(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.pathTemplateRewrite = mapped
    }

    internal fun build(): UrlRewriteArgs = UrlRewriteArgs(
        hostRewrite = hostRewrite,
        pathPrefixRewrite = pathPrefixRewrite,
        pathTemplateRewrite = pathTemplateRewrite,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy