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

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

package com.pulumi.awsnative.apigateway.kotlin

import com.pulumi.awsnative.apigateway.UsagePlanArgs.builder
import com.pulumi.awsnative.apigateway.kotlin.inputs.UsagePlanApiStageArgs
import com.pulumi.awsnative.apigateway.kotlin.inputs.UsagePlanApiStageArgsBuilder
import com.pulumi.awsnative.apigateway.kotlin.inputs.UsagePlanQuotaSettingsArgs
import com.pulumi.awsnative.apigateway.kotlin.inputs.UsagePlanQuotaSettingsArgsBuilder
import com.pulumi.awsnative.apigateway.kotlin.inputs.UsagePlanThrottleSettingsArgs
import com.pulumi.awsnative.apigateway.kotlin.inputs.UsagePlanThrottleSettingsArgsBuilder
import com.pulumi.awsnative.kotlin.inputs.TagArgs
import com.pulumi.awsnative.kotlin.inputs.TagArgsBuilder
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * The ``AWS::ApiGateway::UsagePlan`` resource creates a usage plan for deployed APIs. A usage plan sets a target for the throttling and quota limits on individual client API keys. For more information, see [Creating and Using API Usage Plans in Amazon API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html) in the *API Gateway Developer Guide*.
 *  In some cases clients can exceed the targets that you set. Don’t rely on usage plans to control costs. Consider using [](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html) to monitor costs and [](https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html) to manage API requests.
 * @property apiStages The associated API stages of a usage plan.
 * @property description The description of a usage plan.
 * @property quota The target maximum number of permitted requests per a given unit time interval.
 * @property tags The collection of tags. Each tag element is associated with a given resource.
 * @property throttle A map containing method level throttling information for API stage in a usage plan.
 * @property usagePlanName The name of a usage plan.
 */
public data class UsagePlanArgs(
    public val apiStages: Output>? = null,
    public val description: Output? = null,
    public val quota: Output? = null,
    public val tags: Output>? = null,
    public val throttle: Output? = null,
    public val usagePlanName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.apigateway.UsagePlanArgs =
        com.pulumi.awsnative.apigateway.UsagePlanArgs.builder()
            .apiStages(
                apiStages?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .description(description?.applyValue({ args0 -> args0 }))
            .quota(quota?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .throttle(throttle?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .usagePlanName(usagePlanName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [UsagePlanArgs].
 */
@PulumiTagMarker
public class UsagePlanArgsBuilder internal constructor() {
    private var apiStages: Output>? = null

    private var description: Output? = null

    private var quota: Output? = null

    private var tags: Output>? = null

    private var throttle: Output? = null

    private var usagePlanName: Output? = null

    /**
     * @param value The associated API stages of a usage plan.
     */
    @JvmName("ollctktmnxmojpdq")
    public suspend fun apiStages(`value`: Output>) {
        this.apiStages = value
    }

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

    /**
     * @param values The associated API stages of a usage plan.
     */
    @JvmName("gultxoglmowbpboo")
    public suspend fun apiStages(values: List>) {
        this.apiStages = Output.all(values)
    }

    /**
     * @param value The description of a usage plan.
     */
    @JvmName("ljhupgfjmfntalje")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The target maximum number of permitted requests per a given unit time interval.
     */
    @JvmName("dhrkfjberuxtplyh")
    public suspend fun quota(`value`: Output) {
        this.quota = value
    }

    /**
     * @param value The collection of tags. Each tag element is associated with a given resource.
     */
    @JvmName("iqthqqmgkfqmsvfq")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

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

    /**
     * @param values The collection of tags. Each tag element is associated with a given resource.
     */
    @JvmName("yipabqidkwchjoqj")
    public suspend fun tags(values: List>) {
        this.tags = Output.all(values)
    }

    /**
     * @param value A map containing method level throttling information for API stage in a usage plan.
     */
    @JvmName("jqfmdbkwyoyooqux")
    public suspend fun throttle(`value`: Output) {
        this.throttle = value
    }

    /**
     * @param value The name of a usage plan.
     */
    @JvmName("lybiuaiwuuciapqx")
    public suspend fun usagePlanName(`value`: Output) {
        this.usagePlanName = value
    }

    /**
     * @param value The associated API stages of a usage plan.
     */
    @JvmName("wfmyfwvojjbbdevc")
    public suspend fun apiStages(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiStages = mapped
    }

    /**
     * @param argument The associated API stages of a usage plan.
     */
    @JvmName("mujylthmuwkclitx")
    public suspend fun apiStages(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            UsagePlanApiStageArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.apiStages = mapped
    }

    /**
     * @param argument The associated API stages of a usage plan.
     */
    @JvmName("gbpjcfktoasnejgr")
    public suspend fun apiStages(vararg argument: suspend UsagePlanApiStageArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            UsagePlanApiStageArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.apiStages = mapped
    }

    /**
     * @param argument The associated API stages of a usage plan.
     */
    @JvmName("fvodhihdhkkcfvoo")
    public suspend fun apiStages(argument: suspend UsagePlanApiStageArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(UsagePlanApiStageArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.apiStages = mapped
    }

    /**
     * @param values The associated API stages of a usage plan.
     */
    @JvmName("qiukarqprdcrqdrb")
    public suspend fun apiStages(vararg values: UsagePlanApiStageArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.apiStages = mapped
    }

    /**
     * @param value The description of a usage plan.
     */
    @JvmName("ooggcesgfryuiefr")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The target maximum number of permitted requests per a given unit time interval.
     */
    @JvmName("clnovcpggqpefppe")
    public suspend fun quota(`value`: UsagePlanQuotaSettingsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.quota = mapped
    }

    /**
     * @param argument The target maximum number of permitted requests per a given unit time interval.
     */
    @JvmName("ubjbcfvonywmxeul")
    public suspend fun quota(argument: suspend UsagePlanQuotaSettingsArgsBuilder.() -> Unit) {
        val toBeMapped = UsagePlanQuotaSettingsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.quota = mapped
    }

    /**
     * @param value The collection of tags. Each tag element is associated with a given resource.
     */
    @JvmName("oacxstyraofvyfbb")
    public suspend fun tags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param argument The collection of tags. Each tag element is associated with a given resource.
     */
    @JvmName("kbjxelsrcakmospe")
    public suspend fun tags(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument The collection of tags. Each tag element is associated with a given resource.
     */
    @JvmName("hyshaequsvidhyiq")
    public suspend fun tags(vararg argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument The collection of tags. Each tag element is associated with a given resource.
     */
    @JvmName("bekycojjgrnidqvl")
    public suspend fun tags(argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TagArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param values The collection of tags. Each tag element is associated with a given resource.
     */
    @JvmName("rpsvifdotchbdfdf")
    public suspend fun tags(vararg values: TagArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value A map containing method level throttling information for API stage in a usage plan.
     */
    @JvmName("wdcioelnctmsqnuf")
    public suspend fun throttle(`value`: UsagePlanThrottleSettingsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.throttle = mapped
    }

    /**
     * @param argument A map containing method level throttling information for API stage in a usage plan.
     */
    @JvmName("oeqiobxmklfshxdu")
    public suspend fun throttle(argument: suspend UsagePlanThrottleSettingsArgsBuilder.() -> Unit) {
        val toBeMapped = UsagePlanThrottleSettingsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.throttle = mapped
    }

    /**
     * @param value The name of a usage plan.
     */
    @JvmName("xjnmbvtnuylystbe")
    public suspend fun usagePlanName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.usagePlanName = mapped
    }

    internal fun build(): UsagePlanArgs = UsagePlanArgs(
        apiStages = apiStages,
        description = description,
        quota = quota,
        tags = tags,
        throttle = throttle,
        usagePlanName = usagePlanName,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy