UNPKG

@statsig/pulumi-statsig

Version:

A Pulumi package for creating and managing Statsig resources.

99 lines 5.8 kB
"use strict"; // *** 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.Metric = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * This resource allows you to configure metrics for your Statsig project. * * To learn more about metrics, see [Metrics Documentation](https://docs.statsig.com/metrics/101) * * To learn more about the API powering this resource, see [Metrics API Documentation](https://docs.statsig.com/console-api/metrics) * * > Note: [Warehouse Native](https://docs.statsig.com/statsig-warehouse-native/introduction/) metrics can only be used in Warehouse Native projects */ class Metric extends pulumi.CustomResource { /** * Get an existing Metric 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 Metric(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Metric. 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'] === Metric.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["customRollUpEnd"] = state ? state.customRollUpEnd : undefined; resourceInputs["customRollUpStart"] = state ? state.customRollUpStart : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["directionality"] = state ? state.directionality : undefined; resourceInputs["dryRun"] = state ? state.dryRun : undefined; resourceInputs["funnelCountDistinct"] = state ? state.funnelCountDistinct : undefined; resourceInputs["funnelEventLists"] = state ? state.funnelEventLists : undefined; resourceInputs["isPermanent"] = state ? state.isPermanent : undefined; resourceInputs["isReadOnly"] = state ? state.isReadOnly : undefined; resourceInputs["isVerified"] = state ? state.isVerified : undefined; resourceInputs["metricComponentMetrics"] = state ? state.metricComponentMetrics : undefined; resourceInputs["metricEvents"] = state ? state.metricEvents : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["rollupTimeWindow"] = state ? state.rollupTimeWindow : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["team"] = state ? state.team : undefined; resourceInputs["teamId"] = state ? state.teamId : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["unitTypes"] = state ? state.unitTypes : undefined; resourceInputs["warehouseNative"] = state ? state.warehouseNative : undefined; } else { const args = argsOrState; if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["customRollUpEnd"] = args ? args.customRollUpEnd : undefined; resourceInputs["customRollUpStart"] = args ? args.customRollUpStart : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["directionality"] = args ? args.directionality : undefined; resourceInputs["dryRun"] = args ? args.dryRun : undefined; resourceInputs["funnelCountDistinct"] = args ? args.funnelCountDistinct : undefined; resourceInputs["funnelEventLists"] = args ? args.funnelEventLists : undefined; resourceInputs["isPermanent"] = args ? args.isPermanent : undefined; resourceInputs["isReadOnly"] = args ? args.isReadOnly : undefined; resourceInputs["isVerified"] = args ? args.isVerified : undefined; resourceInputs["metricComponentMetrics"] = args ? args.metricComponentMetrics : undefined; resourceInputs["metricEvents"] = args ? args.metricEvents : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["rollupTimeWindow"] = args ? args.rollupTimeWindow : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["team"] = args ? args.team : undefined; resourceInputs["teamId"] = args ? args.teamId : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["unitTypes"] = args ? args.unitTypes : undefined; resourceInputs["warehouseNative"] = args ? args.warehouseNative : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Metric.__pulumiType, name, resourceInputs, opts); } } exports.Metric = Metric; /** @internal */ Metric.__pulumiType = 'statsig:index/metric:Metric'; //# sourceMappingURL=metric.js.map