pulumi-stripe
Version:
A Pulumi package for creating and managing Stripe resources.
86 lines • 3.64 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.EntitlementsFeature = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* With this resource, you can create Entitlements Feature for your products - [Stripe API entitlements feature documentation](https://docs.stripe.com/api/entitlements/feature)
*
* Entitlements Features can be assigned to products, and when those products are purchased,
* Stripe will create an entitlement to the feature for the purchasing customer.
*
* > Removal of the Entitlements Feature isn't supported through the Stripe API.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as stripe from "pulumi-stripe";
*
* // Entitlements Feature
* const feature = new stripe.EntitlementsFeature("feature", {lookupKey: "key"});
* ```
*
* ## Import
*
* ```sh
* $ pulumi import stripe:index/entitlementsFeature:EntitlementsFeature feature <feature_id>
* ```
*/
class EntitlementsFeature extends pulumi.CustomResource {
/**
* Get an existing EntitlementsFeature 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 EntitlementsFeature(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of EntitlementsFeature. 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'] === EntitlementsFeature.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["active"] = state?.active;
resourceInputs["livemode"] = state?.livemode;
resourceInputs["lookupKey"] = state?.lookupKey;
resourceInputs["metadata"] = state?.metadata;
resourceInputs["name"] = state?.name;
resourceInputs["object"] = state?.object;
}
else {
const args = argsOrState;
if (args?.lookupKey === undefined && !opts.urn) {
throw new Error("Missing required property 'lookupKey'");
}
resourceInputs["lookupKey"] = args?.lookupKey;
resourceInputs["metadata"] = args?.metadata;
resourceInputs["name"] = args?.name;
resourceInputs["active"] = undefined /*out*/;
resourceInputs["livemode"] = undefined /*out*/;
resourceInputs["object"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(EntitlementsFeature.__pulumiType, name, resourceInputs, opts);
}
}
exports.EntitlementsFeature = EntitlementsFeature;
/** @internal */
EntitlementsFeature.__pulumiType = 'stripe:index/entitlementsFeature:EntitlementsFeature';
//# sourceMappingURL=entitlementsFeature.js.map