pulumi-stripe
Version:
A Pulumi package for creating and managing Stripe resources.
113 lines • 5.14 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.Customer = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* With this resource, you can create a customer - [Stripe API customer documentation](https://stripe.com/docs/api/customers).
*
* Customer objects allow you to perform recurring charges, and to track multiple charges,
* that are associated with the same customer.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as stripe from "pulumi-stripe";
*
* // A customer with other details
* const customer = new stripe.Customer("customer", {
* balance: 10000,
* invoicePrefix: "LA000",
* invoiceSettings: {
* customFieldName: "customFieldValue",
* footer: "--- Lukas Aron ---",
* },
* nextInvoiceSequence: 1001,
* preferredLocales: [
* "eng",
* "esp",
* ],
* shipping: {
* city: "Sydney",
* country: "AU",
* line1: "1 The Best Street",
* line2: "Apartment 401",
* name: "Lukas Aron",
* phone: "+610123456789",
* postal_code: "2000",
* state: "New South Wales",
* },
* });
* ```
* <!--End PulumiCodeChooser -->
*/
class Customer extends pulumi.CustomResource {
/**
* Get an existing Customer 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 Customer(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Customer. 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'] === Customer.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["address"] = state ? state.address : undefined;
resourceInputs["balance"] = state ? state.balance : undefined;
resourceInputs["defaultInvoicePrefix"] = state ? state.defaultInvoicePrefix : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["email"] = state ? state.email : undefined;
resourceInputs["invoicePrefix"] = state ? state.invoicePrefix : undefined;
resourceInputs["invoiceSettings"] = state ? state.invoiceSettings : undefined;
resourceInputs["metadata"] = state ? state.metadata : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["nextInvoiceSequence"] = state ? state.nextInvoiceSequence : undefined;
resourceInputs["phone"] = state ? state.phone : undefined;
resourceInputs["preferredLocales"] = state ? state.preferredLocales : undefined;
resourceInputs["shipping"] = state ? state.shipping : undefined;
}
else {
const args = argsOrState;
resourceInputs["address"] = args ? args.address : undefined;
resourceInputs["balance"] = args ? args.balance : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["email"] = args ? args.email : undefined;
resourceInputs["invoicePrefix"] = args ? args.invoicePrefix : undefined;
resourceInputs["invoiceSettings"] = args ? args.invoiceSettings : undefined;
resourceInputs["metadata"] = args ? args.metadata : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["nextInvoiceSequence"] = args ? args.nextInvoiceSequence : undefined;
resourceInputs["phone"] = args ? args.phone : undefined;
resourceInputs["preferredLocales"] = args ? args.preferredLocales : undefined;
resourceInputs["shipping"] = args ? args.shipping : undefined;
resourceInputs["defaultInvoicePrefix"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Customer.__pulumiType, name, resourceInputs, opts);
}
}
exports.Customer = Customer;
/** @internal */
Customer.__pulumiType = 'stripe:index/customer:Customer';
//# sourceMappingURL=customer.js.map