pulumi-stripe
Version:
A Pulumi package for creating and managing Stripe resources.
101 lines • 4.3 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.Product = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* With this resource, you can create a product - [Stripe API product documentation](https://stripe.com/docs/api/products).
*
* Products describe the specific goods or services you offer to your customers. For example,
* you might offer a Standard and Premium version of your goods or service; each version would be a separate Product.
*
* > Deleting a product is only possible if it has no prices associated with it.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as stripe from "pulumi-stripe";
*
* // The product with more fields filled
* const product = new stripe.Product("product", {
* description: "fantastic product",
* unitLabel: "piece",
* url: "https://www.terraform.io",
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import stripe:index/product:Product product <product_id>
* ```
*/
class Product extends pulumi.CustomResource {
/**
* Get an existing Product 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 Product(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Product. 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'] === Product.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["active"] = state?.active;
resourceInputs["description"] = state?.description;
resourceInputs["images"] = state?.images;
resourceInputs["marketingFeatures"] = state?.marketingFeatures;
resourceInputs["metadata"] = state?.metadata;
resourceInputs["name"] = state?.name;
resourceInputs["packageDimensions"] = state?.packageDimensions;
resourceInputs["productId"] = state?.productId;
resourceInputs["shippable"] = state?.shippable;
resourceInputs["statementDescriptor"] = state?.statementDescriptor;
resourceInputs["taxCode"] = state?.taxCode;
resourceInputs["unitLabel"] = state?.unitLabel;
resourceInputs["url"] = state?.url;
}
else {
const args = argsOrState;
resourceInputs["active"] = args?.active;
resourceInputs["description"] = args?.description;
resourceInputs["images"] = args?.images;
resourceInputs["marketingFeatures"] = args?.marketingFeatures;
resourceInputs["metadata"] = args?.metadata;
resourceInputs["name"] = args?.name;
resourceInputs["packageDimensions"] = args?.packageDimensions;
resourceInputs["productId"] = args?.productId;
resourceInputs["shippable"] = args?.shippable;
resourceInputs["statementDescriptor"] = args?.statementDescriptor;
resourceInputs["taxCode"] = args?.taxCode;
resourceInputs["unitLabel"] = args?.unitLabel;
resourceInputs["url"] = args?.url;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Product.__pulumiType, name, resourceInputs, opts);
}
}
exports.Product = Product;
/** @internal */
Product.__pulumiType = 'stripe:index/product:Product';
//# sourceMappingURL=product.js.map