"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.RumRetentionFiltersOrder = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
 * Provides a Datadog RumRetentionFiltersOrder resource. This is used to manage the order of Datadog RUM retention filters. Please note that retentionFilterIds should contain all IDs of retention filters, including the default ones created internally for a given RUM application.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 * import * as std from "@pulumi/std";
 *
 * // Create a new rum_application resource.
 * const myRumApplication = new datadog.RumApplication("my_rum_application", {
 *     name: "my-rum-application-test",
 *     type: "browser",
 * });
 * // Retrieve rum_retention_filters for the rum_application created above.
 * const myRetentionFilters = datadog.getRumRetentionFilters({
 *     applicationId: datadogRumApplication.myRumApplication.id,
 * });
 * // Create a new rum_retention_filter resource.
 * const newRumRetentionFilter = new datadog.RumRetentionFilter("new_rum_retention_filter", {
 *     applicationId: datadogRumApplication.myRumApplication.id,
 *     name: "testing.rum.retention_filter",
 *     eventType: "action",
 *     sampleRate: 60,
 *     query: "@session.has_replay:true",
 *     enabled: true,
 * });
 * // Create a new rum_retention_filters_order resource for reordering.
 * // Please note that the IDs of all default retention filters have the prefix 'default', and you need to populate the retention_filter_ids field with all retention filter IDs.
 * const myRumRetentionFiltersOrder = new datadog.RumRetentionFiltersOrder("my_rum_retention_filters_order", {
 *     applicationId: datadogRumApplication.myRumApplication.id,
 *     retentionFilterIds: std.concat({
 *         input: [
 *             myRetentionFilters.then(myRetentionFilters => .filter(rf => std.startswith({
 *                 input: rf.id,
 *                 prefix: "default",
 *             }).result).map(rf => (rf.id))),
 *             [newRumRetentionFilter.id],
 *             pulumi.all([myRetentionFilters, newRumRetentionFilter.id]).apply(([myRetentionFilters, id]) => .filter(rf => !std.startswith({
 *                 input: rf.id,
 *                 prefix: "default",
 *             }).result && rf.id != id).map(rf => (rf.id))),
 *         ],
 *     }).result,
 * });
 * ```
 *
 * ## Import
 *
 * The `pulumi import` command can be used, for example:
 *
 * ```sh
 * $ pulumi import datadog:index/rumRetentionFiltersOrder:RumRetentionFiltersOrder testing_rum_retention_filters_order "<application_id>"
 * ```
 */
class RumRetentionFiltersOrder extends pulumi.CustomResource {
    /**
     * Get an existing RumRetentionFiltersOrder 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 RumRetentionFiltersOrder(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'datadog:index/rumRetentionFiltersOrder:RumRetentionFiltersOrder';
    /**
     * Returns true if the given object is an instance of RumRetentionFiltersOrder.  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'] === RumRetentionFiltersOrder.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["applicationId"] = state?.applicationId;
            resourceInputs["retentionFilterIds"] = state?.retentionFilterIds;
        }
        else {
            const args = argsOrState;
            if (args?.applicationId === undefined && !opts.urn) {
                throw new Error("Missing required property 'applicationId'");
            }
            if (args?.retentionFilterIds === undefined && !opts.urn) {
                throw new Error("Missing required property 'retentionFilterIds'");
            }
            resourceInputs["applicationId"] = args?.applicationId;
            resourceInputs["retentionFilterIds"] = args?.retentionFilterIds;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RumRetentionFiltersOrder.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RumRetentionFiltersOrder = RumRetentionFiltersOrder;
//# sourceMappingURL=rumRetentionFiltersOrder.js.map