@pulumi/harness
Version:
A Pulumi package for creating and managing Harness resources.
102 lines • 4.84 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.FeatureFlag = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing Feature Flags.
*/
class FeatureFlag extends pulumi.CustomResource {
/**
* Get an existing FeatureFlag 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 FeatureFlag(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of FeatureFlag. 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'] === FeatureFlag.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["archived"] = state?.archived;
resourceInputs["defaultOffVariation"] = state?.defaultOffVariation;
resourceInputs["defaultOnVariation"] = state?.defaultOnVariation;
resourceInputs["description"] = state?.description;
resourceInputs["environments"] = state?.environments;
resourceInputs["identifier"] = state?.identifier;
resourceInputs["kind"] = state?.kind;
resourceInputs["name"] = state?.name;
resourceInputs["orgId"] = state?.orgId;
resourceInputs["owner"] = state?.owner;
resourceInputs["permanent"] = state?.permanent;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["tags"] = state?.tags;
resourceInputs["variations"] = state?.variations;
}
else {
const args = argsOrState;
if (args?.defaultOffVariation === undefined && !opts.urn) {
throw new Error("Missing required property 'defaultOffVariation'");
}
if (args?.defaultOnVariation === undefined && !opts.urn) {
throw new Error("Missing required property 'defaultOnVariation'");
}
if (args?.identifier === undefined && !opts.urn) {
throw new Error("Missing required property 'identifier'");
}
if (args?.kind === undefined && !opts.urn) {
throw new Error("Missing required property 'kind'");
}
if (args?.orgId === undefined && !opts.urn) {
throw new Error("Missing required property 'orgId'");
}
if (args?.permanent === undefined && !opts.urn) {
throw new Error("Missing required property 'permanent'");
}
if (args?.projectId === undefined && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
if (args?.variations === undefined && !opts.urn) {
throw new Error("Missing required property 'variations'");
}
resourceInputs["archived"] = args?.archived;
resourceInputs["defaultOffVariation"] = args?.defaultOffVariation;
resourceInputs["defaultOnVariation"] = args?.defaultOnVariation;
resourceInputs["description"] = args?.description;
resourceInputs["environments"] = args?.environments;
resourceInputs["identifier"] = args?.identifier;
resourceInputs["kind"] = args?.kind;
resourceInputs["name"] = args?.name;
resourceInputs["orgId"] = args?.orgId;
resourceInputs["owner"] = args?.owner;
resourceInputs["permanent"] = args?.permanent;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["tags"] = args?.tags;
resourceInputs["variations"] = args?.variations;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(FeatureFlag.__pulumiType, name, resourceInputs, opts);
}
}
exports.FeatureFlag = FeatureFlag;
/** @internal */
FeatureFlag.__pulumiType = 'harness:platform/featureFlag:FeatureFlag';
//# sourceMappingURL=featureFlag.js.map