Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code #2171

Merged
merged 8 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1246
v1260
1 change: 1 addition & 0 deletions src/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export {ExchangeRates} from './resources/ExchangeRates.js';
export {FileLinks} from './resources/FileLinks.js';
export {Files} from './resources/Files.js';
export {InvoiceItems} from './resources/InvoiceItems.js';
export {InvoiceRenderingTemplates} from './resources/InvoiceRenderingTemplates.js';
export {Invoices} from './resources/Invoices.js';
export {Mandates} from './resources/Mandates.js';
export {OAuth} from './resources/OAuth.js';
Expand Down
23 changes: 23 additions & 0 deletions src/resources/InvoiceRenderingTemplates.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// File generated from our OpenAPI spec

import {StripeResource} from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const InvoiceRenderingTemplates = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/invoice_rendering_templates/{template}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/invoice_rendering_templates',
methodType: 'list',
}),
archive: stripeMethod({
method: 'POST',
fullPath: '/v1/invoice_rendering_templates/{template}/archive',
}),
unarchive: stripeMethod({
method: 'POST',
fullPath: '/v1/invoice_rendering_templates/{template}/unarchive',
}),
});
2 changes: 1 addition & 1 deletion test/resources/generated_examples_test.spec.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions types/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2026,6 +2026,15 @@ declare module 'stripe' {
* Indicates whether tax ID collection is enabled for the session
*/
enabled: boolean;

/**
* Indicates whether a tax ID is required on the payment page
*/
required: TaxIdCollection.Required;
}

namespace TaxIdCollection {
type Required = 'if_supported' | 'never';
}

interface TotalDetails {
Expand Down
9 changes: 9 additions & 0 deletions types/Checkout/SessionsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2478,6 +2478,15 @@ declare module 'stripe' {
* Enable tax ID collection during checkout. Defaults to `false`.
*/
enabled: boolean;

/**
* Describes whether a tax ID is required during checkout. Defaults to `never`.
*/
required?: TaxIdCollection.Required;
}

namespace TaxIdCollection {
type Required = 'if_supported' | 'never';
}

type UiMode = 'embedded' | 'hosted';
Expand Down
5 changes: 5 additions & 0 deletions types/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ declare module 'stripe' {
* How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
*/
amount_tax_display: string | null;

/**
* ID of the invoice rendering template to be used for this customer's invoices. If set, the template will be used on all invoices for this customer unless a template is set directly on the invoice.
*/
template: string | null;
}
}

Expand Down
10 changes: 10 additions & 0 deletions types/CustomersResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ declare module 'stripe' {
amount_tax_display?: Stripe.Emptyable<
RenderingOptions.AmountTaxDisplay
>;

/**
* ID of the invoice rendering template to use for future invoices.
*/
template?: string;
}

namespace RenderingOptions {
Expand Down Expand Up @@ -477,6 +482,11 @@ declare module 'stripe' {
amount_tax_display?: Stripe.Emptyable<
RenderingOptions.AmountTaxDisplay
>;

/**
* ID of the invoice rendering template to use for future invoices.
*/
template?: string;
}

namespace RenderingOptions {
Expand Down
4 changes: 2 additions & 2 deletions types/InvoiceLineItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ declare module 'stripe' {
/**
* The amount of tax calculated per tax rate for this line item
*/
tax_amounts?: Array<InvoiceLineItem.TaxAmount>;
tax_amounts: Array<InvoiceLineItem.TaxAmount>;

/**
* The tax rates which apply to the line item.
*/
tax_rates?: Array<Stripe.TaxRate>;
tax_rates: Array<Stripe.TaxRate>;

/**
* A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`.
Expand Down
54 changes: 54 additions & 0 deletions types/InvoiceRenderingTemplates.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// File generated from our OpenAPI spec

declare module 'stripe' {
namespace Stripe {
/**
* The InvoiceRenderingTemplate object.
*/
interface InvoiceRenderingTemplate {
/**
* Unique identifier for the object.
*/
id: string;

/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'invoice_rendering_template';

/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;

/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata: Stripe.Metadata | null;

/**
* A brief description of the template, hidden from customers
*/
nickname: string | null;

/**
* The status of the template, one of `active` or `archived`.
*/
status: InvoiceRenderingTemplate.Status;

/**
* Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering
*/
version: number;
}

namespace InvoiceRenderingTemplate {
type Status = 'active' | 'archived';
}
}
}
93 changes: 93 additions & 0 deletions types/InvoiceRenderingTemplatesResource.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
// File generated from our OpenAPI spec

declare module 'stripe' {
namespace Stripe {
interface InvoiceRenderingTemplateRetrieveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;

version?: number;
}

interface InvoiceRenderingTemplateListParams extends PaginationParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;

status?: InvoiceRenderingTemplateListParams.Status;
}

namespace InvoiceRenderingTemplateListParams {
type Status = 'active' | 'archived';
}

interface InvoiceRenderingTemplateArchiveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}

interface InvoiceRenderingTemplateUnarchiveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}

class InvoiceRenderingTemplatesResource {
/**
* Retrieves an invoice rendering template with the given ID. It by default returns the latest version of the template. Optionally, specify a version to see previous versions.
*/
retrieve(
id: string,
params?: InvoiceRenderingTemplateRetrieveParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.InvoiceRenderingTemplate>>;
retrieve(
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.InvoiceRenderingTemplate>>;

/**
* List all templates, ordered by creation date, with the most recently created template appearing first.
*/
list(
params?: InvoiceRenderingTemplateListParams,
options?: RequestOptions
): ApiListPromise<Stripe.InvoiceRenderingTemplate>;
list(
options?: RequestOptions
): ApiListPromise<Stripe.InvoiceRenderingTemplate>;

/**
* Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it.
*/
archive(
id: string,
params?: InvoiceRenderingTemplateArchiveParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.InvoiceRenderingTemplate>>;
archive(
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.InvoiceRenderingTemplate>>;

/**
* Unarchive an invoice rendering template so it can be used on new Stripe objects again.
*/
unarchive(
id: string,
params?: InvoiceRenderingTemplateUnarchiveParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.InvoiceRenderingTemplate>>;
unarchive(
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.InvoiceRenderingTemplate>>;
}
}
}
10 changes: 10 additions & 0 deletions types/Invoices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,16 @@ declare module 'stripe' {
* Invoice pdf rendering options
*/
pdf: Rendering.Pdf | null;

/**
* ID of the rendering template that the invoice is formatted by.
*/
template: string | null;

/**
* Version of the rendering template that the invoice is using.
*/
template_version: number | null;
}

namespace Rendering {
Expand Down
20 changes: 20 additions & 0 deletions types/InvoicesResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,16 @@ declare module 'stripe' {
* Invoice pdf rendering options
*/
pdf?: Rendering.Pdf;

/**
* ID of the invoice rendering template to use for this invoice.
*/
template?: string;

/**
* The specific version of invoice rendering template to use for this invoice.
*/
template_version?: Stripe.Emptyable<number>;
}

namespace Rendering {
Expand Down Expand Up @@ -1231,6 +1241,16 @@ declare module 'stripe' {
* Invoice pdf rendering options
*/
pdf?: Rendering.Pdf;

/**
* ID of the invoice rendering template to use for this invoice.
*/
template?: string;

/**
* The specific version of invoice rendering template to use for this invoice.
*/
template_version?: Stripe.Emptyable<number>;
}

namespace Rendering {
Expand Down
3 changes: 2 additions & 1 deletion types/Issuing/Cards.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ declare module 'stripe' {
| 'failure'
| 'pending'
| 'returned'
| 'shipped';
| 'shipped'
| 'submitted';

type Type = 'bulk' | 'individual';
}
Expand Down
6 changes: 6 additions & 0 deletions types/PaymentLinks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,12 @@ declare module 'stripe' {
* Indicates whether tax ID collection is enabled for the session.
*/
enabled: boolean;

required: TaxIdCollection.Required;
}

namespace TaxIdCollection {
type Required = 'if_supported' | 'never';
}

interface TransferData {
Expand Down
18 changes: 18 additions & 0 deletions types/PaymentLinksResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,15 @@ declare module 'stripe' {
* Enable tax ID collection during checkout. Defaults to `false`.
*/
enabled: boolean;

/**
* Describes whether a tax ID is required during checkout. Defaults to `never`.
*/
required?: TaxIdCollection.Required;
}

namespace TaxIdCollection {
type Required = 'if_supported' | 'never';
}

interface TransferData {
Expand Down Expand Up @@ -1881,6 +1890,15 @@ declare module 'stripe' {
* Enable tax ID collection during checkout. Defaults to `false`.
*/
enabled: boolean;

/**
* Describes whether a tax ID is required during checkout. Defaults to `never`.
*/
required?: TaxIdCollection.Required;
}

namespace TaxIdCollection {
type Required = 'if_supported' | 'never';
}
}

Expand Down
4 changes: 2 additions & 2 deletions types/QuotesResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ declare module 'stripe' {
description?: Stripe.Emptyable<string>;

/**
* The discounts applied to the quote. You can only set up to one discount.
* The discounts applied to the quote.
*/
discounts?: Stripe.Emptyable<Array<QuoteCreateParams.Discount>>;

Expand Down Expand Up @@ -378,7 +378,7 @@ declare module 'stripe' {
description?: Stripe.Emptyable<string>;

/**
* The discounts applied to the quote. You can only set up to one discount.
* The discounts applied to the quote.
*/
discounts?: Stripe.Emptyable<Array<QuoteUpdateParams.Discount>>;

Expand Down
Loading
Loading