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

com.pulumi.azurenative.devtestlab.kotlin.ScheduleArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.devtestlab.kotlin

import com.pulumi.azurenative.devtestlab.ScheduleArgs.builder
import com.pulumi.azurenative.devtestlab.kotlin.enums.EnableStatus
import com.pulumi.azurenative.devtestlab.kotlin.inputs.DayDetailsArgs
import com.pulumi.azurenative.devtestlab.kotlin.inputs.DayDetailsArgsBuilder
import com.pulumi.azurenative.devtestlab.kotlin.inputs.HourDetailsArgs
import com.pulumi.azurenative.devtestlab.kotlin.inputs.HourDetailsArgsBuilder
import com.pulumi.azurenative.devtestlab.kotlin.inputs.NotificationSettingsArgs
import com.pulumi.azurenative.devtestlab.kotlin.inputs.NotificationSettingsArgsBuilder
import com.pulumi.azurenative.devtestlab.kotlin.inputs.WeekDetailsArgs
import com.pulumi.azurenative.devtestlab.kotlin.inputs.WeekDetailsArgsBuilder
import com.pulumi.core.Either
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * A schedule.
 * Azure REST API version: 2018-09-15. Prior API version in Azure Native 1.x: 2018-09-15.
 * Other available API versions: 2016-05-15.
 * ## Example Usage
 * ### Schedules_CreateOrUpdate
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var schedule = new AzureNative.DevTestLab.Schedule("schedule", new()
 *     {
 *         DailyRecurrence = new AzureNative.DevTestLab.Inputs.DayDetailsArgs
 *         {
 *             Time = "{timeOfTheDayTheScheduleWillOccurEveryDay}",
 *         },
 *         HourlyRecurrence = new AzureNative.DevTestLab.Inputs.HourDetailsArgs
 *         {
 *             Minute = 30,
 *         },
 *         LabName = "{labName}",
 *         Location = "{location}",
 *         Name = "{scheduleName}",
 *         NotificationSettings = new AzureNative.DevTestLab.Inputs.NotificationSettingsArgs
 *         {
 *             EmailRecipient = "{email}",
 *             NotificationLocale = "EN",
 *             Status = "{Enabled|Disabled}",
 *             TimeInMinutes = 15,
 *             WebhookUrl = "{webhookUrl}",
 *         },
 *         ResourceGroupName = "resourceGroupName",
 *         Status = "{Enabled|Disabled}",
 *         Tags =
 *         {
 *             { "tagName1", "tagValue1" },
 *         },
 *         TargetResourceId = "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}",
 *         TaskType = "{myLabVmTaskType}",
 *         TimeZoneId = "Pacific Standard Time",
 *         WeeklyRecurrence = new AzureNative.DevTestLab.Inputs.WeekDetailsArgs
 *         {
 *             Time = "{timeOfTheDayTheScheduleWillOccurOnThoseDays}",
 *             Weekdays = new[]
 *             {
 *                 "Monday",
 *                 "Wednesday",
 *                 "Friday",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	devtestlab "github.com/pulumi/pulumi-azure-native-sdk/devtestlab/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := devtestlab.NewSchedule(ctx, "schedule", &devtestlab.ScheduleArgs{
 * 			DailyRecurrence: &devtestlab.DayDetailsArgs{
 * 				Time: pulumi.String("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
 * 			},
 * 			HourlyRecurrence: &devtestlab.HourDetailsArgs{
 * 				Minute: pulumi.Int(30),
 * 			},
 * 			LabName:  pulumi.String("{labName}"),
 * 			Location: pulumi.String("{location}"),
 * 			Name:     pulumi.String("{scheduleName}"),
 * 			NotificationSettings: &devtestlab.NotificationSettingsArgs{
 * 				EmailRecipient:     pulumi.String("{email}"),
 * 				NotificationLocale: pulumi.String("EN"),
 * 				Status:             pulumi.String("{Enabled|Disabled}"),
 * 				TimeInMinutes:      pulumi.Int(15),
 * 				WebhookUrl:         pulumi.String("{webhookUrl}"),
 * 			},
 * 			ResourceGroupName: pulumi.String("resourceGroupName"),
 * 			Status:            pulumi.String("{Enabled|Disabled}"),
 * 			Tags: pulumi.StringMap{
 * 				"tagName1": pulumi.String("tagValue1"),
 * 			},
 * 			TargetResourceId: pulumi.String("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
 * 			TaskType:         pulumi.String("{myLabVmTaskType}"),
 * 			TimeZoneId:       pulumi.String("Pacific Standard Time"),
 * 			WeeklyRecurrence: &devtestlab.WeekDetailsArgs{
 * 				Time: pulumi.String("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
 * 				Weekdays: pulumi.StringArray{
 * 					pulumi.String("Monday"),
 * 					pulumi.String("Wednesday"),
 * 					pulumi.String("Friday"),
 * 				},
 * 			},
 * 		})
 * 		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.azurenative.devtestlab.Schedule;
 * import com.pulumi.azurenative.devtestlab.ScheduleArgs;
 * import com.pulumi.azurenative.devtestlab.inputs.DayDetailsArgs;
 * import com.pulumi.azurenative.devtestlab.inputs.HourDetailsArgs;
 * import com.pulumi.azurenative.devtestlab.inputs.NotificationSettingsArgs;
 * import com.pulumi.azurenative.devtestlab.inputs.WeekDetailsArgs;
 * 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 schedule = new Schedule("schedule", ScheduleArgs.builder()
 *             .dailyRecurrence(DayDetailsArgs.builder()
 *                 .time("{timeOfTheDayTheScheduleWillOccurEveryDay}")
 *                 .build())
 *             .hourlyRecurrence(HourDetailsArgs.builder()
 *                 .minute(30)
 *                 .build())
 *             .labName("{labName}")
 *             .location("{location}")
 *             .name("{scheduleName}")
 *             .notificationSettings(NotificationSettingsArgs.builder()
 *                 .emailRecipient("{email}")
 *                 .notificationLocale("EN")
 *                 .status("{Enabled|Disabled}")
 *                 .timeInMinutes(15)
 *                 .webhookUrl("{webhookUrl}")
 *                 .build())
 *             .resourceGroupName("resourceGroupName")
 *             .status("{Enabled|Disabled}")
 *             .tags(Map.of("tagName1", "tagValue1"))
 *             .targetResourceId("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}")
 *             .taskType("{myLabVmTaskType}")
 *             .timeZoneId("Pacific Standard Time")
 *             .weeklyRecurrence(WeekDetailsArgs.builder()
 *                 .time("{timeOfTheDayTheScheduleWillOccurOnThoseDays}")
 *                 .weekdays(
 *                     "Monday",
 *                     "Wednesday",
 *                     "Friday")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:devtestlab:Schedule {scheduleName} /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}
 * ```
 * @property dailyRecurrence If the schedule will occur once each day of the week, specify the daily recurrence.
 * @property hourlyRecurrence If the schedule will occur multiple times a day, specify the hourly recurrence.
 * @property labName The name of the lab.
 * @property location The location of the resource.
 * @property name The name of the schedule.
 * @property notificationSettings Notification settings.
 * @property resourceGroupName The name of the resource group.
 * @property status The status of the schedule (i.e. Enabled, Disabled)
 * @property tags The tags of the resource.
 * @property targetResourceId The resource ID to which the schedule belongs
 * @property taskType The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart).
 * @property timeZoneId The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in `IReadOnlyCollection TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds` (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md)
 * @property weeklyRecurrence If the schedule will occur only some days of the week, specify the weekly recurrence.
 */
public data class ScheduleArgs(
    public val dailyRecurrence: Output? = null,
    public val hourlyRecurrence: Output? = null,
    public val labName: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val notificationSettings: Output? = null,
    public val resourceGroupName: Output? = null,
    public val status: Output>? = null,
    public val tags: Output>? = null,
    public val targetResourceId: Output? = null,
    public val taskType: Output? = null,
    public val timeZoneId: Output? = null,
    public val weeklyRecurrence: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.devtestlab.ScheduleArgs =
        com.pulumi.azurenative.devtestlab.ScheduleArgs.builder()
            .dailyRecurrence(dailyRecurrence?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .hourlyRecurrence(hourlyRecurrence?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .labName(labName?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .notificationSettings(
                notificationSettings?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .status(
                status?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .targetResourceId(targetResourceId?.applyValue({ args0 -> args0 }))
            .taskType(taskType?.applyValue({ args0 -> args0 }))
            .timeZoneId(timeZoneId?.applyValue({ args0 -> args0 }))
            .weeklyRecurrence(
                weeklyRecurrence?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [ScheduleArgs].
 */
@PulumiTagMarker
public class ScheduleArgsBuilder internal constructor() {
    private var dailyRecurrence: Output? = null

    private var hourlyRecurrence: Output? = null

    private var labName: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var notificationSettings: Output? = null

    private var resourceGroupName: Output? = null

    private var status: Output>? = null

    private var tags: Output>? = null

    private var targetResourceId: Output? = null

    private var taskType: Output? = null

    private var timeZoneId: Output? = null

    private var weeklyRecurrence: Output? = null

    /**
     * @param value If the schedule will occur once each day of the week, specify the daily recurrence.
     */
    @JvmName("gbygqxvghtxmfdch")
    public suspend fun dailyRecurrence(`value`: Output) {
        this.dailyRecurrence = value
    }

    /**
     * @param value If the schedule will occur multiple times a day, specify the hourly recurrence.
     */
    @JvmName("puwtugrsbampkcot")
    public suspend fun hourlyRecurrence(`value`: Output) {
        this.hourlyRecurrence = value
    }

    /**
     * @param value The name of the lab.
     */
    @JvmName("xhxfgylxythscbpk")
    public suspend fun labName(`value`: Output) {
        this.labName = value
    }

    /**
     * @param value The location of the resource.
     */
    @JvmName("vfyybpcisqsgwvtf")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The name of the schedule.
     */
    @JvmName("ogyfpvguktvnytog")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Notification settings.
     */
    @JvmName("lgjqelefbjqyexae")
    public suspend fun notificationSettings(`value`: Output) {
        this.notificationSettings = value
    }

    /**
     * @param value The name of the resource group.
     */
    @JvmName("gehwgnlqsklpylyv")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The status of the schedule (i.e. Enabled, Disabled)
     */
    @JvmName("wbdvmqqttgoduddx")
    public suspend fun status(`value`: Output>) {
        this.status = value
    }

    /**
     * @param value The tags of the resource.
     */
    @JvmName("wglnlvyootwptaow")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The resource ID to which the schedule belongs
     */
    @JvmName("kjdhimaibqnvmxhv")
    public suspend fun targetResourceId(`value`: Output) {
        this.targetResourceId = value
    }

    /**
     * @param value The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart).
     */
    @JvmName("emagbhapnvkxttod")
    public suspend fun taskType(`value`: Output) {
        this.taskType = value
    }

    /**
     * @param value The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in `IReadOnlyCollection TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds` (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md)
     */
    @JvmName("opqlqwwwcmpjojxj")
    public suspend fun timeZoneId(`value`: Output) {
        this.timeZoneId = value
    }

    /**
     * @param value If the schedule will occur only some days of the week, specify the weekly recurrence.
     */
    @JvmName("wsuhdycfqtducjqx")
    public suspend fun weeklyRecurrence(`value`: Output) {
        this.weeklyRecurrence = value
    }

    /**
     * @param value If the schedule will occur once each day of the week, specify the daily recurrence.
     */
    @JvmName("prqhodboguylpvnt")
    public suspend fun dailyRecurrence(`value`: DayDetailsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dailyRecurrence = mapped
    }

    /**
     * @param argument If the schedule will occur once each day of the week, specify the daily recurrence.
     */
    @JvmName("qgbpophwwlatuedr")
    public suspend fun dailyRecurrence(argument: suspend DayDetailsArgsBuilder.() -> Unit) {
        val toBeMapped = DayDetailsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.dailyRecurrence = mapped
    }

    /**
     * @param value If the schedule will occur multiple times a day, specify the hourly recurrence.
     */
    @JvmName("flklahtdgmooiuqm")
    public suspend fun hourlyRecurrence(`value`: HourDetailsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hourlyRecurrence = mapped
    }

    /**
     * @param argument If the schedule will occur multiple times a day, specify the hourly recurrence.
     */
    @JvmName("oxgptarcichqipyf")
    public suspend fun hourlyRecurrence(argument: suspend HourDetailsArgsBuilder.() -> Unit) {
        val toBeMapped = HourDetailsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.hourlyRecurrence = mapped
    }

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

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

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

    /**
     * @param value Notification settings.
     */
    @JvmName("qmdyuoeonxdcphrh")
    public suspend fun notificationSettings(`value`: NotificationSettingsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.notificationSettings = mapped
    }

    /**
     * @param argument Notification settings.
     */
    @JvmName("vktecoiloekrvacq")
    public suspend fun notificationSettings(argument: suspend NotificationSettingsArgsBuilder.() -> Unit) {
        val toBeMapped = NotificationSettingsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.notificationSettings = mapped
    }

    /**
     * @param value The name of the resource group.
     */
    @JvmName("kxbvjwxdypksoxoq")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The status of the schedule (i.e. Enabled, Disabled)
     */
    @JvmName("ssbfftrucpqwtpge")
    public suspend fun status(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.status = mapped
    }

    /**
     * @param value The status of the schedule (i.e. Enabled, Disabled)
     */
    @JvmName("neyomppkrdpqytvg")
    public fun status(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.status = mapped
    }

    /**
     * @param value The status of the schedule (i.e. Enabled, Disabled)
     */
    @JvmName("fxtwvioltidgujvy")
    public fun status(`value`: EnableStatus) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.status = mapped
    }

    /**
     * @param value The tags of the resource.
     */
    @JvmName("rodbbicgqaqnhyfx")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values The tags of the resource.
     */
    @JvmName("fbikdowsmdexeybi")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The resource ID to which the schedule belongs
     */
    @JvmName("irqulbencjlnpmyk")
    public suspend fun targetResourceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetResourceId = mapped
    }

    /**
     * @param value The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart).
     */
    @JvmName("aybedbrsdngpmiun")
    public suspend fun taskType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.taskType = mapped
    }

    /**
     * @param value The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in `IReadOnlyCollection TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds` (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md)
     */
    @JvmName("yyfkglrhqefrlghr")
    public suspend fun timeZoneId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeZoneId = mapped
    }

    /**
     * @param value If the schedule will occur only some days of the week, specify the weekly recurrence.
     */
    @JvmName("ykvdoapvxtdjkbgi")
    public suspend fun weeklyRecurrence(`value`: WeekDetailsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.weeklyRecurrence = mapped
    }

    /**
     * @param argument If the schedule will occur only some days of the week, specify the weekly recurrence.
     */
    @JvmName("boaojggtvlgefrpx")
    public suspend fun weeklyRecurrence(argument: suspend WeekDetailsArgsBuilder.() -> Unit) {
        val toBeMapped = WeekDetailsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.weeklyRecurrence = mapped
    }

    internal fun build(): ScheduleArgs = ScheduleArgs(
        dailyRecurrence = dailyRecurrence,
        hourlyRecurrence = hourlyRecurrence,
        labName = labName,
        location = location,
        name = name,
        notificationSettings = notificationSettings,
        resourceGroupName = resourceGroupName,
        status = status,
        tags = tags,
        targetResourceId = targetResourceId,
        taskType = taskType,
        timeZoneId = timeZoneId,
        weeklyRecurrence = weeklyRecurrence,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy