@statsig/pulumi-statsig
Version:
A Pulumi package for creating and managing Statsig resources.
89 lines • 4.88 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.MetricSource = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to configure metric sources for your Statsig project.
*
* To learn more about metric sources, see [Metric Source Documentation](https://docs.statsig.com/statsig-warehouse-native/configuration/metric-sources)
*
* To learn more about the API powering this resource, see [Metrics API Documentation](https://docs.statsig.com/console-api/metrics)
*
* > Note: This resource is only available for [Warehouse Native](https://docs.statsig.com/statsig-warehouse-native/introduction/) projects
*/
class MetricSource extends pulumi.CustomResource {
/**
* Get an existing MetricSource 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 MetricSource(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MetricSource. 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'] === MetricSource.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["customFieldMappings"] = state ? state.customFieldMappings : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["idTypeMappings"] = state ? state.idTypeMappings : undefined;
resourceInputs["isReadOnly"] = state ? state.isReadOnly : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["owner"] = state ? state.owner : undefined;
resourceInputs["sourceType"] = state ? state.sourceType : undefined;
resourceInputs["sql"] = state ? state.sql : undefined;
resourceInputs["tableName"] = state ? state.tableName : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["timestampAsDay"] = state ? state.timestampAsDay : undefined;
resourceInputs["timestampColumn"] = state ? state.timestampColumn : undefined;
}
else {
const args = argsOrState;
if ((!args || args.idTypeMappings === undefined) && !opts.urn) {
throw new Error("Missing required property 'idTypeMappings'");
}
if ((!args || args.sql === undefined) && !opts.urn) {
throw new Error("Missing required property 'sql'");
}
if ((!args || args.timestampColumn === undefined) && !opts.urn) {
throw new Error("Missing required property 'timestampColumn'");
}
resourceInputs["customFieldMappings"] = args ? args.customFieldMappings : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["idTypeMappings"] = args ? args.idTypeMappings : undefined;
resourceInputs["isReadOnly"] = args ? args.isReadOnly : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["owner"] = args ? args.owner : undefined;
resourceInputs["sourceType"] = args ? args.sourceType : undefined;
resourceInputs["sql"] = args ? args.sql : undefined;
resourceInputs["tableName"] = args ? args.tableName : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["timestampAsDay"] = args ? args.timestampAsDay : undefined;
resourceInputs["timestampColumn"] = args ? args.timestampColumn : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MetricSource.__pulumiType, name, resourceInputs, opts);
}
}
exports.MetricSource = MetricSource;
/** @internal */
MetricSource.__pulumiType = 'statsig:index/metricSource:MetricSource';
//# sourceMappingURL=metricSource.js.map