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

com.pulumi.aws.wafv2.kotlin.inputs.WebAclDefaultActionBlockCustomResponseArgs.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: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.wafv2.kotlin.inputs

import com.pulumi.aws.wafv2.inputs.WebAclDefaultActionBlockCustomResponseArgs.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property customResponseBodyKey References the response body that you want AWS WAF to return to the web request client. This must reference a `key` defined in a `custom_response_body` block of this resource.
 * @property responseCode The HTTP status code to return to the client.
 * @property responseHeaders The `response_header` blocks used to define the HTTP response headers added to the response. See `response_header` below for details.
 */
public data class WebAclDefaultActionBlockCustomResponseArgs(
    public val customResponseBodyKey: Output? = null,
    public val responseCode: Output,
    public val responseHeaders: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.wafv2.inputs.WebAclDefaultActionBlockCustomResponseArgs =
        com.pulumi.aws.wafv2.inputs.WebAclDefaultActionBlockCustomResponseArgs.builder()
            .customResponseBodyKey(customResponseBodyKey?.applyValue({ args0 -> args0 }))
            .responseCode(responseCode.applyValue({ args0 -> args0 }))
            .responseHeaders(
                responseHeaders?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [WebAclDefaultActionBlockCustomResponseArgs].
 */
@PulumiTagMarker
public class WebAclDefaultActionBlockCustomResponseArgsBuilder internal constructor() {
    private var customResponseBodyKey: Output? = null

    private var responseCode: Output? = null

    private var responseHeaders:
        Output>? = null

    /**
     * @param value References the response body that you want AWS WAF to return to the web request client. This must reference a `key` defined in a `custom_response_body` block of this resource.
     */
    @JvmName("ypusbwgerlthvyfy")
    public suspend fun customResponseBodyKey(`value`: Output) {
        this.customResponseBodyKey = value
    }

    /**
     * @param value The HTTP status code to return to the client.
     */
    @JvmName("lmebhmgeweiyrsnk")
    public suspend fun responseCode(`value`: Output) {
        this.responseCode = value
    }

    /**
     * @param value The `response_header` blocks used to define the HTTP response headers added to the response. See `response_header` below for details.
     */
    @JvmName("ilhogbigbpkexdep")
    public suspend fun responseHeaders(`value`: Output>) {
        this.responseHeaders = value
    }

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

    /**
     * @param values The `response_header` blocks used to define the HTTP response headers added to the response. See `response_header` below for details.
     */
    @JvmName("eagrghocucnqengy")
    public suspend fun responseHeaders(values: List>) {
        this.responseHeaders = Output.all(values)
    }

    /**
     * @param value References the response body that you want AWS WAF to return to the web request client. This must reference a `key` defined in a `custom_response_body` block of this resource.
     */
    @JvmName("ldvtwucodadxgiqi")
    public suspend fun customResponseBodyKey(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.customResponseBodyKey = mapped
    }

    /**
     * @param value The HTTP status code to return to the client.
     */
    @JvmName("ophbfalgifnpnoyk")
    public suspend fun responseCode(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.responseCode = mapped
    }

    /**
     * @param value The `response_header` blocks used to define the HTTP response headers added to the response. See `response_header` below for details.
     */
    @JvmName("gnqtxlqvcldcfjmx")
    public suspend fun responseHeaders(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.responseHeaders = mapped
    }

    /**
     * @param argument The `response_header` blocks used to define the HTTP response headers added to the response. See `response_header` below for details.
     */
    @JvmName("cqdaxlfrhkycyflr")
    public suspend fun responseHeaders(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            WebAclDefaultActionBlockCustomResponseResponseHeaderArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.responseHeaders = mapped
    }

    /**
     * @param argument The `response_header` blocks used to define the HTTP response headers added to the response. See `response_header` below for details.
     */
    @JvmName("bfeolccxcbwfccyr")
    public suspend fun responseHeaders(vararg argument: suspend WebAclDefaultActionBlockCustomResponseResponseHeaderArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            WebAclDefaultActionBlockCustomResponseResponseHeaderArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.responseHeaders = mapped
    }

    /**
     * @param argument The `response_header` blocks used to define the HTTP response headers added to the response. See `response_header` below for details.
     */
    @JvmName("bnwhtjpnddobodfh")
    public suspend fun responseHeaders(argument: suspend WebAclDefaultActionBlockCustomResponseResponseHeaderArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                WebAclDefaultActionBlockCustomResponseResponseHeaderArgsBuilder().applySuspend {
                    argument()
                }.build(),
            )
        val mapped = of(toBeMapped)
        this.responseHeaders = mapped
    }

    /**
     * @param values The `response_header` blocks used to define the HTTP response headers added to the response. See `response_header` below for details.
     */
    @JvmName("jlaoqfceficltqpu")
    public suspend fun responseHeaders(vararg values: WebAclDefaultActionBlockCustomResponseResponseHeaderArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.responseHeaders = mapped
    }

    internal fun build(): WebAclDefaultActionBlockCustomResponseArgs =
        WebAclDefaultActionBlockCustomResponseArgs(
            customResponseBodyKey = customResponseBodyKey,
            responseCode = responseCode ?: throw PulumiNullFieldException("responseCode"),
            responseHeaders = responseHeaders,
        )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy