pulumi-stripe
Version:
A Pulumi package for creating and managing Stripe resources.
109 lines • 5.06 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.TaxRate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* With this resource, you can create a tax rate - [Stripe API tax rate documentation](https://stripe.com/docs/api/tax_rates).
*
* Tax rates can be applied to invoices, subscriptions and Checkout Sessions to collect tax.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as stripe from "pulumi-stripe";
*
* const taxRate = new stripe.TaxRate("taxRate", {
* active: true,
* country: "AU",
* description: "GST Australia",
* displayName: "GST",
* inclusive: true,
* jurisdiction: "AU",
* metadata: {},
* percentage: 10,
* state: "",
* taxType: "",
* });
* ```
* <!--End PulumiCodeChooser -->
*/
class TaxRate extends pulumi.CustomResource {
/**
* Get an existing TaxRate 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 TaxRate(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of TaxRate. 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'] === TaxRate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["active"] = state ? state.active : undefined;
resourceInputs["country"] = state ? state.country : undefined;
resourceInputs["created"] = state ? state.created : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["inclusive"] = state ? state.inclusive : undefined;
resourceInputs["jurisdiction"] = state ? state.jurisdiction : undefined;
resourceInputs["livemode"] = state ? state.livemode : undefined;
resourceInputs["metadata"] = state ? state.metadata : undefined;
resourceInputs["object"] = state ? state.object : undefined;
resourceInputs["percentage"] = state ? state.percentage : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["taxType"] = state ? state.taxType : undefined;
}
else {
const args = argsOrState;
if ((!args || args.displayName === undefined) && !opts.urn) {
throw new Error("Missing required property 'displayName'");
}
if ((!args || args.inclusive === undefined) && !opts.urn) {
throw new Error("Missing required property 'inclusive'");
}
if ((!args || args.percentage === undefined) && !opts.urn) {
throw new Error("Missing required property 'percentage'");
}
resourceInputs["active"] = args ? args.active : undefined;
resourceInputs["country"] = args ? args.country : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["inclusive"] = args ? args.inclusive : undefined;
resourceInputs["jurisdiction"] = args ? args.jurisdiction : undefined;
resourceInputs["metadata"] = args ? args.metadata : undefined;
resourceInputs["percentage"] = args ? args.percentage : undefined;
resourceInputs["state"] = args ? args.state : undefined;
resourceInputs["taxType"] = args ? args.taxType : undefined;
resourceInputs["created"] = undefined /*out*/;
resourceInputs["livemode"] = undefined /*out*/;
resourceInputs["object"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(TaxRate.__pulumiType, name, resourceInputs, opts);
}
}
exports.TaxRate = TaxRate;
/** @internal */
TaxRate.__pulumiType = 'stripe:index/taxRate:TaxRate';
//# sourceMappingURL=taxRate.js.map