UNPKG

pulumi-statuspage

Version:

A Pulumi package for creating and managing statuspage cloud resources.

93 lines 4.55 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.MetricsProvider = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as statuspage from "pulumi-statuspage"; * * const statuspagePingdom = new statuspage.MetricsProvider("statuspagePingdom", { * apiToken: "a-pingdom-api-token", * pageId: "pageid", * type: "Pingdom", * }); * ``` * * ## Import * * `statuspage_metrics_provider` can be imported using the ID of the metrics provider, e.g. * * ```sh * $ pulumi import statuspage:index/metricsProvider:MetricsProvider statuspage_pingdom my-page-id/my-metrics-provider-id * ``` */ class MetricsProvider extends pulumi.CustomResource { /** * Get an existing MetricsProvider 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 MetricsProvider(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MetricsProvider. 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'] === MetricsProvider.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["apiKey"] = state ? state.apiKey : undefined; resourceInputs["apiToken"] = state ? state.apiToken : undefined; resourceInputs["applicationKey"] = state ? state.applicationKey : undefined; resourceInputs["email"] = state ? state.email : undefined; resourceInputs["metricBaseUri"] = state ? state.metricBaseUri : undefined; resourceInputs["pageId"] = state ? state.pageId : undefined; resourceInputs["password"] = state ? state.password : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.pageId === undefined) && !opts.urn) { throw new Error("Missing required property 'pageId'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["apiKey"] = (args === null || args === void 0 ? void 0 : args.apiKey) ? pulumi.secret(args.apiKey) : undefined; resourceInputs["apiToken"] = (args === null || args === void 0 ? void 0 : args.apiToken) ? pulumi.secret(args.apiToken) : undefined; resourceInputs["applicationKey"] = (args === null || args === void 0 ? void 0 : args.applicationKey) ? pulumi.secret(args.applicationKey) : undefined; resourceInputs["email"] = args ? args.email : undefined; resourceInputs["metricBaseUri"] = args ? args.metricBaseUri : undefined; resourceInputs["pageId"] = args ? args.pageId : undefined; resourceInputs["password"] = (args === null || args === void 0 ? void 0 : args.password) ? pulumi.secret(args.password) : undefined; resourceInputs["type"] = args ? args.type : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["apiKey", "apiToken", "applicationKey", "password"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(MetricsProvider.__pulumiType, name, resourceInputs, opts); } } exports.MetricsProvider = MetricsProvider; /** @internal */ MetricsProvider.__pulumiType = 'statuspage:index/metricsProvider:MetricsProvider'; //# sourceMappingURL=metricsProvider.js.map