@pulumi/opsgenie
Version:
A Pulumi package for creating and managing opsgenie cloud resources.
130 lines • 5.65 kB
JavaScript
;
// *** 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.NotificationPolicy = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
* Manages a Notification Policy within Opsgenie.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as opsgenie from "@pulumi/opsgenie";
*
* const test = new opsgenie.Team("test", {
* name: "example team",
* description: "This team deals with all the things",
* });
* const testNotificationPolicy = new opsgenie.NotificationPolicy("test", {
* filters: [{}],
* name: "example policy",
* teamId: test.id,
* policyDescription: "This policy has a delay action",
* delayActions: [{
* delayOption: "next-time",
* untilMinute: 1,
* untilHour: 9,
* }],
* });
* ```
*
* ## Import
*
* Notification policies can be imported using the `teamId` and `notificationPolicyId`, e.g.
*
* `$ terraform import opsgenie_notification_policy.test team_id/notification_policy_id`
*/
class NotificationPolicy extends pulumi.CustomResource {
/**
* Get an existing NotificationPolicy 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 NotificationPolicy(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'opsgenie:index/notificationPolicy:NotificationPolicy';
/**
* Returns true if the given object is an instance of NotificationPolicy. 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'] === NotificationPolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["autoCloseActions"] = state?.autoCloseActions;
resourceInputs["autoRestartActions"] = state?.autoRestartActions;
resourceInputs["deDuplicationActions"] = state?.deDuplicationActions;
resourceInputs["delayActions"] = state?.delayActions;
resourceInputs["enabled"] = state?.enabled;
resourceInputs["filters"] = state?.filters;
resourceInputs["name"] = state?.name;
resourceInputs["policyDescription"] = state?.policyDescription;
resourceInputs["suppress"] = state?.suppress;
resourceInputs["teamId"] = state?.teamId;
resourceInputs["timeRestrictions"] = state?.timeRestrictions;
}
else {
const args = argsOrState;
if (args?.filters === undefined && !opts.urn) {
throw new Error("Missing required property 'filters'");
}
if (args?.teamId === undefined && !opts.urn) {
throw new Error("Missing required property 'teamId'");
}
resourceInputs["autoCloseActions"] = args?.autoCloseActions;
resourceInputs["autoRestartActions"] = args?.autoRestartActions;
resourceInputs["deDuplicationActions"] = args?.deDuplicationActions;
resourceInputs["delayActions"] = args?.delayActions;
resourceInputs["enabled"] = args?.enabled;
resourceInputs["filters"] = args?.filters;
resourceInputs["name"] = args?.name;
resourceInputs["policyDescription"] = args?.policyDescription;
resourceInputs["suppress"] = args?.suppress;
resourceInputs["teamId"] = args?.teamId;
resourceInputs["timeRestrictions"] = args?.timeRestrictions;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NotificationPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.NotificationPolicy = NotificationPolicy;
//# sourceMappingURL=notificationPolicy.js.map