pulumi-stripe
Version:
A Pulumi package for creating and managing Stripe resources.
117 lines • 4.67 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.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
*
* ```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",
* },
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import stripe:index/customer:Customer customer <customer_id>
* ```
*/
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, { ...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?.address;
resourceInputs["balance"] = state?.balance;
resourceInputs["defaultInvoicePrefix"] = state?.defaultInvoicePrefix;
resourceInputs["description"] = state?.description;
resourceInputs["email"] = state?.email;
resourceInputs["invoicePrefix"] = state?.invoicePrefix;
resourceInputs["invoiceSettings"] = state?.invoiceSettings;
resourceInputs["metadata"] = state?.metadata;
resourceInputs["name"] = state?.name;
resourceInputs["nextInvoiceSequence"] = state?.nextInvoiceSequence;
resourceInputs["phone"] = state?.phone;
resourceInputs["preferredLocales"] = state?.preferredLocales;
resourceInputs["shipping"] = state?.shipping;
}
else {
const args = argsOrState;
resourceInputs["address"] = args?.address;
resourceInputs["balance"] = args?.balance;
resourceInputs["description"] = args?.description;
resourceInputs["email"] = args?.email;
resourceInputs["invoicePrefix"] = args?.invoicePrefix;
resourceInputs["invoiceSettings"] = args?.invoiceSettings;
resourceInputs["metadata"] = args?.metadata;
resourceInputs["name"] = args?.name;
resourceInputs["nextInvoiceSequence"] = args?.nextInvoiceSequence;
resourceInputs["phone"] = args?.phone;
resourceInputs["preferredLocales"] = args?.preferredLocales;
resourceInputs["shipping"] = args?.shipping;
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