@pulumi/opsgenie
Version:
A Pulumi package for creating and managing opsgenie cloud resources.
136 lines • 5.5 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.ScheduleRotation = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
* Manages a Schedule Rotation within Opsgenie.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as opsgenie from "@pulumi/opsgenie";
*
* const test = new opsgenie.ScheduleRotation("test", {
* scheduleId: testOpsgenieSchedule.id,
* name: "test",
* startDate: "2019-06-18T17:00:00Z",
* endDate: "2019-06-20T17:30:00Z",
* type: "hourly",
* length: 6,
* participants: [{
* type: "user",
* id: testOpsgenieUser.id,
* }],
* timeRestrictions: [{
* type: "time-of-day",
* restriction: [{
* startHour: 1,
* startMin: 1,
* endHour: 10,
* endMin: 1,
* }],
* }],
* });
* ```
*
* ## Import
*
* Schedule Rotations can be imported using the `schedule_id/rotation_id`, e.g.
*
* * `terraform import opsgenie_schedule_rotation.test schedule_id/rotation_id`
*/
class ScheduleRotation extends pulumi.CustomResource {
/**
* Get an existing ScheduleRotation 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 ScheduleRotation(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'opsgenie:index/scheduleRotation:ScheduleRotation';
/**
* Returns true if the given object is an instance of ScheduleRotation. 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'] === ScheduleRotation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["endDate"] = state?.endDate;
resourceInputs["length"] = state?.length;
resourceInputs["name"] = state?.name;
resourceInputs["participants"] = state?.participants;
resourceInputs["scheduleId"] = state?.scheduleId;
resourceInputs["startDate"] = state?.startDate;
resourceInputs["timeRestrictions"] = state?.timeRestrictions;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.participants === undefined && !opts.urn) {
throw new Error("Missing required property 'participants'");
}
if (args?.scheduleId === undefined && !opts.urn) {
throw new Error("Missing required property 'scheduleId'");
}
if (args?.startDate === undefined && !opts.urn) {
throw new Error("Missing required property 'startDate'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["endDate"] = args?.endDate;
resourceInputs["length"] = args?.length;
resourceInputs["name"] = args?.name;
resourceInputs["participants"] = args?.participants;
resourceInputs["scheduleId"] = args?.scheduleId;
resourceInputs["startDate"] = args?.startDate;
resourceInputs["timeRestrictions"] = args?.timeRestrictions;
resourceInputs["type"] = args?.type;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ScheduleRotation.__pulumiType, name, resourceInputs, opts);
}
}
exports.ScheduleRotation = ScheduleRotation;
//# sourceMappingURL=scheduleRotation.js.map