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

com.pulumi.awsnative.apigatewayv2.kotlin.RouteArgs.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.11.0.0
Show newest version
@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("yaibsaenujftcsyp")
    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("vmqcbkotyobyiewm")
    public suspend fun apiKeyRequired(`value`: Output) {
        this.apiKeyRequired = value
    }

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

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

    /**
     * @param values The authorization scopes supported by this route.
     */
    @JvmName("egfhskcxshnmafno")
    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("ghjfyohanqdcivdy")
    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("puwlojevwswfpfvf")
    public suspend fun authorizerId(`value`: Output) {
        this.authorizerId = value
    }

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

    /**
     * @param value The operation name for the route.
     */
    @JvmName("psqokbkhxhkccelg")
    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("xubflgqjhqjhdvpr")
    public suspend fun requestModels(`value`: Output) {
        this.requestModels = value
    }

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

    @JvmName("lpglhejiwdswirfw")
    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("uojgqxcdqlgwsbse")
    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("vfekxqrrppypuiih")
    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("ycbdpigqasnmqlce")
    public suspend fun routeResponseSelectionExpression(`value`: Output) {
        this.routeResponseSelectionExpression = value
    }

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

    /**
     * @param value The API identifier.
     */
    @JvmName("iuwgrswqemdjqnef")
    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("yghusvithuquatld")
    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("yrcumwwcmrqajnhp")
    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("odhxofjrmodjtmui")
    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("grbyxqqngctmrnib")
    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("usdeciqwifuphjio")
    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("mlhklpmihwpuvdan")
    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("aoepqchtpjsnpbqg")
    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("delqotofakhigbin")
    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("agpuxjjxknoekeoh")
    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("aqothpjpmmgoqdnr")
    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("rawkacgrxfxbugyq")
    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("qltpdrxnrqvpdemu")
    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("vxmroggiilaaucbs")
    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("mnasluugewyksiqc")
    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("ivsyelwkucjhvgcb")
    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("brymoplujolweobw")
    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 - 2024 Weber Informatics LLC | Privacy Policy