@pulumi/pagerduty
Version:
A Pulumi package for creating and managing pagerduty cloud resources.
91 lines • 3.83 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.IncidentType = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pagerduty from "@pulumi/pagerduty";
*
* const base = pagerduty.getIncidentType({
* displayName: "Base Incident",
* });
* const example = new pagerduty.IncidentType("example", {
* name: "backoffice",
* displayName: "Backoffice Incident",
* parentType: base.then(base => base.id),
* description: "Internal incidents not facing customer",
* });
* ```
*
* ## Import
*
* Services can be imported using the `id`, e.g.
*
* ```sh
* $ pulumi import pagerduty:index/incidentType:IncidentType main P12345
* ```
*/
class IncidentType extends pulumi.CustomResource {
/**
* Get an existing IncidentType 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 IncidentType(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of IncidentType. 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'] === IncidentType.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["parentType"] = state ? state.parentType : undefined;
resourceInputs["type"] = state ? state.type : undefined;
}
else {
const args = argsOrState;
if ((!args || args.displayName === undefined) && !opts.urn) {
throw new Error("Missing required property 'displayName'");
}
if ((!args || args.parentType === undefined) && !opts.urn) {
throw new Error("Missing required property 'parentType'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["parentType"] = args ? args.parentType : undefined;
resourceInputs["type"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(IncidentType.__pulumiType, name, resourceInputs, opts);
}
}
exports.IncidentType = IncidentType;
/** @internal */
IncidentType.__pulumiType = 'pagerduty:index/incidentType:IncidentType';
//# sourceMappingURL=incidentType.js.map