# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = ['ScheduleArgs', 'Schedule']

@pulumi.input_type
class ScheduleArgs:
    def __init__(__self__, *,
                 lab_id: pulumi.Input[str],
                 stop_time: pulumi.Input[str],
                 time_zone: pulumi.Input[str],
                 name: Optional[pulumi.Input[str]] = None,
                 notes: Optional[pulumi.Input[str]] = None,
                 recurrence: Optional[pulumi.Input['ScheduleRecurrenceArgs']] = None,
                 start_time: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a Schedule resource.
        :param pulumi.Input[str] lab_id: The resource ID of the Lab Service Schedule. Changing this forces a new resource to be created.
        :param pulumi.Input[str] stop_time: When Lab User Virtual Machines will be stopped in RFC-3339 format.
        :param pulumi.Input[str] time_zone: The IANA Time Zone ID for the Schedule.
        :param pulumi.Input[str] name: The name which should be used for this Lab Service Schedule. Changing this forces a new resource to be created.
        :param pulumi.Input[str] notes: The notes for the Schedule.
        :param pulumi.Input['ScheduleRecurrenceArgs'] recurrence: A `recurrence` block as defined below.
        :param pulumi.Input[str] start_time: When Lab User Virtual Machines will be started in RFC-3339 format.
        """
        pulumi.set(__self__, "lab_id", lab_id)
        pulumi.set(__self__, "stop_time", stop_time)
        pulumi.set(__self__, "time_zone", time_zone)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if notes is not None:
            pulumi.set(__self__, "notes", notes)
        if recurrence is not None:
            pulumi.set(__self__, "recurrence", recurrence)
        if start_time is not None:
            pulumi.set(__self__, "start_time", start_time)

    @property
    @pulumi.getter(name="labId")
    def lab_id(self) -> pulumi.Input[str]:
        """
        The resource ID of the Lab Service Schedule. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "lab_id")

    @lab_id.setter
    def lab_id(self, value: pulumi.Input[str]):
        pulumi.set(self, "lab_id", value)

    @property
    @pulumi.getter(name="stopTime")
    def stop_time(self) -> pulumi.Input[str]:
        """
        When Lab User Virtual Machines will be stopped in RFC-3339 format.
        """
        return pulumi.get(self, "stop_time")

    @stop_time.setter
    def stop_time(self, value: pulumi.Input[str]):
        pulumi.set(self, "stop_time", value)

    @property
    @pulumi.getter(name="timeZone")
    def time_zone(self) -> pulumi.Input[str]:
        """
        The IANA Time Zone ID for the Schedule.
        """
        return pulumi.get(self, "time_zone")

    @time_zone.setter
    def time_zone(self, value: pulumi.Input[str]):
        pulumi.set(self, "time_zone", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        The name which should be used for this Lab Service Schedule. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter
    def notes(self) -> Optional[pulumi.Input[str]]:
        """
        The notes for the Schedule.
        """
        return pulumi.get(self, "notes")

    @notes.setter
    def notes(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "notes", value)

    @property
    @pulumi.getter
    def recurrence(self) -> Optional[pulumi.Input['ScheduleRecurrenceArgs']]:
        """
        A `recurrence` block as defined below.
        """
        return pulumi.get(self, "recurrence")

    @recurrence.setter
    def recurrence(self, value: Optional[pulumi.Input['ScheduleRecurrenceArgs']]):
        pulumi.set(self, "recurrence", value)

    @property
    @pulumi.getter(name="startTime")
    def start_time(self) -> Optional[pulumi.Input[str]]:
        """
        When Lab User Virtual Machines will be started in RFC-3339 format.
        """
        return pulumi.get(self, "start_time")

    @start_time.setter
    def start_time(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "start_time", value)


@pulumi.input_type
class _ScheduleState:
    def __init__(__self__, *,
                 lab_id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 notes: Optional[pulumi.Input[str]] = None,
                 recurrence: Optional[pulumi.Input['ScheduleRecurrenceArgs']] = None,
                 start_time: Optional[pulumi.Input[str]] = None,
                 stop_time: Optional[pulumi.Input[str]] = None,
                 time_zone: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering Schedule resources.
        :param pulumi.Input[str] lab_id: The resource ID of the Lab Service Schedule. Changing this forces a new resource to be created.
        :param pulumi.Input[str] name: The name which should be used for this Lab Service Schedule. Changing this forces a new resource to be created.
        :param pulumi.Input[str] notes: The notes for the Schedule.
        :param pulumi.Input['ScheduleRecurrenceArgs'] recurrence: A `recurrence` block as defined below.
        :param pulumi.Input[str] start_time: When Lab User Virtual Machines will be started in RFC-3339 format.
        :param pulumi.Input[str] stop_time: When Lab User Virtual Machines will be stopped in RFC-3339 format.
        :param pulumi.Input[str] time_zone: The IANA Time Zone ID for the Schedule.
        """
        if lab_id is not None:
            pulumi.set(__self__, "lab_id", lab_id)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if notes is not None:
            pulumi.set(__self__, "notes", notes)
        if recurrence is not None:
            pulumi.set(__self__, "recurrence", recurrence)
        if start_time is not None:
            pulumi.set(__self__, "start_time", start_time)
        if stop_time is not None:
            pulumi.set(__self__, "stop_time", stop_time)
        if time_zone is not None:
            pulumi.set(__self__, "time_zone", time_zone)

    @property
    @pulumi.getter(name="labId")
    def lab_id(self) -> Optional[pulumi.Input[str]]:
        """
        The resource ID of the Lab Service Schedule. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "lab_id")

    @lab_id.setter
    def lab_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "lab_id", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        The name which should be used for this Lab Service Schedule. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter
    def notes(self) -> Optional[pulumi.Input[str]]:
        """
        The notes for the Schedule.
        """
        return pulumi.get(self, "notes")

    @notes.setter
    def notes(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "notes", value)

    @property
    @pulumi.getter
    def recurrence(self) -> Optional[pulumi.Input['ScheduleRecurrenceArgs']]:
        """
        A `recurrence` block as defined below.
        """
        return pulumi.get(self, "recurrence")

    @recurrence.setter
    def recurrence(self, value: Optional[pulumi.Input['ScheduleRecurrenceArgs']]):
        pulumi.set(self, "recurrence", value)

    @property
    @pulumi.getter(name="startTime")
    def start_time(self) -> Optional[pulumi.Input[str]]:
        """
        When Lab User Virtual Machines will be started in RFC-3339 format.
        """
        return pulumi.get(self, "start_time")

    @start_time.setter
    def start_time(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "start_time", value)

    @property
    @pulumi.getter(name="stopTime")
    def stop_time(self) -> Optional[pulumi.Input[str]]:
        """
        When Lab User Virtual Machines will be stopped in RFC-3339 format.
        """
        return pulumi.get(self, "stop_time")

    @stop_time.setter
    def stop_time(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "stop_time", value)

    @property
    @pulumi.getter(name="timeZone")
    def time_zone(self) -> Optional[pulumi.Input[str]]:
        """
        The IANA Time Zone ID for the Schedule.
        """
        return pulumi.get(self, "time_zone")

    @time_zone.setter
    def time_zone(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "time_zone", value)


class Schedule(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 lab_id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 notes: Optional[pulumi.Input[str]] = None,
                 recurrence: Optional[pulumi.Input[pulumi.InputType['ScheduleRecurrenceArgs']]] = None,
                 start_time: Optional[pulumi.Input[str]] = None,
                 stop_time: Optional[pulumi.Input[str]] = None,
                 time_zone: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Manages a Lab Service Schedule.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
        example_lab = azure.lab.Lab("exampleLab",
            resource_group_name=example_resource_group.name,
            location=example_resource_group.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(
                    offer="0001-com-ubuntu-server-focal",
                    publisher="canonical",
                    sku="20_04-lts",
                    version="latest",
                ),
                sku=azure.lab.LabVirtualMachineSkuArgs(
                    name="Classic_Fsv2_2_4GB_128_S_SSD",
                    capacity=1,
                ),
            ))
        example_schedule = azure.lab.Schedule("exampleSchedule",
            lab_id=example_lab.id,
            stop_time="2022-11-28T00:00:00Z",
            time_zone="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
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] lab_id: The resource ID of the Lab Service Schedule. Changing this forces a new resource to be created.
        :param pulumi.Input[str] name: The name which should be used for this Lab Service Schedule. Changing this forces a new resource to be created.
        :param pulumi.Input[str] notes: The notes for the Schedule.
        :param pulumi.Input[pulumi.InputType['ScheduleRecurrenceArgs']] recurrence: A `recurrence` block as defined below.
        :param pulumi.Input[str] start_time: When Lab User Virtual Machines will be started in RFC-3339 format.
        :param pulumi.Input[str] stop_time: When Lab User Virtual Machines will be stopped in RFC-3339 format.
        :param pulumi.Input[str] time_zone: The IANA Time Zone ID for the Schedule.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ScheduleArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages a Lab Service Schedule.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
        example_lab = azure.lab.Lab("exampleLab",
            resource_group_name=example_resource_group.name,
            location=example_resource_group.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(
                    offer="0001-com-ubuntu-server-focal",
                    publisher="canonical",
                    sku="20_04-lts",
                    version="latest",
                ),
                sku=azure.lab.LabVirtualMachineSkuArgs(
                    name="Classic_Fsv2_2_4GB_128_S_SSD",
                    capacity=1,
                ),
            ))
        example_schedule = azure.lab.Schedule("exampleSchedule",
            lab_id=example_lab.id,
            stop_time="2022-11-28T00:00:00Z",
            time_zone="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
        ```

        :param str resource_name: The name of the resource.
        :param ScheduleArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(ScheduleArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 lab_id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 notes: Optional[pulumi.Input[str]] = None,
                 recurrence: Optional[pulumi.Input[pulumi.InputType['ScheduleRecurrenceArgs']]] = None,
                 start_time: Optional[pulumi.Input[str]] = None,
                 stop_time: Optional[pulumi.Input[str]] = None,
                 time_zone: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = ScheduleArgs.__new__(ScheduleArgs)

            if lab_id is None and not opts.urn:
                raise TypeError("Missing required property 'lab_id'")
            __props__.__dict__["lab_id"] = lab_id
            __props__.__dict__["name"] = name
            __props__.__dict__["notes"] = notes
            __props__.__dict__["recurrence"] = recurrence
            __props__.__dict__["start_time"] = start_time
            if stop_time is None and not opts.urn:
                raise TypeError("Missing required property 'stop_time'")
            __props__.__dict__["stop_time"] = stop_time
            if time_zone is None and not opts.urn:
                raise TypeError("Missing required property 'time_zone'")
            __props__.__dict__["time_zone"] = time_zone
        super(Schedule, __self__).__init__(
            'azure:lab/schedule:Schedule',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            lab_id: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None,
            notes: Optional[pulumi.Input[str]] = None,
            recurrence: Optional[pulumi.Input[pulumi.InputType['ScheduleRecurrenceArgs']]] = None,
            start_time: Optional[pulumi.Input[str]] = None,
            stop_time: Optional[pulumi.Input[str]] = None,
            time_zone: Optional[pulumi.Input[str]] = None) -> 'Schedule':
        """
        Get an existing Schedule resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] lab_id: The resource ID of the Lab Service Schedule. Changing this forces a new resource to be created.
        :param pulumi.Input[str] name: The name which should be used for this Lab Service Schedule. Changing this forces a new resource to be created.
        :param pulumi.Input[str] notes: The notes for the Schedule.
        :param pulumi.Input[pulumi.InputType['ScheduleRecurrenceArgs']] recurrence: A `recurrence` block as defined below.
        :param pulumi.Input[str] start_time: When Lab User Virtual Machines will be started in RFC-3339 format.
        :param pulumi.Input[str] stop_time: When Lab User Virtual Machines will be stopped in RFC-3339 format.
        :param pulumi.Input[str] time_zone: The IANA Time Zone ID for the Schedule.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ScheduleState.__new__(_ScheduleState)

        __props__.__dict__["lab_id"] = lab_id
        __props__.__dict__["name"] = name
        __props__.__dict__["notes"] = notes
        __props__.__dict__["recurrence"] = recurrence
        __props__.__dict__["start_time"] = start_time
        __props__.__dict__["stop_time"] = stop_time
        __props__.__dict__["time_zone"] = time_zone
        return Schedule(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="labId")
    def lab_id(self) -> pulumi.Output[str]:
        """
        The resource ID of the Lab Service Schedule. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "lab_id")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        The name which should be used for this Lab Service Schedule. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def notes(self) -> pulumi.Output[Optional[str]]:
        """
        The notes for the Schedule.
        """
        return pulumi.get(self, "notes")

    @property
    @pulumi.getter
    def recurrence(self) -> pulumi.Output[Optional['outputs.ScheduleRecurrence']]:
        """
        A `recurrence` block as defined below.
        """
        return pulumi.get(self, "recurrence")

    @property
    @pulumi.getter(name="startTime")
    def start_time(self) -> pulumi.Output[Optional[str]]:
        """
        When Lab User Virtual Machines will be started in RFC-3339 format.
        """
        return pulumi.get(self, "start_time")

    @property
    @pulumi.getter(name="stopTime")
    def stop_time(self) -> pulumi.Output[str]:
        """
        When Lab User Virtual Machines will be stopped in RFC-3339 format.
        """
        return pulumi.get(self, "stop_time")

    @property
    @pulumi.getter(name="timeZone")
    def time_zone(self) -> pulumi.Output[str]:
        """
        The IANA Time Zone ID for the Schedule.
        """
        return pulumi.get(self, "time_zone")

