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

com.pulumi.awsnative.apigateway.kotlin.inputs.MethodIntegrationResponseArgs.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: 1.24.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.apigateway.kotlin.inputs

import com.pulumi.awsnative.apigateway.inputs.MethodIntegrationResponseArgs.builder
import com.pulumi.awsnative.apigateway.kotlin.enums.MethodIntegrationResponseContentHandling
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 kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * ``IntegrationResponse`` is a property of the [Amazon API Gateway Method Integration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apitgateway-method-integration.html) property type that specifies the response that API Gateway sends after a method's backend finishes processing a request.
 * @property contentHandling Specifies how to handle response payload content type conversions. Supported values are ``CONVERT_TO_BINARY`` and ``CONVERT_TO_TEXT``, with the following behaviors:
 *  If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
 * @property responseParameters A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of ``method.response.header.{name}``, where ``name`` is a valid and unique header name. The mapped non-static value must match the pattern of ``integration.response.header.{name}`` or ``integration.response.body.{JSON-expression}``, where ``name`` is a valid and unique response header name and ``JSON-expression`` is a valid JSON expression without the ``$`` prefix.
 * @property responseTemplates Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
 * @property selectionPattern Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the ``.+`` regex to match error response. However, make sure that the error response does not contain any newline (``\n``) character in such cases. If the back end is an LAMlong function, the LAMlong function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
 * @property statusCode Specifies the status code that is used to map the integration response to an existing MethodResponse.
 */
public data class MethodIntegrationResponseArgs(
    public val contentHandling: Output? = null,
    public val responseParameters: Output>? = null,
    public val responseTemplates: Output>? = null,
    public val selectionPattern: Output? = null,
    public val statusCode: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.apigateway.inputs.MethodIntegrationResponseArgs =
        com.pulumi.awsnative.apigateway.inputs.MethodIntegrationResponseArgs.builder()
            .contentHandling(contentHandling?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .responseParameters(
                responseParameters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .responseTemplates(
                responseTemplates?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .selectionPattern(selectionPattern?.applyValue({ args0 -> args0 }))
            .statusCode(statusCode.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [MethodIntegrationResponseArgs].
 */
@PulumiTagMarker
public class MethodIntegrationResponseArgsBuilder internal constructor() {
    private var contentHandling: Output? = null

    private var responseParameters: Output>? = null

    private var responseTemplates: Output>? = null

    private var selectionPattern: Output? = null

    private var statusCode: Output? = null

    /**
     * @param value Specifies how to handle response payload content type conversions. Supported values are ``CONVERT_TO_BINARY`` and ``CONVERT_TO_TEXT``, with the following behaviors:
     *  If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
     */
    @JvmName("mxclytsbkbaegbds")
    public suspend fun contentHandling(`value`: Output) {
        this.contentHandling = value
    }

    /**
     * @param value A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of ``method.response.header.{name}``, where ``name`` is a valid and unique header name. The mapped non-static value must match the pattern of ``integration.response.header.{name}`` or ``integration.response.body.{JSON-expression}``, where ``name`` is a valid and unique response header name and ``JSON-expression`` is a valid JSON expression without the ``$`` prefix.
     */
    @JvmName("vluavkomqcpphrjo")
    public suspend fun responseParameters(`value`: Output>) {
        this.responseParameters = value
    }

    /**
     * @param value Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
     */
    @JvmName("xjgejvswbftdewgq")
    public suspend fun responseTemplates(`value`: Output>) {
        this.responseTemplates = value
    }

    /**
     * @param value Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the ``.+`` regex to match error response. However, make sure that the error response does not contain any newline (``\n``) character in such cases. If the back end is an LAMlong function, the LAMlong function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
     */
    @JvmName("xpcrekshwmbklfbu")
    public suspend fun selectionPattern(`value`: Output) {
        this.selectionPattern = value
    }

    /**
     * @param value Specifies the status code that is used to map the integration response to an existing MethodResponse.
     */
    @JvmName("atamuyjsagnjfaps")
    public suspend fun statusCode(`value`: Output) {
        this.statusCode = value
    }

    /**
     * @param value Specifies how to handle response payload content type conversions. Supported values are ``CONVERT_TO_BINARY`` and ``CONVERT_TO_TEXT``, with the following behaviors:
     *  If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
     */
    @JvmName("jwpspokogcixdlol")
    public suspend fun contentHandling(`value`: MethodIntegrationResponseContentHandling?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.contentHandling = mapped
    }

    /**
     * @param value A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of ``method.response.header.{name}``, where ``name`` is a valid and unique header name. The mapped non-static value must match the pattern of ``integration.response.header.{name}`` or ``integration.response.body.{JSON-expression}``, where ``name`` is a valid and unique response header name and ``JSON-expression`` is a valid JSON expression without the ``$`` prefix.
     */
    @JvmName("inmoyrwygopscbbm")
    public suspend fun responseParameters(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.responseParameters = mapped
    }

    /**
     * @param values A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of ``method.response.header.{name}``, where ``name`` is a valid and unique header name. The mapped non-static value must match the pattern of ``integration.response.header.{name}`` or ``integration.response.body.{JSON-expression}``, where ``name`` is a valid and unique response header name and ``JSON-expression`` is a valid JSON expression without the ``$`` prefix.
     */
    @JvmName("xjlbnyniefrqvyby")
    public fun responseParameters(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.responseParameters = mapped
    }

    /**
     * @param value Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
     */
    @JvmName("qroecpucgmxgemgd")
    public suspend fun responseTemplates(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.responseTemplates = mapped
    }

    /**
     * @param values Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
     */
    @JvmName("fqnrvnqspentidba")
    public fun responseTemplates(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.responseTemplates = mapped
    }

    /**
     * @param value Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the ``.+`` regex to match error response. However, make sure that the error response does not contain any newline (``\n``) character in such cases. If the back end is an LAMlong function, the LAMlong function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
     */
    @JvmName("xcdagwnvmkawfcsf")
    public suspend fun selectionPattern(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.selectionPattern = mapped
    }

    /**
     * @param value Specifies the status code that is used to map the integration response to an existing MethodResponse.
     */
    @JvmName("gyhjeinufvqifvfu")
    public suspend fun statusCode(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.statusCode = mapped
    }

    internal fun build(): MethodIntegrationResponseArgs = MethodIntegrationResponseArgs(
        contentHandling = contentHandling,
        responseParameters = responseParameters,
        responseTemplates = responseTemplates,
        selectionPattern = selectionPattern,
        statusCode = statusCode ?: throw PulumiNullFieldException("statusCode"),
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy