pulumi-statuspage
Version:
A Pulumi package for creating and managing statuspage cloud resources.
77 lines • 4.14 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.Metric = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
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["decimalPlaces"] = state ? state.decimalPlaces : undefined;
resourceInputs["display"] = state ? state.display : undefined;
resourceInputs["metricIdentifier"] = state ? state.metricIdentifier : undefined;
resourceInputs["metricsProviderId"] = state ? state.metricsProviderId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["pageId"] = state ? state.pageId : undefined;
resourceInputs["suffix"] = state ? state.suffix : undefined;
resourceInputs["tooltipDescription"] = state ? state.tooltipDescription : undefined;
resourceInputs["transform"] = state ? state.transform : undefined;
resourceInputs["yAxisHidden"] = state ? state.yAxisHidden : undefined;
resourceInputs["yAxisMax"] = state ? state.yAxisMax : undefined;
resourceInputs["yAxisMin"] = state ? state.yAxisMin : undefined;
}
else {
const args = argsOrState;
if ((!args || args.metricsProviderId === undefined) && !opts.urn) {
throw new Error("Missing required property 'metricsProviderId'");
}
if ((!args || args.pageId === undefined) && !opts.urn) {
throw new Error("Missing required property 'pageId'");
}
resourceInputs["decimalPlaces"] = args ? args.decimalPlaces : undefined;
resourceInputs["display"] = args ? args.display : undefined;
resourceInputs["metricIdentifier"] = args ? args.metricIdentifier : undefined;
resourceInputs["metricsProviderId"] = args ? args.metricsProviderId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["pageId"] = args ? args.pageId : undefined;
resourceInputs["suffix"] = args ? args.suffix : undefined;
resourceInputs["tooltipDescription"] = args ? args.tooltipDescription : undefined;
resourceInputs["transform"] = args ? args.transform : undefined;
resourceInputs["yAxisHidden"] = args ? args.yAxisHidden : undefined;
resourceInputs["yAxisMax"] = args ? args.yAxisMax : undefined;
resourceInputs["yAxisMin"] = args ? args.yAxisMin : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Metric.__pulumiType, name, resourceInputs, opts);
}
}
exports.Metric = Metric;
/** @internal */
Metric.__pulumiType = 'statuspage:index/metric:Metric';
//# sourceMappingURL=metric.js.map