UNPKG

@pulumi/opsgenie

Version:

A Pulumi package for creating and managing opsgenie cloud resources.

115 lines 4.51 kB
"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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.ScheduleRotation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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. * * ```sh * $ pulumi import opsgenie:index/scheduleRotation:ScheduleRotation * `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 }); } /** * 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; /** @internal */ ScheduleRotation.__pulumiType = 'opsgenie:index/scheduleRotation:ScheduleRotation'; //# sourceMappingURL=scheduleRotation.js.map