pulumi-stripe
Version:
A Pulumi package for creating and managing Stripe resources.
154 lines • 5.98 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.PortalConfiguration = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* With this resource, you can create a Customer Portal Configuration - [Stripe API portal configuration documentation](https://stripe.com/docs/api/customer_portal/configuration).
*
* The Billing customer portal is a Stripe-hosted UI for subscription and billing management.
*
* A portal configuration describes the functionality and features that you want to provide to your customers through the portal.
*
* > Removal of the Customer Portal isn't supported through the Stripe API.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as stripe from "pulumi-stripe";
*
* // A billing portal using all the available options
* const portalConfiguration = new stripe.PortalConfiguration("portalConfiguration", {
* businessProfile: {
* headline: "My special headline",
* privacyPolicyUrl: "https://example.com/privacy",
* termsOfServiceUrl: "https://example.com/terms",
* },
* defaultReturnUrl: "https://example.com/special_headline",
* features: {
* customerUpdate: {
* allowedUpdates: [
* "email",
* "address",
* "shipping",
* "phone",
* "tax_id",
* ],
* enabled: true,
* },
* invoiceHistory: {
* enabled: true,
* },
* paymentMethodUpdate: {
* enabled: true,
* },
* subscriptionCancel: {
* cancellationReason: {
* enabled: true,
* options: [
* "too_expensive",
* "missing_features",
* "switched_service",
* "unused",
* "customer_service",
* "too_complex",
* "low_quality",
* "other",
* ],
* },
* enabled: true,
* mode: "at_period_end",
* prorationBehavior: "none",
* },
* subscriptionUpdates: [{
* defaultAllowedUpdates: [
* "price",
* "quantity",
* "promotion_code",
* ],
* enabled: true,
* products: [{
* prices: [
* "my_price_id1",
* "my_price_id2",
* ],
* product: "my_product_id",
* }],
* prorationBehavior: "none",
* }],
* },
* metadata: {
* foo: "bar",
* },
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import stripe:index/portalConfiguration:PortalConfiguration configuration <portal_configuration_id>
* ```
*/
class PortalConfiguration extends pulumi.CustomResource {
/**
* Get an existing PortalConfiguration 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 PortalConfiguration(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of PortalConfiguration. 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'] === PortalConfiguration.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["active"] = state?.active;
resourceInputs["businessProfile"] = state?.businessProfile;
resourceInputs["defaultReturnUrl"] = state?.defaultReturnUrl;
resourceInputs["features"] = state?.features;
resourceInputs["isDefault"] = state?.isDefault;
resourceInputs["loginPage"] = state?.loginPage;
resourceInputs["metadata"] = state?.metadata;
}
else {
const args = argsOrState;
if (args?.businessProfile === undefined && !opts.urn) {
throw new Error("Missing required property 'businessProfile'");
}
if (args?.features === undefined && !opts.urn) {
throw new Error("Missing required property 'features'");
}
resourceInputs["active"] = args?.active;
resourceInputs["businessProfile"] = args?.businessProfile;
resourceInputs["defaultReturnUrl"] = args?.defaultReturnUrl;
resourceInputs["features"] = args?.features;
resourceInputs["loginPage"] = args?.loginPage;
resourceInputs["metadata"] = args?.metadata;
resourceInputs["isDefault"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(PortalConfiguration.__pulumiType, name, resourceInputs, opts);
}
}
exports.PortalConfiguration = PortalConfiguration;
/** @internal */
PortalConfiguration.__pulumiType = 'stripe:index/portalConfiguration:PortalConfiguration';
//# sourceMappingURL=portalConfiguration.js.map