// *** 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! *** import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./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 * * ```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: "", * }); * ``` * * ## Import * * ```sh * $ pulumi import stripe:index/taxRate:TaxRate rate * ``` */ export 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. */ public static get(name: string, id: pulumi.Input, state?: TaxRateState, opts?: pulumi.CustomResourceOptions): TaxRate { return new TaxRate(name, state, { ...opts, id: id }); } /** @internal */ public static readonly __pulumiType = 'stripe:index/taxRate:TaxRate'; /** * 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. */ public static isInstance(obj: any): obj is TaxRate { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === TaxRate.__pulumiType; } /** * Bool. Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. */ public readonly active!: pulumi.Output; /** * String. Two-letter country code (ISO 3166-1 alpha-2). */ public readonly country!: pulumi.Output; /** * Int. Time at which the object was created. Measured in seconds since the Unix epoch. */ public /*out*/ readonly created!: pulumi.Output; /** * String. An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. */ public readonly description!: pulumi.Output; /** * String. The display name of the tax rate, which will be shown to users. */ public readonly displayName!: pulumi.Output; /** * Bool. This specifies if the tax rate is inclusive or exclusive. * * `percentage ` - (Required) Float. This represents the tax rate percent out of 100. */ public readonly inclusive!: pulumi.Output; /** * String. The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. */ public readonly jurisdiction!: pulumi.Output; /** * Bool. Has the value true if the object exists in live mode or the value false if the object exists in test mode. */ public /*out*/ readonly livemode!: pulumi.Output; /** * Map(String). Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata. */ public readonly metadata!: pulumi.Output<{[key: string]: string} | undefined>; /** * String. String representing the object’s type. Objects of the same type share the same value. */ public /*out*/ readonly object!: pulumi.Output; /** * This represents the tax rate percent out of 100. */ public readonly percentage!: pulumi.Output; /** * String. ISO 3166-2 subdivision code, without country prefix. For example, “NY” for New York, United States. */ public readonly state!: pulumi.Output; /** * String. The high-level tax type, such as vat or sales_tax. */ public readonly taxType!: pulumi.Output; /** * Create a TaxRate resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: TaxRateArgs, opts?: pulumi.CustomResourceOptions) constructor(name: string, argsOrState?: TaxRateArgs | TaxRateState, opts?: pulumi.CustomResourceOptions) { let resourceInputs: pulumi.Inputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState as TaxRateState | undefined; 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 as TaxRateArgs | undefined; 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); } } /** * Input properties used for looking up and filtering TaxRate resources. */ export interface TaxRateState { /** * Bool. Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. */ active?: pulumi.Input; /** * String. Two-letter country code (ISO 3166-1 alpha-2). */ country?: pulumi.Input; /** * Int. Time at which the object was created. Measured in seconds since the Unix epoch. */ created?: pulumi.Input; /** * String. An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. */ description?: pulumi.Input; /** * String. The display name of the tax rate, which will be shown to users. */ displayName?: pulumi.Input; /** * Bool. This specifies if the tax rate is inclusive or exclusive. * * `percentage ` - (Required) Float. This represents the tax rate percent out of 100. */ inclusive?: pulumi.Input; /** * String. The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. */ jurisdiction?: pulumi.Input; /** * Bool. Has the value true if the object exists in live mode or the value false if the object exists in test mode. */ livemode?: pulumi.Input; /** * Map(String). Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata. */ metadata?: pulumi.Input<{[key: string]: pulumi.Input}>; /** * String. String representing the object’s type. Objects of the same type share the same value. */ object?: pulumi.Input; /** * This represents the tax rate percent out of 100. */ percentage?: pulumi.Input; /** * String. ISO 3166-2 subdivision code, without country prefix. For example, “NY” for New York, United States. */ state?: pulumi.Input; /** * String. The high-level tax type, such as vat or sales_tax. */ taxType?: pulumi.Input; } /** * The set of arguments for constructing a TaxRate resource. */ export interface TaxRateArgs { /** * Bool. Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. */ active?: pulumi.Input; /** * String. Two-letter country code (ISO 3166-1 alpha-2). */ country?: pulumi.Input; /** * String. An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. */ description?: pulumi.Input; /** * String. The display name of the tax rate, which will be shown to users. */ displayName: pulumi.Input; /** * Bool. This specifies if the tax rate is inclusive or exclusive. * * `percentage ` - (Required) Float. This represents the tax rate percent out of 100. */ inclusive: pulumi.Input; /** * String. The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. */ jurisdiction?: pulumi.Input; /** * Map(String). Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata. */ metadata?: pulumi.Input<{[key: string]: pulumi.Input}>; /** * This represents the tax rate percent out of 100. */ percentage: pulumi.Input; /** * String. ISO 3166-2 subdivision code, without country prefix. For example, “NY” for New York, United States. */ state?: pulumi.Input; /** * String. The high-level tax type, such as vat or sales_tax. */ taxType?: pulumi.Input; }