@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
73 lines • 3.43 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.OrganizationWebhook = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to create and manage webhooks for GitHub organization.
*
* ## Import
*
* Organization webhooks can be imported using the `id` of the webhook.
* The `id` of the webhook can be found in the URL of the webhook. For example, `"https://github.com/organizations/foo-org/settings/hooks/123456789"`.
*
* ```sh
* $ pulumi import github:index/organizationWebhook:OrganizationWebhook terraform 123456789
* ```
* If secret is populated in the webhook's configuration, the value will be imported as "********".
*/
class OrganizationWebhook extends pulumi.CustomResource {
/**
* Get an existing OrganizationWebhook 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 OrganizationWebhook(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of OrganizationWebhook. 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'] === OrganizationWebhook.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["active"] = state ? state.active : undefined;
resourceInputs["configuration"] = state ? state.configuration : undefined;
resourceInputs["etag"] = state ? state.etag : undefined;
resourceInputs["events"] = state ? state.events : undefined;
resourceInputs["url"] = state ? state.url : undefined;
}
else {
const args = argsOrState;
if ((!args || args.events === undefined) && !opts.urn) {
throw new Error("Missing required property 'events'");
}
resourceInputs["active"] = args ? args.active : undefined;
resourceInputs["configuration"] = args ? args.configuration : undefined;
resourceInputs["events"] = args ? args.events : undefined;
resourceInputs["etag"] = undefined /*out*/;
resourceInputs["url"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(OrganizationWebhook.__pulumiType, name, resourceInputs, opts);
}
}
exports.OrganizationWebhook = OrganizationWebhook;
/** @internal */
OrganizationWebhook.__pulumiType = 'github:index/organizationWebhook:OrganizationWebhook';
//# sourceMappingURL=organizationWebhook.js.map
;