@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
106 lines • 5.27 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.ServiceendpointIncomingwebhook = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages an Incoming WebHook service endpoint within Azure DevOps, which can be used as a resource in YAML pipelines to subscribe to a webhook event.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {
* name: "Example Project",
* visibility: "private",
* versionControl: "Git",
* workItemTemplate: "Agile",
* description: "Managed by Pulumi",
* });
* const exampleServiceendpointIncomingwebhook = new azuredevops.ServiceendpointIncomingwebhook("example", {
* projectId: example.id,
* webhookName: "example_webhook",
* secret: "secret",
* httpHeader: "X-Hub-Signature",
* serviceEndpointName: "Example IncomingWebhook",
* description: "Managed by Pulumi",
* });
* ```
*
* ## Import
*
* Azure DevOps Incoming WebHook Service Endpoint can be imported using **projectID/serviceEndpointID** or **projectName/serviceEndpointID**
*
* ```sh
* $ pulumi import azuredevops:index/serviceendpointIncomingwebhook:ServiceendpointIncomingwebhook example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
* ```
*/
class ServiceendpointIncomingwebhook extends pulumi.CustomResource {
/**
* Get an existing ServiceendpointIncomingwebhook 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 ServiceendpointIncomingwebhook(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ServiceendpointIncomingwebhook. 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'] === ServiceendpointIncomingwebhook.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["authorization"] = state ? state.authorization : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["httpHeader"] = state ? state.httpHeader : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["secret"] = state ? state.secret : undefined;
resourceInputs["serviceEndpointName"] = state ? state.serviceEndpointName : undefined;
resourceInputs["webhookName"] = state ? state.webhookName : undefined;
}
else {
const args = argsOrState;
if ((!args || args.projectId === undefined) && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
if ((!args || args.serviceEndpointName === undefined) && !opts.urn) {
throw new Error("Missing required property 'serviceEndpointName'");
}
if ((!args || args.webhookName === undefined) && !opts.urn) {
throw new Error("Missing required property 'webhookName'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["httpHeader"] = args ? args.httpHeader : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["secret"] = (args === null || args === void 0 ? void 0 : args.secret) ? pulumi.secret(args.secret) : undefined;
resourceInputs["serviceEndpointName"] = args ? args.serviceEndpointName : undefined;
resourceInputs["webhookName"] = args ? args.webhookName : undefined;
resourceInputs["authorization"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["secret"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ServiceendpointIncomingwebhook.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServiceendpointIncomingwebhook = ServiceendpointIncomingwebhook;
/** @internal */
ServiceendpointIncomingwebhook.__pulumiType = 'azuredevops:index/serviceendpointIncomingwebhook:ServiceendpointIncomingwebhook';
//# sourceMappingURL=serviceendpointIncomingwebhook.js.map