"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.OnCallSchedule = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
 * Provides a Datadog On-Call schedule resource. This can be used to create and manage Datadog On-Call schedules.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 *
 * const test = new datadog.OnCallSchedule("test", {
 *     name: "Team A On-Call",
 *     timeZone: "America/New_York",
 *     teams: ["00000000-aba2-0000-0000-000000000000"],
 *     layers: [
 *         {
 *             name: "Primary On-Call Layer",
 *             effectiveDate: "2025-01-01T00:00:00Z",
 *             endDate: "2026-01-01T00:00:00Z",
 *             rotationStart: "2025-01-01T00:00:00Z",
 *             interval: [{
 *                 days: 1,
 *                 seconds: 300,
 *             }],
 *             users: ["00000000-aba1-0000-0000-000000000000"],
 *             restrictions: [{
 *                 endDay: "monday",
 *                 endTime: "17:00:00",
 *                 startDay: "monday",
 *                 startTime: "09:00:00",
 *             }],
 *         },
 *         {
 *             name: "Asia-Pacific On-Call Layer",
 *             effectiveDate: "2025-01-01T00:00:00Z",
 *             rotationStart: "2025-01-01T00:00:00Z",
 *             timeZone: "Asia/Tokyo",
 *             interval: [{
 *                 days: 7,
 *             }],
 *             users: ["00000000-aba1-0000-0000-000000000001"],
 *         },
 *     ],
 * });
 * ```
 *
 * ## Import
 *
 * The `pulumi import` command can be used, for example:
 *
 * Import an existing onCallSchedule
 *
 * ```sh
 * $ pulumi import datadog:index/onCallSchedule:OnCallSchedule test "b03a07d5-49da-43e9-83b4-5d84969b588b"
 * ```
 */
class OnCallSchedule extends pulumi.CustomResource {
    /**
     * Get an existing OnCallSchedule 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 OnCallSchedule(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'datadog:index/onCallSchedule:OnCallSchedule';
    /**
     * Returns true if the given object is an instance of OnCallSchedule.  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'] === OnCallSchedule.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["layers"] = state?.layers;
            resourceInputs["name"] = state?.name;
            resourceInputs["teams"] = state?.teams;
            resourceInputs["timeZone"] = state?.timeZone;
        }
        else {
            const args = argsOrState;
            if (args?.layers === undefined && !opts.urn) {
                throw new Error("Missing required property 'layers'");
            }
            if (args?.name === undefined && !opts.urn) {
                throw new Error("Missing required property 'name'");
            }
            if (args?.timeZone === undefined && !opts.urn) {
                throw new Error("Missing required property 'timeZone'");
            }
            resourceInputs["layers"] = args?.layers;
            resourceInputs["name"] = args?.name;
            resourceInputs["teams"] = args?.teams;
            resourceInputs["timeZone"] = args?.timeZone;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(OnCallSchedule.__pulumiType, name, resourceInputs, opts);
    }
}
exports.OnCallSchedule = OnCallSchedule;
//# sourceMappingURL=onCallSchedule.js.map