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 Typescript types #1033

Merged
merged 1 commit into from
Oct 9, 2020
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 types/2020-08-27/CreditNoteLineItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ declare module 'stripe' {
/**
* The amount of discount calculated per discount for this line item
*/
discount_amounts?: Array<CreditNoteLineItem.DiscountAmount>;
discount_amounts: Array<CreditNoteLineItem.DiscountAmount>;

/**
* ID of the invoice line item being credited
Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/CreditNotes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ declare module 'stripe' {
/**
* The aggregate amounts calculated per discount for all line items.
*/
discount_amounts?: Array<CreditNote.DiscountAmount>;
discount_amounts: Array<CreditNote.DiscountAmount>;

/**
* ID of the invoice.
Expand Down
12 changes: 6 additions & 6 deletions types/2020-08-27/Discounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ declare module 'stripe' {
/**
* The ID of the discount object. Discounts cannot be fetched by ID. Use `expand[]=discounts` in API calls to expand discount IDs in an array.
*/
id?: string;
id: string;

/**
* String representing the object's type. Objects of the same type share the same value.
Expand Down Expand Up @@ -42,12 +42,12 @@ declare module 'stripe' {
/**
* The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.
*/
invoice?: string | null;
invoice: string | null;

/**
* The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item.
*/
invoice_item?: string | null;
invoice_item: string | null;

/**
* The promotion code applied to create this discount.
Expand All @@ -72,7 +72,7 @@ declare module 'stripe' {
/**
* The ID of the discount object. Discounts cannot be fetched by ID. Use `expand[]=discounts` in API calls to expand discount IDs in an array.
*/
id?: string;
id: string;

/**
* String representing the object's type. Objects of the same type share the same value.
Expand Down Expand Up @@ -104,12 +104,12 @@ declare module 'stripe' {
/**
* The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.
*/
invoice?: string | null;
invoice: string | null;

/**
* The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item.
*/
invoice_item?: string | null;
invoice_item: string | null;

/**
* The promotion code applied to create this discount.
Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/InvoiceItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ declare module 'stripe' {
/**
* The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
*/
discounts?: Array<string | Stripe.Discount> | null;
discounts: Array<string | Stripe.Discount> | null;

/**
* The ID of the invoice this invoice item belongs to.
Expand Down
7 changes: 5 additions & 2 deletions types/2020-08-27/InvoiceLineItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ declare module 'stripe' {
/**
* The amount of discount calculated per discount for this line item.
*/
discount_amounts?: Array<InvoiceLineItem.DiscountAmount> | null;
discount_amounts: Array<InvoiceLineItem.DiscountAmount> | null;

/**
* If true, discounts will apply to this line item. Always false for prorations.
Expand All @@ -43,7 +43,7 @@ declare module 'stripe' {
/**
* The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
*/
discounts?: Array<string | Stripe.Discount> | null;
discounts: Array<string | Stripe.Discount> | null;

/**
* The ID of the [invoice item](https://stripe.com/docs/api/invoiceitems) associated with this line item if any.
Expand Down Expand Up @@ -171,6 +171,9 @@ declare module 'stripe' {
*/
customer?: string;

/**
* The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. Pass an empty string to avoid inheriting any discounts.
*/
discounts?: Array<InvoiceLineItemListUpcomingParams.Discount> | null;

/**
Expand Down
11 changes: 7 additions & 4 deletions types/2020-08-27/Invoices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ declare module 'stripe' {
description: string | null;

/**
* Describes the current discount applied to this invoice, if there is one.
* Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts.
*/
discount: Stripe.Discount | null;

/**
* The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
*/
discounts?: Array<
discounts: Array<
string | Stripe.Discount | Stripe.DeletedDiscount
> | null;

Expand Down Expand Up @@ -296,7 +296,7 @@ declare module 'stripe' {
/**
* The aggregate amounts calculated per discount across all line items.
*/
total_discount_amounts?: Array<Invoice.TotalDiscountAmount> | null;
total_discount_amounts: Array<Invoice.TotalDiscountAmount> | null;

/**
* The aggregate amounts calculated per tax rate for all line items.
Expand Down Expand Up @@ -894,6 +894,9 @@ declare module 'stripe' {
*/
customer?: string;

/**
* The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. Pass an empty string to avoid inheriting any discounts.
*/
discounts?: Array<InvoiceRetrieveUpcomingParams.Discount> | null;

/**
Expand Down Expand Up @@ -1336,7 +1339,7 @@ declare module 'stripe' {
): Promise<Stripe.Response<Stripe.Invoice>>;

/**
* At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discount that is applicable to the customer.
* At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
*
* Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
*
Expand Down