"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.DashboardV2 = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
 * [BETA] Provides an updated version of the Datadog dashboard resource which improves compliance with Datadog's dashboard API spec. This version is currently experimental and prone to changes.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 *
 * // Example Ordered Layout
 * const orderedDashboard = new datadog.DashboardV2("ordered_dashboard", {
 *     title: "Ordered Layout Dashboard",
 *     description: "Created using the Datadog provider in Pulumi",
 *     layoutType: "ordered",
 *     widgets: [
 *         {
 *             timeseriesDefinition: {
 *                 requests: [{
 *                     formulas: [{
 *                         formulaExpression: "my_query_1",
 *                         alias: "CPU Usage",
 *                     }],
 *                     queries: [{
 *                         metricQuery: {
 *                             dataSource: "metrics",
 *                             query: "avg:system.cpu.user{*} by {env}",
 *                             name: "my_query_1",
 *                             aggregator: "avg",
 *                         },
 *                     }],
 *                 }],
 *                 title: "CPU Usage by Environment",
 *                 liveSpan: "1h",
 *             },
 *         },
 *         {
 *             queryValueDefinition: {
 *                 requests: [{
 *                     formulas: [{
 *                         formulaExpression: "my_query_1",
 *                     }],
 *                     queries: [{
 *                         metricQuery: {
 *                             dataSource: "metrics",
 *                             query: "avg:system.load.1{*}",
 *                             name: "my_query_1",
 *                             aggregator: "avg",
 *                         },
 *                     }],
 *                     conditionalFormats: [
 *                         {
 *                             comparator: "<",
 *                             value: 2,
 *                             palette: "white_on_green",
 *                         },
 *                         {
 *                             comparator: ">",
 *                             value: 2.2,
 *                             palette: "white_on_red",
 *                         },
 *                     ],
 *                 }],
 *                 autoscale: true,
 *                 precision: 4,
 *                 textAlign: "right",
 *                 title: "System Load",
 *                 liveSpan: "1h",
 *             },
 *         },
 *         {
 *             groupDefinition: {
 *                 layoutType: "ordered",
 *                 title: "Group Widget",
 *                 widgets: [{
 *                     noteDefinition: {
 *                         content: "cluster note widget",
 *                         backgroundColor: "pink",
 *                         fontSize: "14",
 *                         textAlign: "center",
 *                         showTick: true,
 *                         tickEdge: "left",
 *                         tickPos: "50%",
 *                     },
 *                 }],
 *             },
 *         },
 *     ],
 *     templateVariables: [{
 *         name: "var_1",
 *         prefix: "host",
 *         "default": "aws",
 *     }],
 * });
 * // Example Free Layout
 * const freeDashboard = new datadog.DashboardV2("free_dashboard", {
 *     title: "Free Layout Dashboard",
 *     description: "Created using the Datadog provider in Pulumi",
 *     layoutType: "free",
 *     widgets: [{
 *         timeseriesDefinition: {
 *             requests: [{
 *                 formulas: [{
 *                     formulaExpression: "my_query_1",
 *                 }],
 *                 queries: [{
 *                     metricQuery: {
 *                         dataSource: "metrics",
 *                         query: "avg:system.cpu.user{*} by {env}",
 *                         name: "my_query_1",
 *                         aggregator: "sum",
 *                     },
 *                 }],
 *             }],
 *         },
 *         widgetLayout: {
 *             height: 16,
 *             width: 25,
 *             x: 0,
 *             y: 0,
 *         },
 *     }],
 *     templateVariables: [{
 *         name: "var_1",
 *         prefix: "host",
 *         "default": "aws",
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * The `pulumi import` command can be used, for example:
 *
 * ```sh
 * $ pulumi import datadog:index/dashboardV2:DashboardV2 my_service_dashboard sv7-gyh-kas
 * ```
 */
class DashboardV2 extends pulumi.CustomResource {
    /**
     * Get an existing DashboardV2 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 DashboardV2(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'datadog:index/dashboardV2:DashboardV2';
    /**
     * Returns true if the given object is an instance of DashboardV2.  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'] === DashboardV2.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["dashboardLists"] = state?.dashboardLists;
            resourceInputs["dashboardListsRemoveds"] = state?.dashboardListsRemoveds;
            resourceInputs["description"] = state?.description;
            resourceInputs["isReadOnly"] = state?.isReadOnly;
            resourceInputs["layoutType"] = state?.layoutType;
            resourceInputs["notifyLists"] = state?.notifyLists;
            resourceInputs["reflowType"] = state?.reflowType;
            resourceInputs["restrictedRoles"] = state?.restrictedRoles;
            resourceInputs["tabs"] = state?.tabs;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["templateVariablePresets"] = state?.templateVariablePresets;
            resourceInputs["templateVariables"] = state?.templateVariables;
            resourceInputs["title"] = state?.title;
            resourceInputs["url"] = state?.url;
            resourceInputs["widgets"] = state?.widgets;
        }
        else {
            const args = argsOrState;
            if (args?.layoutType === undefined && !opts.urn) {
                throw new Error("Missing required property 'layoutType'");
            }
            if (args?.title === undefined && !opts.urn) {
                throw new Error("Missing required property 'title'");
            }
            resourceInputs["dashboardLists"] = args?.dashboardLists;
            resourceInputs["dashboardListsRemoveds"] = args?.dashboardListsRemoveds;
            resourceInputs["description"] = args?.description;
            resourceInputs["isReadOnly"] = args?.isReadOnly;
            resourceInputs["layoutType"] = args?.layoutType;
            resourceInputs["notifyLists"] = args?.notifyLists;
            resourceInputs["reflowType"] = args?.reflowType;
            resourceInputs["restrictedRoles"] = args?.restrictedRoles;
            resourceInputs["tabs"] = args?.tabs;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["templateVariablePresets"] = args?.templateVariablePresets;
            resourceInputs["templateVariables"] = args?.templateVariables;
            resourceInputs["title"] = args?.title;
            resourceInputs["url"] = args?.url;
            resourceInputs["widgets"] = args?.widgets;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(DashboardV2.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DashboardV2 = DashboardV2;
//# sourceMappingURL=dashboardV2.js.map