"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.NamespaceScheduledTask = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Namespace Scheduled Task resource in Oracle Cloud Infrastructure Log Analytics service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/logan-api-spec/latest/NamespaceScheduledTask
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/log_analytics
 *
 * Schedule a task as specified and return task info.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testNamespaceScheduledTask = new oci.loganalytics.NamespaceScheduledTask("test_namespace_scheduled_task", {
 *     compartmentId: compartmentId,
 *     kind: namespaceScheduledTaskKind,
 *     namespace: namespaceScheduledTaskNamespace,
 *     action: {
 *         type: namespaceScheduledTaskActionType,
 *         compartmentIdInSubtree: namespaceScheduledTaskActionCompartmentIdInSubtree === "true",
 *         dataType: namespaceScheduledTaskActionDataType,
 *         metricExtraction: {
 *             compartmentId: compartmentId,
 *             metricCollections: [{
 *                 dimensions: [{
 *                     dimensionName: namespaceScheduledTaskActionMetricExtractionMetricCollectionsDimensionsDimensionName,
 *                     queryFieldName: namespaceScheduledTaskActionMetricExtractionMetricCollectionsDimensionsQueryFieldName,
 *                 }],
 *                 metricName: testMetric.name,
 *                 metricQueryFieldName: namespaceScheduledTaskActionMetricExtractionMetricCollectionsMetricQueryFieldName,
 *                 queryTableName: testTable.name,
 *             }],
 *             metricName: testMetric.name,
 *             namespace: namespaceScheduledTaskActionMetricExtractionNamespace,
 *             resourceGroup: namespaceScheduledTaskActionMetricExtractionResourceGroup,
 *         },
 *         purgeCompartmentId: testCompartment.id,
 *         purgeDuration: namespaceScheduledTaskActionPurgeDuration,
 *         queryString: namespaceScheduledTaskActionQueryString,
 *         savedSearchId: testSavedSearch.id,
 *         templateDetails: {
 *             templateId: testTemplate.id,
 *             templateParams: [{
 *                 keyField: namespaceScheduledTaskActionTemplateDetailsTemplateParamsKeyField,
 *                 valueField: namespaceScheduledTaskActionTemplateDetailsTemplateParamsValueField,
 *             }],
 *         },
 *     },
 *     definedTags: {
 *         "foo-namespace.bar-key": "value",
 *     },
 *     description: namespaceScheduledTaskDescription,
 *     displayName: namespaceScheduledTaskDisplayName,
 *     freeformTags: {
 *         "bar-key": "value",
 *     },
 *     savedSearchId: testSavedSearch.id,
 *     schedules: {
 *         type: namespaceScheduledTaskSchedulesType,
 *         expression: namespaceScheduledTaskSchedulesExpression,
 *         misfirePolicy: namespaceScheduledTaskSchedulesMisfirePolicy,
 *         queryOffsetSecs: namespaceScheduledTaskSchedulesQueryOffsetSecs,
 *         recurringInterval: namespaceScheduledTaskSchedulesRecurringInterval,
 *         repeatCount: namespaceScheduledTaskSchedulesRepeatCount,
 *         timeEnd: namespaceScheduledTaskSchedulesTimeEnd,
 *         timeZone: namespaceScheduledTaskSchedulesTimeZone,
 *     },
 *     taskType: namespaceScheduledTaskTaskType,
 * });
 * ```
 *
 * ## Schedules
 *
 * There are parameters which require a specific constant value to be supplied.
 *
 * ### misfirePolicy
 *
 * #### 'RETRY_INDEFINITELY'
 * A constant which can be used with the misfirePolicy property of a Schedule. This constant has a value of “RETRY_INDEFINITELY”
 *
 * #### 'RETRY_ONCE'
 * A constant which can be used with the misfirePolicy property of a Schedule. This constant has a value of “RETRY_ONCE”
 *
 * #### 'SKIP'
 * A constant which can be used with the misfirePolicy property of a Schedule. This constant has a value of “SKIP”
 *
 * ### type
 *
 * #### 'AUTO'
 * A constant which can be used with the type property of a Schedule. This constant has a value of “AUTO”
 *
 * #### 'CRON'
 * A constant which can be used with the type property of a Schedule. This constant has a value of “CRON”
 *
 * #### 'FIXED_FREQUENCY'
 * A constant which can be used with the type property of a Schedule. This constant has a value of “FIXED_FREQUENCY”
 *
 * ## Import
 *
 * NamespaceScheduledTasks can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:LogAnalytics/namespaceScheduledTask:NamespaceScheduledTask test_namespace_scheduled_task "namespaces/{namespaceName}/scheduledTasks/{scheduledTaskId}"
 * ```
 */
class NamespaceScheduledTask extends pulumi.CustomResource {
    /**
     * Get an existing NamespaceScheduledTask 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 NamespaceScheduledTask(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:LogAnalytics/namespaceScheduledTask:NamespaceScheduledTask';
    /**
     * Returns true if the given object is an instance of NamespaceScheduledTask.  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'] === NamespaceScheduledTask.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["action"] = state?.action;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["description"] = state?.description;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["kind"] = state?.kind;
            resourceInputs["namespace"] = state?.namespace;
            resourceInputs["numOccurrences"] = state?.numOccurrences;
            resourceInputs["savedSearchId"] = state?.savedSearchId;
            resourceInputs["scheduledTaskId"] = state?.scheduledTaskId;
            resourceInputs["schedules"] = state?.schedules;
            resourceInputs["state"] = state?.state;
            resourceInputs["taskStatus"] = state?.taskStatus;
            resourceInputs["taskType"] = state?.taskType;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["timeUpdated"] = state?.timeUpdated;
            resourceInputs["workRequestId"] = state?.workRequestId;
        }
        else {
            const args = argsOrState;
            if (args?.action === undefined && !opts.urn) {
                throw new Error("Missing required property 'action'");
            }
            if (args?.compartmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'compartmentId'");
            }
            if (args?.kind === undefined && !opts.urn) {
                throw new Error("Missing required property 'kind'");
            }
            if (args?.namespace === undefined && !opts.urn) {
                throw new Error("Missing required property 'namespace'");
            }
            if (args?.schedules === undefined && !opts.urn) {
                throw new Error("Missing required property 'schedules'");
            }
            if (args?.taskType === undefined && !opts.urn) {
                throw new Error("Missing required property 'taskType'");
            }
            resourceInputs["action"] = args?.action;
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["description"] = args?.description;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["kind"] = args?.kind;
            resourceInputs["namespace"] = args?.namespace;
            resourceInputs["savedSearchId"] = args?.savedSearchId;
            resourceInputs["schedules"] = args?.schedules;
            resourceInputs["taskType"] = args?.taskType;
            resourceInputs["numOccurrences"] = undefined /*out*/;
            resourceInputs["scheduledTaskId"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["taskStatus"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
            resourceInputs["timeUpdated"] = undefined /*out*/;
            resourceInputs["workRequestId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(NamespaceScheduledTask.__pulumiType, name, resourceInputs, opts);
    }
}
exports.NamespaceScheduledTask = NamespaceScheduledTask;
//# sourceMappingURL=namespaceScheduledTask.js.map