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

com.pulumi.awsnative.budgets.kotlin.BudgetsAction.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.budgets.kotlin

import com.pulumi.awsnative.budgets.kotlin.enums.BudgetsActionActionType
import com.pulumi.awsnative.budgets.kotlin.enums.BudgetsActionApprovalModel
import com.pulumi.awsnative.budgets.kotlin.enums.BudgetsActionNotificationType
import com.pulumi.awsnative.budgets.kotlin.outputs.BudgetsActionActionThreshold
import com.pulumi.awsnative.budgets.kotlin.outputs.BudgetsActionDefinition
import com.pulumi.awsnative.budgets.kotlin.outputs.BudgetsActionSubscriber
import com.pulumi.awsnative.kotlin.outputs.Tag
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.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.budgets.kotlin.enums.BudgetsActionActionType.Companion.toKotlin as budgetsActionActionTypeToKotlin
import com.pulumi.awsnative.budgets.kotlin.enums.BudgetsActionApprovalModel.Companion.toKotlin as budgetsActionApprovalModelToKotlin
import com.pulumi.awsnative.budgets.kotlin.enums.BudgetsActionNotificationType.Companion.toKotlin as budgetsActionNotificationTypeToKotlin
import com.pulumi.awsnative.budgets.kotlin.outputs.BudgetsActionActionThreshold.Companion.toKotlin as budgetsActionActionThresholdToKotlin
import com.pulumi.awsnative.budgets.kotlin.outputs.BudgetsActionDefinition.Companion.toKotlin as budgetsActionDefinitionToKotlin
import com.pulumi.awsnative.budgets.kotlin.outputs.BudgetsActionSubscriber.Companion.toKotlin as budgetsActionSubscriberToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: BudgetsActionArgs = BudgetsActionArgs()

    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 BudgetsActionArgsBuilder.() -> Unit) {
        val builder = BudgetsActionArgsBuilder()
        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(): BudgetsAction {
        val builtJavaResource = com.pulumi.awsnative.budgets.BudgetsAction(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return BudgetsAction(builtJavaResource)
    }
}

/**
 * An example resource schema demonstrating some basic constructs and validation rules.
 */
public class BudgetsAction internal constructor(
    override val javaResource: com.pulumi.awsnative.budgets.BudgetsAction,
) : KotlinCustomResource(javaResource, BudgetsActionMapper) {
    /**
     * A system-generated universally unique identifier (UUID) for the action.
     */
    public val actionId: Output
        get() = javaResource.actionId().applyValue({ args0 -> args0 })

    /**
     * The trigger threshold of the action.
     */
    public val actionThreshold: Output
        get() = javaResource.actionThreshold().applyValue({ args0 ->
            args0.let({ args0 ->
                budgetsActionActionThresholdToKotlin(args0)
            })
        })

    /**
     * The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.
     */
    public val actionType: Output
        get() = javaResource.actionType().applyValue({ args0 ->
            args0.let({ args0 ->
                budgetsActionActionTypeToKotlin(args0)
            })
        })

    /**
     * This specifies if the action needs manual or automatic approval.
     */
    public val approvalModel: Output?
        get() = javaResource.approvalModel().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> budgetsActionApprovalModelToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * A string that represents the budget name. ":" and "\" characters aren't allowed.
     */
    public val budgetName: Output
        get() = javaResource.budgetName().applyValue({ args0 -> args0 })

    /**
     * Specifies all of the type-specific parameters.
     */
    public val definition: Output
        get() = javaResource.definition().applyValue({ args0 ->
            args0.let({ args0 ->
                budgetsActionDefinitionToKotlin(args0)
            })
        })

    /**
     * The role passed for action execution and reversion. Roles and actions must be in the same account.
     */
    public val executionRoleArn: Output
        get() = javaResource.executionRoleArn().applyValue({ args0 -> args0 })

    /**
     * The type of a notification.
     */
    public val notificationType: Output
        get() = javaResource.notificationType().applyValue({ args0 ->
            args0.let({ args0 ->
                budgetsActionNotificationTypeToKotlin(args0)
            })
        })

    /**
     * An optional list of tags to associate with the specified budget action. Each tag consists of a key and a value, and each key must be unique for the resource.
     */
    public val resourceTags: Output>?
        get() = javaResource.resourceTags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * A list of subscribers.
     */
    public val subscribers: Output>
        get() = javaResource.subscribers().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    budgetsActionSubscriberToKotlin(args0)
                })
            })
        })
}

public object BudgetsActionMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.budgets.BudgetsAction::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy