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

com.pulumi.azure.lab.kotlin.ScheduleArgs.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: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.lab.kotlin

import com.pulumi.azure.lab.ScheduleArgs.builder
import com.pulumi.azure.lab.kotlin.inputs.ScheduleRecurrenceArgs
import com.pulumi.azure.lab.kotlin.inputs.ScheduleRecurrenceArgsBuilder
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.jvm.JvmName

/**
 * Manages a Lab Service Schedule.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleLab = new azure.lab.Lab("example", {
 *     name: "example-lab",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     title: "Test Title",
 *     security: {
 *         openAccessEnabled: false,
 *     },
 *     virtualMachine: {
 *         adminUser: {
 *             username: "testadmin",
 *             password: "Password1234!",
 *         },
 *         imageReference: {
 *             publisher: "Canonical",
 *             offer: "0001-com-ubuntu-server-jammy",
 *             sku: "22_04-lts",
 *             version: "latest",
 *         },
 *         sku: {
 *             name: "Classic_Fsv2_2_4GB_128_S_SSD",
 *             capacity: 1,
 *         },
 *     },
 * });
 * const exampleSchedule = new azure.lab.Schedule("example", {
 *     name: "example-labschedule",
 *     labId: exampleLab.id,
 *     stopTime: "2022-11-28T00:00:00Z",
 *     timeZone: "America/Los_Angeles",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_lab = azure.lab.Lab("example",
 *     name="example-lab",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     title="Test Title",
 *     security=azure.lab.LabSecurityArgs(
 *         open_access_enabled=False,
 *     ),
 *     virtual_machine=azure.lab.LabVirtualMachineArgs(
 *         admin_user=azure.lab.LabVirtualMachineAdminUserArgs(
 *             username="testadmin",
 *             password="Password1234!",
 *         ),
 *         image_reference=azure.lab.LabVirtualMachineImageReferenceArgs(
 *             publisher="Canonical",
 *             offer="0001-com-ubuntu-server-jammy",
 *             sku="22_04-lts",
 *             version="latest",
 *         ),
 *         sku=azure.lab.LabVirtualMachineSkuArgs(
 *             name="Classic_Fsv2_2_4GB_128_S_SSD",
 *             capacity=1,
 *         ),
 *     ))
 * example_schedule = azure.lab.Schedule("example",
 *     name="example-labschedule",
 *     lab_id=example_lab.id,
 *     stop_time="2022-11-28T00:00:00Z",
 *     time_zone="America/Los_Angeles")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleLab = new Azure.Lab.Lab("example", new()
 *     {
 *         Name = "example-lab",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Title = "Test Title",
 *         Security = new Azure.Lab.Inputs.LabSecurityArgs
 *         {
 *             OpenAccessEnabled = false,
 *         },
 *         VirtualMachine = new Azure.Lab.Inputs.LabVirtualMachineArgs
 *         {
 *             AdminUser = new Azure.Lab.Inputs.LabVirtualMachineAdminUserArgs
 *             {
 *                 Username = "testadmin",
 *                 Password = "Password1234!",
 *             },
 *             ImageReference = new Azure.Lab.Inputs.LabVirtualMachineImageReferenceArgs
 *             {
 *                 Publisher = "Canonical",
 *                 Offer = "0001-com-ubuntu-server-jammy",
 *                 Sku = "22_04-lts",
 *                 Version = "latest",
 *             },
 *             Sku = new Azure.Lab.Inputs.LabVirtualMachineSkuArgs
 *             {
 *                 Name = "Classic_Fsv2_2_4GB_128_S_SSD",
 *                 Capacity = 1,
 *             },
 *         },
 *     });
 *     var exampleSchedule = new Azure.Lab.Schedule("example", new()
 *     {
 *         Name = "example-labschedule",
 *         LabId = exampleLab.Id,
 *         StopTime = "2022-11-28T00:00:00Z",
 *         TimeZone = "America/Los_Angeles",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lab"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleLab, err := lab.NewLab(ctx, "example", &lab.LabArgs{
 * 			Name:              pulumi.String("example-lab"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			Title:             pulumi.String("Test Title"),
 * 			Security: &lab.LabSecurityArgs{
 * 				OpenAccessEnabled: pulumi.Bool(false),
 * 			},
 * 			VirtualMachine: &lab.LabVirtualMachineArgs{
 * 				AdminUser: &lab.LabVirtualMachineAdminUserArgs{
 * 					Username: pulumi.String("testadmin"),
 * 					Password: pulumi.String("Password1234!"),
 * 				},
 * 				ImageReference: &lab.LabVirtualMachineImageReferenceArgs{
 * 					Publisher: pulumi.String("Canonical"),
 * 					Offer:     pulumi.String("0001-com-ubuntu-server-jammy"),
 * 					Sku:       pulumi.String("22_04-lts"),
 * 					Version:   pulumi.String("latest"),
 * 				},
 * 				Sku: &lab.LabVirtualMachineSkuArgs{
 * 					Name:     pulumi.String("Classic_Fsv2_2_4GB_128_S_SSD"),
 * 					Capacity: pulumi.Int(1),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = lab.NewSchedule(ctx, "example", &lab.ScheduleArgs{
 * 			Name:     pulumi.String("example-labschedule"),
 * 			LabId:    exampleLab.ID(),
 * 			StopTime: pulumi.String("2022-11-28T00:00:00Z"),
 * 			TimeZone: pulumi.String("America/Los_Angeles"),
 * 		})
 * 		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.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.lab.Lab;
 * import com.pulumi.azure.lab.LabArgs;
 * import com.pulumi.azure.lab.inputs.LabSecurityArgs;
 * import com.pulumi.azure.lab.inputs.LabVirtualMachineArgs;
 * import com.pulumi.azure.lab.inputs.LabVirtualMachineAdminUserArgs;
 * import com.pulumi.azure.lab.inputs.LabVirtualMachineImageReferenceArgs;
 * import com.pulumi.azure.lab.inputs.LabVirtualMachineSkuArgs;
 * import com.pulumi.azure.lab.Schedule;
 * import com.pulumi.azure.lab.ScheduleArgs;
 * 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 ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleLab = new Lab("exampleLab", LabArgs.builder()
 *             .name("example-lab")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .title("Test Title")
 *             .security(LabSecurityArgs.builder()
 *                 .openAccessEnabled(false)
 *                 .build())
 *             .virtualMachine(LabVirtualMachineArgs.builder()
 *                 .adminUser(LabVirtualMachineAdminUserArgs.builder()
 *                     .username("testadmin")
 *                     .password("Password1234!")
 *                     .build())
 *                 .imageReference(LabVirtualMachineImageReferenceArgs.builder()
 *                     .publisher("Canonical")
 *                     .offer("0001-com-ubuntu-server-jammy")
 *                     .sku("22_04-lts")
 *                     .version("latest")
 *                     .build())
 *                 .sku(LabVirtualMachineSkuArgs.builder()
 *                     .name("Classic_Fsv2_2_4GB_128_S_SSD")
 *                     .capacity(1)
 *                     .build())
 *                 .build())
 *             .build());
 *         var exampleSchedule = new Schedule("exampleSchedule", ScheduleArgs.builder()
 *             .name("example-labschedule")
 *             .labId(exampleLab.id())
 *             .stopTime("2022-11-28T00:00:00Z")
 *             .timeZone("America/Los_Angeles")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleLab:
 *     type: azure:lab:Lab
 *     name: example
 *     properties:
 *       name: example-lab
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       title: Test Title
 *       security:
 *         openAccessEnabled: false
 *       virtualMachine:
 *         adminUser:
 *           username: testadmin
 *           password: Password1234!
 *         imageReference:
 *           publisher: Canonical
 *           offer: 0001-com-ubuntu-server-jammy
 *           sku: 22_04-lts
 *           version: latest
 *         sku:
 *           name: Classic_Fsv2_2_4GB_128_S_SSD
 *           capacity: 1
 *   exampleSchedule:
 *     type: azure:lab:Schedule
 *     name: example
 *     properties:
 *       name: example-labschedule
 *       labId: ${exampleLab.id}
 *       stopTime: 2022-11-28T00:00:00Z
 *       timeZone: America/Los_Angeles
 * ```
 * 
 * ## Import
 * Lab Service Schedules can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:lab/schedule:Schedule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.LabServices/labs/lab1/schedules/schedule1
 * ```
 * @property labId The resource ID of the Lab Service Schedule. Changing this forces a new resource to be created.
 * @property name The name which should be used for this Lab Service Schedule. Changing this forces a new resource to be created.
 * @property notes The notes for the Schedule.
 * @property recurrence A `recurrence` block as defined below.
 * @property startTime When Lab User Virtual Machines will be started in RFC-3339 format.
 * @property stopTime When Lab User Virtual Machines will be stopped in RFC-3339 format.
 * @property timeZone The IANA Time Zone ID for the Schedule.
 */
public data class ScheduleArgs(
    public val labId: Output? = null,
    public val name: Output? = null,
    public val notes: Output? = null,
    public val recurrence: Output? = null,
    public val startTime: Output? = null,
    public val stopTime: Output? = null,
    public val timeZone: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.lab.ScheduleArgs =
        com.pulumi.azure.lab.ScheduleArgs.builder()
            .labId(labId?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .notes(notes?.applyValue({ args0 -> args0 }))
            .recurrence(recurrence?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .startTime(startTime?.applyValue({ args0 -> args0 }))
            .stopTime(stopTime?.applyValue({ args0 -> args0 }))
            .timeZone(timeZone?.applyValue({ args0 -> args0 })).build()
}

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

    private var name: Output? = null

    private var notes: Output? = null

    private var recurrence: Output? = null

    private var startTime: Output? = null

    private var stopTime: Output? = null

    private var timeZone: Output? = null

    /**
     * @param value The resource ID of the Lab Service Schedule. Changing this forces a new resource to be created.
     */
    @JvmName("kpyxwsedeclgqjvh")
    public suspend fun labId(`value`: Output) {
        this.labId = value
    }

    /**
     * @param value The name which should be used for this Lab Service Schedule. Changing this forces a new resource to be created.
     */
    @JvmName("inlsymjiowlyoxcw")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The notes for the Schedule.
     */
    @JvmName("bmiphgnneugjdiao")
    public suspend fun notes(`value`: Output) {
        this.notes = value
    }

    /**
     * @param value A `recurrence` block as defined below.
     */
    @JvmName("dcosgtomprrirqfk")
    public suspend fun recurrence(`value`: Output) {
        this.recurrence = value
    }

    /**
     * @param value When Lab User Virtual Machines will be started in RFC-3339 format.
     */
    @JvmName("cqthougfupuxmkeu")
    public suspend fun startTime(`value`: Output) {
        this.startTime = value
    }

    /**
     * @param value When Lab User Virtual Machines will be stopped in RFC-3339 format.
     */
    @JvmName("kbkrexavqbhqcqeo")
    public suspend fun stopTime(`value`: Output) {
        this.stopTime = value
    }

    /**
     * @param value The IANA Time Zone ID for the Schedule.
     */
    @JvmName("xsmtuhrawqfhlawd")
    public suspend fun timeZone(`value`: Output) {
        this.timeZone = value
    }

    /**
     * @param value The resource ID of the Lab Service Schedule. Changing this forces a new resource to be created.
     */
    @JvmName("ypltfbcsrwjrdgso")
    public suspend fun labId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labId = mapped
    }

    /**
     * @param value The name which should be used for this Lab Service Schedule. Changing this forces a new resource to be created.
     */
    @JvmName("qawlfdotdifrjowy")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

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

    /**
     * @param value A `recurrence` block as defined below.
     */
    @JvmName("irextgpuxtjfibmq")
    public suspend fun recurrence(`value`: ScheduleRecurrenceArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.recurrence = mapped
    }

    /**
     * @param argument A `recurrence` block as defined below.
     */
    @JvmName("vulorxetoardcjih")
    public suspend fun recurrence(argument: suspend ScheduleRecurrenceArgsBuilder.() -> Unit) {
        val toBeMapped = ScheduleRecurrenceArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.recurrence = mapped
    }

    /**
     * @param value When Lab User Virtual Machines will be started in RFC-3339 format.
     */
    @JvmName("mpvgloqgebpydgld")
    public suspend fun startTime(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.startTime = mapped
    }

    /**
     * @param value When Lab User Virtual Machines will be stopped in RFC-3339 format.
     */
    @JvmName("iuekcqymfsqgewom")
    public suspend fun stopTime(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.stopTime = mapped
    }

    /**
     * @param value The IANA Time Zone ID for the Schedule.
     */
    @JvmName("veqbfbcjgejsiwca")
    public suspend fun timeZone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeZone = mapped
    }

    internal fun build(): ScheduleArgs = ScheduleArgs(
        labId = labId,
        name = name,
        notes = notes,
        recurrence = recurrence,
        startTime = startTime,
        stopTime = stopTime,
        timeZone = timeZone,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy