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

com.pulumi.azure.costmanagement.kotlin.ScheduledActionArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.costmanagement.kotlin

import com.pulumi.azure.costmanagement.ScheduledActionArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages an Azure Cost Management Scheduled Action.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.costmanagement.ScheduledAction("example", {
 *     name: "examplescheduledaction",
 *     displayName: "Report Last 6 Months",
 *     viewId: "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/views/ms:CostByService",
 *     emailAddressSender: "[email protected]",
 *     emailSubject: "Cost Management Report",
 *     emailAddresses: ["example@example.com"],
 *     message: "Hi all, take a look at last 6 months spending!",
 *     frequency: "Daily",
 *     startDate: "2023-01-02T00:00:00Z",
 *     endDate: "2023-02-02T00:00:00Z",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.costmanagement.ScheduledAction("example",
 *     name="examplescheduledaction",
 *     display_name="Report Last 6 Months",
 *     view_id="/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/views/ms:CostByService",
 *     email_address_sender="[email protected]",
 *     email_subject="Cost Management Report",
 *     email_addresses=["example@example.com"],
 *     message="Hi all, take a look at last 6 months spending!",
 *     frequency="Daily",
 *     start_date="2023-01-02T00:00:00Z",
 *     end_date="2023-02-02T00:00:00Z")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.CostManagement.ScheduledAction("example", new()
 *     {
 *         Name = "examplescheduledaction",
 *         DisplayName = "Report Last 6 Months",
 *         ViewId = "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/views/ms:CostByService",
 *         EmailAddressSender = "[email protected]",
 *         EmailSubject = "Cost Management Report",
 *         EmailAddresses = new[]
 *         {
 *             "[email protected]",
 *         },
 *         Message = "Hi all, take a look at last 6 months spending!",
 *         Frequency = "Daily",
 *         StartDate = "2023-01-02T00:00:00Z",
 *         EndDate = "2023-02-02T00:00:00Z",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/costmanagement"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := costmanagement.NewScheduledAction(ctx, "example", &costmanagement.ScheduledActionArgs{
 * 			Name:               pulumi.String("examplescheduledaction"),
 * 			DisplayName:        pulumi.String("Report Last 6 Months"),
 * 			ViewId:             pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/views/ms:CostByService"),
 * 			EmailAddressSender: pulumi.String("[email protected]"),
 * 			EmailSubject:       pulumi.String("Cost Management Report"),
 * 			EmailAddresses: pulumi.StringArray{
 * 				pulumi.String("[email protected]"),
 * 			},
 * 			Message:   pulumi.String("Hi all, take a look at last 6 months spending!"),
 * 			Frequency: pulumi.String("Daily"),
 * 			StartDate: pulumi.String("2023-01-02T00:00:00Z"),
 * 			EndDate:   pulumi.String("2023-02-02T00:00:00Z"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.costmanagement.ScheduledAction;
 * import com.pulumi.azure.costmanagement.ScheduledActionArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var example = new ScheduledAction("example", ScheduledActionArgs.builder()
 *             .name("examplescheduledaction")
 *             .displayName("Report Last 6 Months")
 *             .viewId("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/views/ms:CostByService")
 *             .emailAddressSender("[email protected]")
 *             .emailSubject("Cost Management Report")
 *             .emailAddresses("[email protected]")
 *             .message("Hi all, take a look at last 6 months spending!")
 *             .frequency("Daily")
 *             .startDate("2023-01-02T00:00:00Z")
 *             .endDate("2023-02-02T00:00:00Z")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:costmanagement:ScheduledAction
 *     properties:
 *       name: examplescheduledaction
 *       displayName: Report Last 6 Months
 *       viewId: /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/views/ms:CostByService
 *       emailAddressSender: [email protected]
 *       emailSubject: Cost Management Report
 *       emailAddresses:
 *         - [email protected]
 *       message: Hi all, take a look at last 6 months spending!
 *       frequency: Daily
 *       startDate: 2023-01-02T00:00:00Z
 *       endDate: 2023-02-02T00:00:00Z
 * ```
 * 
 * ## Import
 * Azure Cost Management Scheduled Actions can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:costmanagement/scheduledAction:ScheduledAction example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/scheduledaction1
 * ```
 * @property dayOfMonth UTC day on which cost analysis data will be emailed. Must be between `1` and `31`. This property is applicable when `frequency` is `Monthly`.
 * @property daysOfWeeks Specifies a list of day names on which cost analysis data will be emailed. This property is applicable when frequency is `Weekly` or `Monthly`. Possible values are `Friday`, `Monday`, `Saturday`, `Sunday`, `Thursday`, `Tuesday` and `Wednesday`.
 * @property displayName User visible input name of the Cost Management Scheduled Action.
 * @property emailAddressSender Email address of the point of contact that should get the unsubscribe requests of Scheduled Action notification emails.
 * @property emailAddresses Specifies a list of email addresses that will receive the Scheduled Action.
 * @property emailSubject Subject of the email. Length is limited to 70 characters.
 * @property endDate The end date and time of the Scheduled Action (UTC).
 * @property frequency Frequency of the schedule. Possible values are `Daily`, `Monthly` and `Weekly`. Value `Monthly` requires either `weeks_of_month` and `days_of_week` or `day_of_month` to be specified. Value `Weekly` requires `days_of_week` to be specified.
 * @property hourOfDay UTC time at which cost analysis data will be emailed. Must be between `0` and `23`.
 * @property message Message to be added in the email. Length is limited to 250 characters.
 * @property name The name which should be used for this Azure Cost Management Scheduled Action. Changing this forces a new Azure Cost Management Scheduled Action to be created.
 * @property startDate The start date and time of the Scheduled Action (UTC).
 * @property viewId The ID of the Cost Management View that is used by the Scheduled Action. Changing this forces a new resource to be created.
 * @property weeksOfMonths Specifies a list of weeks in which cost analysis data will be emailed. This property is applicable when `frequency` is `Monthly` and used in combination with `days_of_week`. Possible values are `First`, `Fourth`, `Last`, `Second` and `Third`.
 */
public data class ScheduledActionArgs(
    public val dayOfMonth: Output? = null,
    public val daysOfWeeks: Output>? = null,
    public val displayName: Output? = null,
    public val emailAddressSender: Output? = null,
    public val emailAddresses: Output>? = null,
    public val emailSubject: Output? = null,
    public val endDate: Output? = null,
    public val frequency: Output? = null,
    public val hourOfDay: Output? = null,
    public val message: Output? = null,
    public val name: Output? = null,
    public val startDate: Output? = null,
    public val viewId: Output? = null,
    public val weeksOfMonths: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.costmanagement.ScheduledActionArgs =
        com.pulumi.azure.costmanagement.ScheduledActionArgs.builder()
            .dayOfMonth(dayOfMonth?.applyValue({ args0 -> args0 }))
            .daysOfWeeks(daysOfWeeks?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .emailAddressSender(emailAddressSender?.applyValue({ args0 -> args0 }))
            .emailAddresses(emailAddresses?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .emailSubject(emailSubject?.applyValue({ args0 -> args0 }))
            .endDate(endDate?.applyValue({ args0 -> args0 }))
            .frequency(frequency?.applyValue({ args0 -> args0 }))
            .hourOfDay(hourOfDay?.applyValue({ args0 -> args0 }))
            .message(message?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .startDate(startDate?.applyValue({ args0 -> args0 }))
            .viewId(viewId?.applyValue({ args0 -> args0 }))
            .weeksOfMonths(weeksOfMonths?.applyValue({ args0 -> args0.map({ args0 -> args0 }) })).build()
}

/**
 * Builder for [ScheduledActionArgs].
 */
@PulumiTagMarker
public class ScheduledActionArgsBuilder internal constructor() {
    private var dayOfMonth: Output? = null

    private var daysOfWeeks: Output>? = null

    private var displayName: Output? = null

    private var emailAddressSender: Output? = null

    private var emailAddresses: Output>? = null

    private var emailSubject: Output? = null

    private var endDate: Output? = null

    private var frequency: Output? = null

    private var hourOfDay: Output? = null

    private var message: Output? = null

    private var name: Output? = null

    private var startDate: Output? = null

    private var viewId: Output? = null

    private var weeksOfMonths: Output>? = null

    /**
     * @param value UTC day on which cost analysis data will be emailed. Must be between `1` and `31`. This property is applicable when `frequency` is `Monthly`.
     */
    @JvmName("kptaainntdwvapoo")
    public suspend fun dayOfMonth(`value`: Output) {
        this.dayOfMonth = value
    }

    /**
     * @param value Specifies a list of day names on which cost analysis data will be emailed. This property is applicable when frequency is `Weekly` or `Monthly`. Possible values are `Friday`, `Monday`, `Saturday`, `Sunday`, `Thursday`, `Tuesday` and `Wednesday`.
     */
    @JvmName("eenjuefagjppfklt")
    public suspend fun daysOfWeeks(`value`: Output>) {
        this.daysOfWeeks = value
    }

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

    /**
     * @param values Specifies a list of day names on which cost analysis data will be emailed. This property is applicable when frequency is `Weekly` or `Monthly`. Possible values are `Friday`, `Monday`, `Saturday`, `Sunday`, `Thursday`, `Tuesday` and `Wednesday`.
     */
    @JvmName("elacwnhfmbahgmiu")
    public suspend fun daysOfWeeks(values: List>) {
        this.daysOfWeeks = Output.all(values)
    }

    /**
     * @param value User visible input name of the Cost Management Scheduled Action.
     */
    @JvmName("vkadwdwavsktpigf")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value Email address of the point of contact that should get the unsubscribe requests of Scheduled Action notification emails.
     */
    @JvmName("balnhpedvblcgxhm")
    public suspend fun emailAddressSender(`value`: Output) {
        this.emailAddressSender = value
    }

    /**
     * @param value Specifies a list of email addresses that will receive the Scheduled Action.
     */
    @JvmName("ltyoajxsfhccmqxk")
    public suspend fun emailAddresses(`value`: Output>) {
        this.emailAddresses = value
    }

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

    /**
     * @param values Specifies a list of email addresses that will receive the Scheduled Action.
     */
    @JvmName("kkmxfiehnybcjwmt")
    public suspend fun emailAddresses(values: List>) {
        this.emailAddresses = Output.all(values)
    }

    /**
     * @param value Subject of the email. Length is limited to 70 characters.
     */
    @JvmName("mrepaksdnhframsg")
    public suspend fun emailSubject(`value`: Output) {
        this.emailSubject = value
    }

    /**
     * @param value The end date and time of the Scheduled Action (UTC).
     */
    @JvmName("kpaacdnaigactgee")
    public suspend fun endDate(`value`: Output) {
        this.endDate = value
    }

    /**
     * @param value Frequency of the schedule. Possible values are `Daily`, `Monthly` and `Weekly`. Value `Monthly` requires either `weeks_of_month` and `days_of_week` or `day_of_month` to be specified. Value `Weekly` requires `days_of_week` to be specified.
     */
    @JvmName("nlqhwldapmpqxvuf")
    public suspend fun frequency(`value`: Output) {
        this.frequency = value
    }

    /**
     * @param value UTC time at which cost analysis data will be emailed. Must be between `0` and `23`.
     */
    @JvmName("ovxgdylejhsxbbdk")
    public suspend fun hourOfDay(`value`: Output) {
        this.hourOfDay = value
    }

    /**
     * @param value Message to be added in the email. Length is limited to 250 characters.
     */
    @JvmName("wocdkxvcthhlfflt")
    public suspend fun message(`value`: Output) {
        this.message = value
    }

    /**
     * @param value The name which should be used for this Azure Cost Management Scheduled Action. Changing this forces a new Azure Cost Management Scheduled Action to be created.
     */
    @JvmName("skfteqbwgmaysltj")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The start date and time of the Scheduled Action (UTC).
     */
    @JvmName("ljjotgvygdeqwtau")
    public suspend fun startDate(`value`: Output) {
        this.startDate = value
    }

    /**
     * @param value The ID of the Cost Management View that is used by the Scheduled Action. Changing this forces a new resource to be created.
     */
    @JvmName("menqqwjwbiwvcrjk")
    public suspend fun viewId(`value`: Output) {
        this.viewId = value
    }

    /**
     * @param value Specifies a list of weeks in which cost analysis data will be emailed. This property is applicable when `frequency` is `Monthly` and used in combination with `days_of_week`. Possible values are `First`, `Fourth`, `Last`, `Second` and `Third`.
     */
    @JvmName("pavodaeipfssxgdr")
    public suspend fun weeksOfMonths(`value`: Output>) {
        this.weeksOfMonths = value
    }

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

    /**
     * @param values Specifies a list of weeks in which cost analysis data will be emailed. This property is applicable when `frequency` is `Monthly` and used in combination with `days_of_week`. Possible values are `First`, `Fourth`, `Last`, `Second` and `Third`.
     */
    @JvmName("maxpkrswbqllaslu")
    public suspend fun weeksOfMonths(values: List>) {
        this.weeksOfMonths = Output.all(values)
    }

    /**
     * @param value UTC day on which cost analysis data will be emailed. Must be between `1` and `31`. This property is applicable when `frequency` is `Monthly`.
     */
    @JvmName("basxvfhkihfdxhvu")
    public suspend fun dayOfMonth(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dayOfMonth = mapped
    }

    /**
     * @param value Specifies a list of day names on which cost analysis data will be emailed. This property is applicable when frequency is `Weekly` or `Monthly`. Possible values are `Friday`, `Monday`, `Saturday`, `Sunday`, `Thursday`, `Tuesday` and `Wednesday`.
     */
    @JvmName("bcxsutmbwyjvhlcj")
    public suspend fun daysOfWeeks(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.daysOfWeeks = mapped
    }

    /**
     * @param values Specifies a list of day names on which cost analysis data will be emailed. This property is applicable when frequency is `Weekly` or `Monthly`. Possible values are `Friday`, `Monday`, `Saturday`, `Sunday`, `Thursday`, `Tuesday` and `Wednesday`.
     */
    @JvmName("bpmvkjwmvrubbimw")
    public suspend fun daysOfWeeks(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.daysOfWeeks = mapped
    }

    /**
     * @param value User visible input name of the Cost Management Scheduled Action.
     */
    @JvmName("vbarupxclyykwusg")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value Email address of the point of contact that should get the unsubscribe requests of Scheduled Action notification emails.
     */
    @JvmName("onhhlstmvuftlqth")
    public suspend fun emailAddressSender(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.emailAddressSender = mapped
    }

    /**
     * @param value Specifies a list of email addresses that will receive the Scheduled Action.
     */
    @JvmName("psxrblvgtetbpaaq")
    public suspend fun emailAddresses(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.emailAddresses = mapped
    }

    /**
     * @param values Specifies a list of email addresses that will receive the Scheduled Action.
     */
    @JvmName("rbkoirnwgtuxepdp")
    public suspend fun emailAddresses(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.emailAddresses = mapped
    }

    /**
     * @param value Subject of the email. Length is limited to 70 characters.
     */
    @JvmName("bqmgvkpgasoisuja")
    public suspend fun emailSubject(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.emailSubject = mapped
    }

    /**
     * @param value The end date and time of the Scheduled Action (UTC).
     */
    @JvmName("oebjugsvhgvnincb")
    public suspend fun endDate(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.endDate = mapped
    }

    /**
     * @param value Frequency of the schedule. Possible values are `Daily`, `Monthly` and `Weekly`. Value `Monthly` requires either `weeks_of_month` and `days_of_week` or `day_of_month` to be specified. Value `Weekly` requires `days_of_week` to be specified.
     */
    @JvmName("dosljlsajugvrcew")
    public suspend fun frequency(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.frequency = mapped
    }

    /**
     * @param value UTC time at which cost analysis data will be emailed. Must be between `0` and `23`.
     */
    @JvmName("xhpmvyvelaiervqu")
    public suspend fun hourOfDay(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hourOfDay = mapped
    }

    /**
     * @param value Message to be added in the email. Length is limited to 250 characters.
     */
    @JvmName("mwtrkqyefjrrhoay")
    public suspend fun message(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.message = mapped
    }

    /**
     * @param value The name which should be used for this Azure Cost Management Scheduled Action. Changing this forces a new Azure Cost Management Scheduled Action to be created.
     */
    @JvmName("axeygfwmwicrtuwc")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The start date and time of the Scheduled Action (UTC).
     */
    @JvmName("ldxexxfuvgatxhlc")
    public suspend fun startDate(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.startDate = mapped
    }

    /**
     * @param value The ID of the Cost Management View that is used by the Scheduled Action. Changing this forces a new resource to be created.
     */
    @JvmName("bttqymmfanjoyyjc")
    public suspend fun viewId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.viewId = mapped
    }

    /**
     * @param value Specifies a list of weeks in which cost analysis data will be emailed. This property is applicable when `frequency` is `Monthly` and used in combination with `days_of_week`. Possible values are `First`, `Fourth`, `Last`, `Second` and `Third`.
     */
    @JvmName("qwyqqmresvbxhbkw")
    public suspend fun weeksOfMonths(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.weeksOfMonths = mapped
    }

    /**
     * @param values Specifies a list of weeks in which cost analysis data will be emailed. This property is applicable when `frequency` is `Monthly` and used in combination with `days_of_week`. Possible values are `First`, `Fourth`, `Last`, `Second` and `Third`.
     */
    @JvmName("qxofvvesqhcjciax")
    public suspend fun weeksOfMonths(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.weeksOfMonths = mapped
    }

    internal fun build(): ScheduledActionArgs = ScheduledActionArgs(
        dayOfMonth = dayOfMonth,
        daysOfWeeks = daysOfWeeks,
        displayName = displayName,
        emailAddressSender = emailAddressSender,
        emailAddresses = emailAddresses,
        emailSubject = emailSubject,
        endDate = endDate,
        frequency = frequency,
        hourOfDay = hourOfDay,
        message = message,
        name = name,
        startDate = startDate,
        viewId = viewId,
        weeksOfMonths = weeksOfMonths,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy