@pulumi/pagerduty
Version:
A Pulumi package for creating and managing pagerduty cloud resources.
102 lines • 4.51 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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.BusinessServiceSubscriber = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* A [business service subscriber](https://developer.pagerduty.com/api-reference/b3A6NDUwNDgxOQ-list-business-service-subscribers) allows you to subscribe users or teams to automatically receive updates about key business services.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pagerduty from "@pulumi/pagerduty";
*
* const example = new pagerduty.BusinessService("example", {
* name: "My Web App",
* description: "A very descriptive description of this business service",
* pointOfContact: "PagerDuty Admin",
* team: "P37RSRS",
* });
* const engteam = new pagerduty.Team("engteam", {name: "Engineering"});
* const exampleUser = new pagerduty.User("example", {
* name: "Earline Greenholt",
* email: "125.greenholt.earline@graham.name",
* });
* const teamExample = new pagerduty.BusinessServiceSubscriber("team_example", {
* subscriberId: engteam.id,
* subscriberType: "team",
* businessServiceId: example.id,
* });
* const userExample = new pagerduty.BusinessServiceSubscriber("user_example", {
* subscriberId: exampleUser.id,
* subscriberType: "user",
* businessServiceId: example.id,
* });
* ```
*
* ## Import
*
* Services can be imported using the `id` using the related business service ID, the subscriber type and the subscriber ID separated by a dot, e.g.
*
* ```sh
* $ pulumi import pagerduty:index/businessServiceSubscriber:BusinessServiceSubscriber main PLBP09X.team.PLBP09X
* ```
*/
class BusinessServiceSubscriber extends pulumi.CustomResource {
/**
* Get an existing BusinessServiceSubscriber 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 BusinessServiceSubscriber(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of BusinessServiceSubscriber. 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'] === BusinessServiceSubscriber.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["businessServiceId"] = state?.businessServiceId;
resourceInputs["subscriberId"] = state?.subscriberId;
resourceInputs["subscriberType"] = state?.subscriberType;
}
else {
const args = argsOrState;
if (args?.businessServiceId === undefined && !opts.urn) {
throw new Error("Missing required property 'businessServiceId'");
}
if (args?.subscriberId === undefined && !opts.urn) {
throw new Error("Missing required property 'subscriberId'");
}
if (args?.subscriberType === undefined && !opts.urn) {
throw new Error("Missing required property 'subscriberType'");
}
resourceInputs["businessServiceId"] = args?.businessServiceId;
resourceInputs["subscriberId"] = args?.subscriberId;
resourceInputs["subscriberType"] = args?.subscriberType;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(BusinessServiceSubscriber.__pulumiType, name, resourceInputs, opts);
}
}
exports.BusinessServiceSubscriber = BusinessServiceSubscriber;
/** @internal */
BusinessServiceSubscriber.__pulumiType = 'pagerduty:index/businessServiceSubscriber:BusinessServiceSubscriber';
//# sourceMappingURL=businessServiceSubscriber.js.map