UNPKG

@pulumi/pulumiservice

Version:
101 lines 5.25 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.Webhook = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Pulumi Webhooks allow you to notify external services of events happening within your Pulumi organization or stack. For example, you can trigger a notification whenever a stack is updated. Whenever an event occurs, Pulumi will send an HTTP POST request to all registered webhooks. The webhook can then be used to emit some notification, start running integration tests, or even update additional stacks. * * ### Import * * Pulumi webhooks can be imported using the `id`, which for webhooks is `{org}/{project}/{stack}/{webhook-name}` e.g., * * ```sh * $ pulumi import pulumiservice:index:Webhook my_webhook my-org/my-project/my-stack/4b0d0671 * ``` */ class Webhook extends pulumi.CustomResource { /** * Get an existing Webhook 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 opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, opts) { return new Webhook(name, undefined, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Webhook. 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'] === Webhook.__pulumiType; } /** * Create a Webhook resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name, args, opts) { var _a; let resourceInputs = {}; opts = opts || {}; if (!opts.id) { if ((!args || args.active === undefined) && !opts.urn) { throw new Error("Missing required property 'active'"); } if ((!args || args.displayName === undefined) && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if ((!args || args.organizationName === undefined) && !opts.urn) { throw new Error("Missing required property 'organizationName'"); } if ((!args || args.payloadUrl === undefined) && !opts.urn) { throw new Error("Missing required property 'payloadUrl'"); } resourceInputs["active"] = args ? args.active : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["environmentName"] = args ? args.environmentName : undefined; resourceInputs["filters"] = args ? args.filters : undefined; resourceInputs["format"] = (_a = (args ? args.format : undefined)) !== null && _a !== void 0 ? _a : "raw"; resourceInputs["groups"] = args ? args.groups : undefined; resourceInputs["organizationName"] = args ? args.organizationName : undefined; resourceInputs["payloadUrl"] = args ? args.payloadUrl : undefined; resourceInputs["projectName"] = args ? args.projectName : undefined; resourceInputs["secret"] = (args === null || args === void 0 ? void 0 : args.secret) ? pulumi.secret(args.secret) : undefined; resourceInputs["stackName"] = args ? args.stackName : undefined; resourceInputs["name"] = undefined /*out*/; } else { resourceInputs["active"] = undefined /*out*/; resourceInputs["displayName"] = undefined /*out*/; resourceInputs["environmentName"] = undefined /*out*/; resourceInputs["filters"] = undefined /*out*/; resourceInputs["format"] = undefined /*out*/; resourceInputs["groups"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["organizationName"] = undefined /*out*/; resourceInputs["payloadUrl"] = undefined /*out*/; resourceInputs["projectName"] = undefined /*out*/; resourceInputs["secret"] = undefined /*out*/; resourceInputs["stackName"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["secret"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Webhook.__pulumiType, name, resourceInputs, opts); } } exports.Webhook = Webhook; /** @internal */ Webhook.__pulumiType = 'pulumiservice:index:Webhook'; //# sourceMappingURL=webhook.js.map