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

com.pulumi.awsnative.wafv2.kotlin.inputs.WebAclCustomResponseArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.wafv2.kotlin.inputs

import com.pulumi.awsnative.wafv2.inputs.WebAclCustomResponseArgs.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

/**
 * Custom response.
 * @property customResponseBodyKey Custom response body key.
 * @property responseCode The HTTP status code to return to the client.
 * For a list of status codes that you can use in your custom responses, see [Supported status codes for custom response](https://docs.aws.amazon.com/waf/latest/developerguide/customizing-the-response-status-codes.html) in the *AWS WAF Developer Guide* .
 * @property responseHeaders Collection of HTTP headers.
 */
public data class WebAclCustomResponseArgs(
    public val customResponseBodyKey: Output? = null,
    public val responseCode: Output,
    public val responseHeaders: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.wafv2.inputs.WebAclCustomResponseArgs =
        com.pulumi.awsnative.wafv2.inputs.WebAclCustomResponseArgs.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 [WebAclCustomResponseArgs].
 */
@PulumiTagMarker
public class WebAclCustomResponseArgsBuilder internal constructor() {
    private var customResponseBodyKey: Output? = null

    private var responseCode: Output? = null

    private var responseHeaders: Output>? = null

    /**
     * @param value Custom response body key.
     */
    @JvmName("rslslyxpffpdbqlu")
    public suspend fun customResponseBodyKey(`value`: Output) {
        this.customResponseBodyKey = value
    }

    /**
     * @param value The HTTP status code to return to the client.
     * For a list of status codes that you can use in your custom responses, see [Supported status codes for custom response](https://docs.aws.amazon.com/waf/latest/developerguide/customizing-the-response-status-codes.html) in the *AWS WAF Developer Guide* .
     */
    @JvmName("xntvqtuyccqymuqh")
    public suspend fun responseCode(`value`: Output) {
        this.responseCode = value
    }

    /**
     * @param value Collection of HTTP headers.
     */
    @JvmName("xuohxcsmusjyfscb")
    public suspend fun responseHeaders(`value`: Output>) {
        this.responseHeaders = value
    }

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

    /**
     * @param values Collection of HTTP headers.
     */
    @JvmName("sojxlnbyxdyeisbp")
    public suspend fun responseHeaders(values: List>) {
        this.responseHeaders = Output.all(values)
    }

    /**
     * @param value Custom response body key.
     */
    @JvmName("jhcxcckviwfjgoyy")
    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.
     * For a list of status codes that you can use in your custom responses, see [Supported status codes for custom response](https://docs.aws.amazon.com/waf/latest/developerguide/customizing-the-response-status-codes.html) in the *AWS WAF Developer Guide* .
     */
    @JvmName("rtcauammwgkixegs")
    public suspend fun responseCode(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.responseCode = mapped
    }

    /**
     * @param value Collection of HTTP headers.
     */
    @JvmName("wdwxidxtjfuftvji")
    public suspend fun responseHeaders(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.responseHeaders = mapped
    }

    /**
     * @param argument Collection of HTTP headers.
     */
    @JvmName("snhlqsppmfrymtwe")
    public suspend fun responseHeaders(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            WebAclCustomHttpHeaderArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.responseHeaders = mapped
    }

    /**
     * @param argument Collection of HTTP headers.
     */
    @JvmName("ulffvcowfrleadqu")
    public suspend fun responseHeaders(vararg argument: suspend WebAclCustomHttpHeaderArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            WebAclCustomHttpHeaderArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.responseHeaders = mapped
    }

    /**
     * @param argument Collection of HTTP headers.
     */
    @JvmName("qcmboshsclaeeacb")
    public suspend fun responseHeaders(argument: suspend WebAclCustomHttpHeaderArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(WebAclCustomHttpHeaderArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.responseHeaders = mapped
    }

    /**
     * @param values Collection of HTTP headers.
     */
    @JvmName("kpwrnsjpqxlqdrdv")
    public suspend fun responseHeaders(vararg values: WebAclCustomHttpHeaderArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.responseHeaders = mapped
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy