@pulumi/harness
Version:
A Pulumi package for creating and managing Harness resources.
91 lines • 4.28 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.RepoRuleBranch = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for creating a Harness Repo Branch Rule.
*/
class RepoRuleBranch extends pulumi.CustomResource {
/**
* Get an existing RepoRuleBranch 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 RepoRuleBranch(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of RepoRuleBranch. 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'] === RepoRuleBranch.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["bypasses"] = state?.bypasses;
resourceInputs["created"] = state?.created;
resourceInputs["createdBy"] = state?.createdBy;
resourceInputs["description"] = state?.description;
resourceInputs["identifier"] = state?.identifier;
resourceInputs["orgId"] = state?.orgId;
resourceInputs["patterns"] = state?.patterns;
resourceInputs["policies"] = state?.policies;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["repoIdentifier"] = state?.repoIdentifier;
resourceInputs["state"] = state?.state;
resourceInputs["updated"] = state?.updated;
resourceInputs["updatedBy"] = state?.updatedBy;
}
else {
const args = argsOrState;
if (args?.bypasses === undefined && !opts.urn) {
throw new Error("Missing required property 'bypasses'");
}
if (args?.identifier === undefined && !opts.urn) {
throw new Error("Missing required property 'identifier'");
}
if (args?.policies === undefined && !opts.urn) {
throw new Error("Missing required property 'policies'");
}
if (args?.repoIdentifier === undefined && !opts.urn) {
throw new Error("Missing required property 'repoIdentifier'");
}
if (args?.state === undefined && !opts.urn) {
throw new Error("Missing required property 'state'");
}
resourceInputs["bypasses"] = args?.bypasses;
resourceInputs["description"] = args?.description;
resourceInputs["identifier"] = args?.identifier;
resourceInputs["orgId"] = args?.orgId;
resourceInputs["patterns"] = args?.patterns;
resourceInputs["policies"] = args?.policies;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["repoIdentifier"] = args?.repoIdentifier;
resourceInputs["state"] = args?.state;
resourceInputs["created"] = undefined /*out*/;
resourceInputs["createdBy"] = undefined /*out*/;
resourceInputs["updated"] = undefined /*out*/;
resourceInputs["updatedBy"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RepoRuleBranch.__pulumiType, name, resourceInputs, opts);
}
}
exports.RepoRuleBranch = RepoRuleBranch;
/** @internal */
RepoRuleBranch.__pulumiType = 'harness:platform/repoRuleBranch:RepoRuleBranch';
//# sourceMappingURL=repoRuleBranch.js.map