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

com.pulumi.awsnative.apigatewayv2.kotlin.IntegrationResponse.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.apigatewayv2.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Any
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [IntegrationResponse].
 */
@PulumiTagMarker
public class IntegrationResponseResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: IntegrationResponseArgs = IntegrationResponseArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend IntegrationResponseArgsBuilder.() -> Unit) {
        val builder = IntegrationResponseArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): IntegrationResponse {
        val builtJavaResource =
            com.pulumi.awsnative.apigatewayv2.IntegrationResponse(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return IntegrationResponse(builtJavaResource)
    }
}

/**
 * The ``AWS::ApiGatewayV2::IntegrationResponse`` resource updates an integration response for an WebSocket API. For more information, see [Set up WebSocket API Integration Responses in API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-integration-responses.html) in the *API Gateway Developer Guide*.
 */
public class IntegrationResponse internal constructor(
    override val javaResource: com.pulumi.awsnative.apigatewayv2.IntegrationResponse,
) : KotlinCustomResource(javaResource, IntegrationResponseMapper) {
    /**
     * The API identifier.
     */
    public val apiId: Output
        get() = javaResource.apiId().applyValue({ args0 -> args0 })

    /**
     * Supported only for WebSocket APIs. Specifies how to handle response payload content type conversions. Supported values are ``CONVERT_TO_BINARY`` and ``CONVERT_TO_TEXT``, with the following behaviors:
     *   ``CONVERT_TO_BINARY``: Converts a response payload from a Base64-encoded string to the corresponding binary blob.
     *   ``CONVERT_TO_TEXT``: Converts a response payload from a binary blob to a Base64-encoded string.
     *  If this property is not defined, the response payload will be passed through from the integration response to the route response or method response without modification.
     */
    public val contentHandlingStrategy: Output?
        get() = javaResource.contentHandlingStrategy().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The integration ID.
     */
    public val integrationId: Output
        get() = javaResource.integrationId().applyValue({ args0 -> args0 })

    /**
     * The integration response ID.
     */
    public val integrationResponseId: Output
        get() = javaResource.integrationResponseId().applyValue({ args0 -> args0 })

    /**
     * The integration response key.
     */
    public val integrationResponseKey: Output
        get() = javaResource.integrationResponseKey().applyValue({ args0 -> args0 })

    /**
     * A key-value map specifying response parameters that are passed to the method response from the backend. 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.
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::ApiGatewayV2::IntegrationResponse` for more information about the expected schema for this property.
     */
    public val responseParameters: Output?
        get() = javaResource.responseParameters().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The collection of response templates for the integration response as a string-to-string map of key-value pairs. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::ApiGatewayV2::IntegrationResponse` for more information about the expected schema for this property.
     */
    public val responseTemplates: Output?
        get() = javaResource.responseTemplates().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The template selection expression for the integration response. Supported only for WebSocket APIs.
     */
    public val templateSelectionExpression: Output?
        get() = javaResource.templateSelectionExpression().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object IntegrationResponseMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.apigatewayv2.IntegrationResponse::class == javaResource::class

    override fun map(javaResource: Resource): IntegrationResponse = IntegrationResponse(
        javaResource
            as com.pulumi.awsnative.apigatewayv2.IntegrationResponse,
    )
}

/**
 * @see [IntegrationResponse].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [IntegrationResponse].
 */
public suspend fun integrationResponse(
    name: String,
    block: suspend IntegrationResponseResourceBuilder.() -> Unit,
): IntegrationResponse {
    val builder = IntegrationResponseResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [IntegrationResponse].
 * @param name The _unique_ name of the resulting resource.
 */
public fun integrationResponse(name: String): IntegrationResponse {
    val builder = IntegrationResponseResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy