"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GlobalVMShutdownSchedule = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages automated shutdown schedules for Azure VMs that are not within an Azure DevTest Lab. While this is part of the DevTest Labs service in Azure,
 * this resource applies only to standard VMs, not DevTest Lab VMs. To manage automated shutdown schedules for DevTest Lab VMs, reference the
 * `azure.devtest.Schedule` resource
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "sample-rg",
 *     location: "West Europe",
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "sample-vnet",
 *     addressSpaces: ["10.0.0.0/16"],
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "sample-subnet",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.0.2.0/24"],
 * });
 * const exampleNetworkInterface = new azure.network.NetworkInterface("example", {
 *     name: "sample-nic",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     ipConfigurations: [{
 *         name: "testconfiguration1",
 *         subnetId: exampleSubnet.id,
 *         privateIpAddressAllocation: "Dynamic",
 *     }],
 * });
 * const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("example", {
 *     name: "SampleVM",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     networkInterfaceIds: [exampleNetworkInterface.id],
 *     size: "Standard_B2s",
 *     sourceImageReference: {
 *         publisher: "Canonical",
 *         offer: "0001-com-ubuntu-server-jammy",
 *         sku: "22_04-lts",
 *         version: "latest",
 *     },
 *     osDisk: {
 *         name: "myosdisk-example",
 *         caching: "ReadWrite",
 *         storageAccountType: "Standard_LRS",
 *     },
 *     adminUsername: "testadmin",
 *     adminPassword: "Password1234!",
 *     disablePasswordAuthentication: false,
 * });
 * const exampleGlobalVMShutdownSchedule = new azure.devtest.GlobalVMShutdownSchedule("example", {
 *     virtualMachineId: exampleLinuxVirtualMachine.id,
 *     location: example.location,
 *     enabled: true,
 *     dailyRecurrenceTime: "1100",
 *     timezone: "Pacific Standard Time",
 *     notificationSettings: {
 *         enabled: true,
 *         timeInMinutes: 60,
 *         webhookUrl: "https://sample-webhook-url.example.com",
 *     },
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.DevTestLab` - 2018-09-15
 *
 * ## Import
 *
 * An existing Dev Test Global Shutdown Schedule can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:devtest/globalVMShutdownSchedule:GlobalVMShutdownSchedule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-rg/providers/Microsoft.DevTestLab/schedules/shutdown-computevm-SampleVM
 * ```
 *
 * The name of the resource within the `resource id` will always follow the format `shutdown-computevm-<VM Name>` where `<VM Name>` is replaced by the name of the target Virtual Machine
 */
class GlobalVMShutdownSchedule extends pulumi.CustomResource {
    /**
     * Get an existing GlobalVMShutdownSchedule resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new GlobalVMShutdownSchedule(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:devtest/globalVMShutdownSchedule:GlobalVMShutdownSchedule';
    /**
     * Returns true if the given object is an instance of GlobalVMShutdownSchedule.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === GlobalVMShutdownSchedule.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["dailyRecurrenceTime"] = state?.dailyRecurrenceTime;
            resourceInputs["enabled"] = state?.enabled;
            resourceInputs["location"] = state?.location;
            resourceInputs["notificationSettings"] = state?.notificationSettings;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["timezone"] = state?.timezone;
            resourceInputs["virtualMachineId"] = state?.virtualMachineId;
        }
        else {
            const args = argsOrState;
            if (args?.dailyRecurrenceTime === undefined && !opts.urn) {
                throw new Error("Missing required property 'dailyRecurrenceTime'");
            }
            if (args?.notificationSettings === undefined && !opts.urn) {
                throw new Error("Missing required property 'notificationSettings'");
            }
            if (args?.timezone === undefined && !opts.urn) {
                throw new Error("Missing required property 'timezone'");
            }
            if (args?.virtualMachineId === undefined && !opts.urn) {
                throw new Error("Missing required property 'virtualMachineId'");
            }
            resourceInputs["dailyRecurrenceTime"] = args?.dailyRecurrenceTime;
            resourceInputs["enabled"] = args?.enabled;
            resourceInputs["location"] = args?.location;
            resourceInputs["notificationSettings"] = args?.notificationSettings;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["timezone"] = args?.timezone;
            resourceInputs["virtualMachineId"] = args?.virtualMachineId;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(GlobalVMShutdownSchedule.__pulumiType, name, resourceInputs, opts);
    }
}
exports.GlobalVMShutdownSchedule = GlobalVMShutdownSchedule;
//# sourceMappingURL=globalVMShutdownSchedule.js.map