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

com.pulumi.awsnative.apigatewayv2.kotlin.RouteArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.apigatewayv2.kotlin

import com.pulumi.awsnative.apigatewayv2.RouteArgs.builder
import com.pulumi.awsnative.apigatewayv2.kotlin.inputs.RouteParameterConstraintsArgs
import com.pulumi.awsnative.apigatewayv2.kotlin.inputs.RouteParameterConstraintsArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Any
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * The ``AWS::ApiGatewayV2::Route`` resource creates a route for an API.
 * @property apiId The API identifier.
 * @property apiKeyRequired Specifies whether an API key is required for the route. Supported only for WebSocket APIs.
 * @property authorizationScopes The authorization scopes supported by this route.
 * @property authorizationType The authorization type for the route. For WebSocket APIs, valid values are ``NONE`` for open access, ``AWS_IAM`` for using AWS IAM permissions, and ``CUSTOM`` for using a Lambda authorizer. For HTTP APIs, valid values are ``NONE`` for open access, ``JWT`` for using JSON Web Tokens, ``AWS_IAM`` for using AWS IAM permissions, and ``CUSTOM`` for using a Lambda authorizer.
 * @property authorizerId The identifier of the ``Authorizer`` resource to be associated with this route. The authorizer identifier is generated by API Gateway when you created the authorizer.
 * @property modelSelectionExpression The model selection expression for the route. Supported only for WebSocket APIs.
 * @property operationName The operation name for the route.
 * @property requestModels The request models for the route. Supported only for WebSocket APIs.
 * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::ApiGatewayV2::Route` for more information about the expected schema for this property.
 * @property requestParameters The request parameters for the route. Supported only for WebSocket APIs.
 * @property routeKey The route key for the route. For HTTP APIs, the route key can be either ``$default``, or a combination of an HTTP method and resource path, for example, ``GET /pets``.
 * @property routeResponseSelectionExpression The route response selection expression for the route. Supported only for WebSocket APIs.
 * @property target The target for the route.
 */
public data class RouteArgs(
    public val apiId: Output? = null,
    public val apiKeyRequired: Output? = null,
    public val authorizationScopes: Output>? = null,
    public val authorizationType: Output? = null,
    public val authorizerId: Output? = null,
    public val modelSelectionExpression: Output? = null,
    public val operationName: Output? = null,
    public val requestModels: Output? = null,
    public val requestParameters: Output>? = null,
    public val routeKey: Output? = null,
    public val routeResponseSelectionExpression: Output? = null,
    public val target: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.apigatewayv2.RouteArgs =
        com.pulumi.awsnative.apigatewayv2.RouteArgs.builder()
            .apiId(apiId?.applyValue({ args0 -> args0 }))
            .apiKeyRequired(apiKeyRequired?.applyValue({ args0 -> args0 }))
            .authorizationScopes(authorizationScopes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .authorizationType(authorizationType?.applyValue({ args0 -> args0 }))
            .authorizerId(authorizerId?.applyValue({ args0 -> args0 }))
            .modelSelectionExpression(modelSelectionExpression?.applyValue({ args0 -> args0 }))
            .operationName(operationName?.applyValue({ args0 -> args0 }))
            .requestModels(requestModels?.applyValue({ args0 -> args0 }))
            .requestParameters(
                requestParameters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .routeKey(routeKey?.applyValue({ args0 -> args0 }))
            .routeResponseSelectionExpression(routeResponseSelectionExpression?.applyValue({ args0 -> args0 }))
            .target(target?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [RouteArgs].
 */
@PulumiTagMarker
public class RouteArgsBuilder internal constructor() {
    private var apiId: Output? = null

    private var apiKeyRequired: Output? = null

    private var authorizationScopes: Output>? = null

    private var authorizationType: Output? = null

    private var authorizerId: Output? = null

    private var modelSelectionExpression: Output? = null

    private var operationName: Output? = null

    private var requestModels: Output? = null

    private var requestParameters: Output>? = null

    private var routeKey: Output? = null

    private var routeResponseSelectionExpression: Output? = null

    private var target: Output? = null

    /**
     * @param value The API identifier.
     */
    @JvmName("vwlqoudhnedfuaax")
    public suspend fun apiId(`value`: Output) {
        this.apiId = value
    }

    /**
     * @param value Specifies whether an API key is required for the route. Supported only for WebSocket APIs.
     */
    @JvmName("phvmvryhkefxvenw")
    public suspend fun apiKeyRequired(`value`: Output) {
        this.apiKeyRequired = value
    }

    /**
     * @param value The authorization scopes supported by this route.
     */
    @JvmName("aadigdnouiiywrps")
    public suspend fun authorizationScopes(`value`: Output>) {
        this.authorizationScopes = value
    }

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

    /**
     * @param values The authorization scopes supported by this route.
     */
    @JvmName("hrvxktcfkyjupbca")
    public suspend fun authorizationScopes(values: List>) {
        this.authorizationScopes = Output.all(values)
    }

    /**
     * @param value The authorization type for the route. For WebSocket APIs, valid values are ``NONE`` for open access, ``AWS_IAM`` for using AWS IAM permissions, and ``CUSTOM`` for using a Lambda authorizer. For HTTP APIs, valid values are ``NONE`` for open access, ``JWT`` for using JSON Web Tokens, ``AWS_IAM`` for using AWS IAM permissions, and ``CUSTOM`` for using a Lambda authorizer.
     */
    @JvmName("eplctipnlkjeoiyh")
    public suspend fun authorizationType(`value`: Output) {
        this.authorizationType = value
    }

    /**
     * @param value The identifier of the ``Authorizer`` resource to be associated with this route. The authorizer identifier is generated by API Gateway when you created the authorizer.
     */
    @JvmName("sibnctjbswyycbtp")
    public suspend fun authorizerId(`value`: Output) {
        this.authorizerId = value
    }

    /**
     * @param value The model selection expression for the route. Supported only for WebSocket APIs.
     */
    @JvmName("lcrdwgjomqblnebq")
    public suspend fun modelSelectionExpression(`value`: Output) {
        this.modelSelectionExpression = value
    }

    /**
     * @param value The operation name for the route.
     */
    @JvmName("pgdbmdwowtbteoex")
    public suspend fun operationName(`value`: Output) {
        this.operationName = value
    }

    /**
     * @param value The request models for the route. Supported only for WebSocket APIs.
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::ApiGatewayV2::Route` for more information about the expected schema for this property.
     */
    @JvmName("dywogxkvltxpltaj")
    public suspend fun requestModels(`value`: Output) {
        this.requestModels = value
    }

    /**
     * @param value The request parameters for the route. Supported only for WebSocket APIs.
     */
    @JvmName("rciyoenhsywkyhod")
    public suspend fun requestParameters(`value`: Output>) {
        this.requestParameters = value
    }

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

    /**
     * @param values The request parameters for the route. Supported only for WebSocket APIs.
     */
    @JvmName("eqfolyeuoemrscwp")
    public suspend fun requestParameters(values: List>) {
        this.requestParameters = Output.all(values)
    }

    /**
     * @param value The route key for the route. For HTTP APIs, the route key can be either ``$default``, or a combination of an HTTP method and resource path, for example, ``GET /pets``.
     */
    @JvmName("goaxysfbqtweamwh")
    public suspend fun routeKey(`value`: Output) {
        this.routeKey = value
    }

    /**
     * @param value The route response selection expression for the route. Supported only for WebSocket APIs.
     */
    @JvmName("hyvdrqqbmtdwyddb")
    public suspend fun routeResponseSelectionExpression(`value`: Output) {
        this.routeResponseSelectionExpression = value
    }

    /**
     * @param value The target for the route.
     */
    @JvmName("skacyqvdrhwpdjdi")
    public suspend fun target(`value`: Output) {
        this.target = value
    }

    /**
     * @param value The API identifier.
     */
    @JvmName("gurungsfeiohogun")
    public suspend fun apiId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiId = mapped
    }

    /**
     * @param value Specifies whether an API key is required for the route. Supported only for WebSocket APIs.
     */
    @JvmName("jivqsfjxwqmrxqvp")
    public suspend fun apiKeyRequired(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiKeyRequired = mapped
    }

    /**
     * @param value The authorization scopes supported by this route.
     */
    @JvmName("eghkgvdddppiayrf")
    public suspend fun authorizationScopes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authorizationScopes = mapped
    }

    /**
     * @param values The authorization scopes supported by this route.
     */
    @JvmName("fpmijkkhwrecduou")
    public suspend fun authorizationScopes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.authorizationScopes = mapped
    }

    /**
     * @param value The authorization type for the route. For WebSocket APIs, valid values are ``NONE`` for open access, ``AWS_IAM`` for using AWS IAM permissions, and ``CUSTOM`` for using a Lambda authorizer. For HTTP APIs, valid values are ``NONE`` for open access, ``JWT`` for using JSON Web Tokens, ``AWS_IAM`` for using AWS IAM permissions, and ``CUSTOM`` for using a Lambda authorizer.
     */
    @JvmName("xipyxbbpsnxowmnw")
    public suspend fun authorizationType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authorizationType = mapped
    }

    /**
     * @param value The identifier of the ``Authorizer`` resource to be associated with this route. The authorizer identifier is generated by API Gateway when you created the authorizer.
     */
    @JvmName("nqbvbhtsksqpongs")
    public suspend fun authorizerId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authorizerId = mapped
    }

    /**
     * @param value The model selection expression for the route. Supported only for WebSocket APIs.
     */
    @JvmName("qyimffvdtlfxmhfs")
    public suspend fun modelSelectionExpression(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.modelSelectionExpression = mapped
    }

    /**
     * @param value The operation name for the route.
     */
    @JvmName("ttfjdvqjjewiotlw")
    public suspend fun operationName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.operationName = mapped
    }

    /**
     * @param value The request models for the route. Supported only for WebSocket APIs.
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::ApiGatewayV2::Route` for more information about the expected schema for this property.
     */
    @JvmName("yuwlqjcukajnemrq")
    public suspend fun requestModels(`value`: Any?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestModels = mapped
    }

    /**
     * @param value The request parameters for the route. Supported only for WebSocket APIs.
     */
    @JvmName("pwpppkqyvrpxhhtr")
    public suspend fun requestParameters(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestParameters = mapped
    }

    /**
     * @param argument The request parameters for the route. Supported only for WebSocket APIs.
     */
    @JvmName("gesuyhqfcveovgoj")
    public suspend fun requestParameters(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            RouteParameterConstraintsArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.requestParameters = mapped
    }

    /**
     * @param argument The request parameters for the route. Supported only for WebSocket APIs.
     */
    @JvmName("fkyohmsgqdvmuwtf")
    public suspend fun requestParameters(vararg argument: suspend RouteParameterConstraintsArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            RouteParameterConstraintsArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.requestParameters = mapped
    }

    /**
     * @param argument The request parameters for the route. Supported only for WebSocket APIs.
     */
    @JvmName("ygqcegvkcbplugrx")
    public suspend fun requestParameters(argument: suspend RouteParameterConstraintsArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            RouteParameterConstraintsArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.requestParameters = mapped
    }

    /**
     * @param values The request parameters for the route. Supported only for WebSocket APIs.
     */
    @JvmName("ryhuijpjvgswpqle")
    public suspend fun requestParameters(vararg values: RouteParameterConstraintsArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.requestParameters = mapped
    }

    /**
     * @param value The route key for the route. For HTTP APIs, the route key can be either ``$default``, or a combination of an HTTP method and resource path, for example, ``GET /pets``.
     */
    @JvmName("jlvhssmedteqebol")
    public suspend fun routeKey(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.routeKey = mapped
    }

    /**
     * @param value The route response selection expression for the route. Supported only for WebSocket APIs.
     */
    @JvmName("rvnfqadgxosylsml")
    public suspend fun routeResponseSelectionExpression(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.routeResponseSelectionExpression = mapped
    }

    /**
     * @param value The target for the route.
     */
    @JvmName("ctemjxiprnnjcvtd")
    public suspend fun target(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.target = mapped
    }

    internal fun build(): RouteArgs = RouteArgs(
        apiId = apiId,
        apiKeyRequired = apiKeyRequired,
        authorizationScopes = authorizationScopes,
        authorizationType = authorizationType,
        authorizerId = authorizerId,
        modelSelectionExpression = modelSelectionExpression,
        operationName = operationName,
        requestModels = requestModels,
        requestParameters = requestParameters,
        routeKey = routeKey,
        routeResponseSelectionExpression = routeResponseSelectionExpression,
        target = target,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy