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 #2072

Merged
merged 14 commits into from May 2, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
@@ -1 +1 @@
v993
v1008
2 changes: 1 addition & 1 deletion types/Apps/Secrets.d.ts
Expand Up @@ -53,7 +53,7 @@ declare module 'stripe' {
/**
* The plaintext secret value to be stored.
*/
payload: string | null;
payload?: string | null;

scope: Secret.Scope;
}
Expand Down
2 changes: 1 addition & 1 deletion types/BillingPortal/Configurations.d.ts
Expand Up @@ -203,7 +203,7 @@ declare module 'stripe' {
/**
* The list of up to 10 products that support subscription updates.
*/
products: Array<SubscriptionUpdate.Product> | null;
products?: Array<SubscriptionUpdate.Product> | null;

/**
* Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. Defaults to a value of `none` if you don't set it during creation.
Expand Down
5 changes: 4 additions & 1 deletion types/Charges.d.ts
Expand Up @@ -191,7 +191,7 @@ declare module 'stripe' {
/**
* A list of refunds that have been applied to the charge.
*/
refunds: ApiList<Stripe.Refund> | null;
refunds?: ApiList<Stripe.Refund> | null;

/**
* ID of the review associated with this charge if one exists.
Expand Down Expand Up @@ -1642,6 +1642,9 @@ declare module 'stripe' {
}

interface Mobilepay {
/**
* Internal card details
*/
card: Mobilepay.Card | null;
}

Expand Down
2 changes: 1 addition & 1 deletion types/ConfirmationTokens.d.ts
Expand Up @@ -847,7 +847,7 @@ declare module 'stripe' {
/**
* The customer's date of birth, if provided.
*/
dob: Klarna.Dob | null;
dob?: Klarna.Dob | null;
}

namespace Klarna {
Expand Down
18 changes: 17 additions & 1 deletion types/Disputes.d.ts
Expand Up @@ -250,10 +250,12 @@ declare module 'stripe' {
interface PaymentMethodDetails {
card?: PaymentMethodDetails.Card;

paypal?: PaymentMethodDetails.Paypal;

/**
* Payment method type.
*/
type: 'card';
type: PaymentMethodDetails.Type;
}

namespace PaymentMethodDetails {
Expand All @@ -268,6 +270,20 @@ declare module 'stripe' {
*/
network_reason_code: string | null;
}

interface Paypal {
/**
* The ID of the dispute in PayPal.
*/
case_id: string | null;

/**
* The reason for the dispute as defined by PayPal
*/
reason_code: string | null;
}

type Type = 'card' | 'paypal';
}

type Status =
Expand Down
2 changes: 1 addition & 1 deletion types/Entitlements/FeaturesResource.d.ts
Expand Up @@ -46,7 +46,7 @@ declare module 'stripe' {
/**
* 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.
*/
metadata?: Stripe.MetadataParam;
metadata?: Stripe.Emptyable<Stripe.MetadataParam>;

/**
* The feature's name, for your own purpose, not meant to be displayable to the customer.
Expand Down
10 changes: 5 additions & 5 deletions types/Identity/VerificationReports.d.ts
Expand Up @@ -95,7 +95,7 @@ declare module 'stripe' {
/**
* Date of birth as it appears in the document.
*/
dob: Document.Dob | null;
dob?: Document.Dob | null;

/**
* Details on the verification error. Present when status is `unverified`.
Expand All @@ -105,7 +105,7 @@ declare module 'stripe' {
/**
* Expiration date of the document.
*/
expiration_date: Document.ExpirationDate | null;
expiration_date?: Document.ExpirationDate | null;

/**
* Array of [File](https://stripe.com/docs/api/files) ids containing images for this document.
Expand Down Expand Up @@ -135,7 +135,7 @@ declare module 'stripe' {
/**
* Document ID number.
*/
number: string | null;
number?: string | null;

/**
* Status of this `document` check.
Expand Down Expand Up @@ -267,7 +267,7 @@ declare module 'stripe' {
/**
* Date of birth.
*/
dob: IdNumber.Dob | null;
dob?: IdNumber.Dob | null;

/**
* Details on the verification error. Present when status is `unverified`.
Expand All @@ -282,7 +282,7 @@ declare module 'stripe' {
/**
* ID number. When `id_number_type` is `us_ssn`, only the last 4 digits are present.
*/
id_number: string | null;
id_number?: string | null;

/**
* Type of ID number.
Expand Down
8 changes: 4 additions & 4 deletions types/Identity/VerificationSessions.d.ts
Expand Up @@ -73,7 +73,7 @@ declare module 'stripe' {
/**
* Details provided about the user being verified. These details may be shown to the user.
*/
provided_details: VerificationSession.ProvidedDetails | null;
provided_details?: VerificationSession.ProvidedDetails | null;

/**
* Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
Expand Down Expand Up @@ -103,7 +103,7 @@ declare module 'stripe' {
/**
* The user's verified data.
*/
verified_outputs: VerificationSession.VerifiedOutputs | null;
verified_outputs?: VerificationSession.VerifiedOutputs | null;
}

namespace VerificationSession {
Expand Down Expand Up @@ -232,7 +232,7 @@ declare module 'stripe' {
/**
* The user's verified date of birth.
*/
dob: VerifiedOutputs.Dob | null;
dob?: VerifiedOutputs.Dob | null;

/**
* The user's verified email address
Expand All @@ -247,7 +247,7 @@ declare module 'stripe' {
/**
* The user's verified id number.
*/
id_number: string | null;
id_number?: string | null;

/**
* The user's verified id number type.
Expand Down
5 changes: 3 additions & 2 deletions types/Invoices.d.ts
Expand Up @@ -343,12 +343,12 @@ declare module 'stripe' {
payment_settings: Invoice.PaymentSettings;

/**
* End of the usage period during which invoice items were added to this invoice.
* End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](https://stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
*/
period_end: number;

/**
* Start of the usage period during which invoice items were added to this invoice.
* Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](https://stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
*/
period_start: number;

Expand Down Expand Up @@ -928,6 +928,7 @@ declare module 'stripe' {
| 'setup_intent_mandate_invalid'
| 'setup_intent_setup_attempt_expired'
| 'setup_intent_unexpected_state'
| 'shipping_address_invalid'
| 'shipping_calculation_failed'
| 'sku_inactive'
| 'state_unsupported'
Expand Down
4 changes: 4 additions & 0 deletions types/InvoicesResource.d.ts
Expand Up @@ -5498,6 +5498,8 @@ declare module 'stripe' {
* 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.
*
* You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
*
* Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
*/
createPreview(
params?: InvoiceCreatePreviewParams,
Expand Down Expand Up @@ -5576,6 +5578,8 @@ declare module 'stripe' {
* 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.
*
* You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
*
* Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
*/
retrieveUpcoming(
params?: InvoiceRetrieveUpcomingParams,
Expand Down
2 changes: 1 addition & 1 deletion types/Issuing/Disputes.d.ts
Expand Up @@ -27,7 +27,7 @@ declare module 'stripe' {
/**
* List of balance transactions associated with the dispute.
*/
balance_transactions: Array<Stripe.BalanceTransaction> | null;
balance_transactions?: Array<Stripe.BalanceTransaction> | null;

/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
Expand Down
2 changes: 1 addition & 1 deletion types/Issuing/Transactions.d.ts
Expand Up @@ -96,7 +96,7 @@ declare module 'stripe' {
/**
* Additional purchase information that is optionally provided by the merchant.
*/
purchase_details: Transaction.PurchaseDetails | null;
purchase_details?: Transaction.PurchaseDetails | null;

/**
* [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. If a network token was not used for this transaction, this field will be null.
Expand Down
1 change: 1 addition & 0 deletions types/PaymentIntents.d.ts
Expand Up @@ -526,6 +526,7 @@ declare module 'stripe' {
| 'setup_intent_mandate_invalid'
| 'setup_intent_setup_attempt_expired'
| 'setup_intent_unexpected_state'
| 'shipping_address_invalid'
| 'shipping_calculation_failed'
| 'sku_inactive'
| 'state_unsupported'
Expand Down
5 changes: 5 additions & 0 deletions types/PaymentIntentsResource.d.ts
Expand Up @@ -4754,6 +4754,11 @@ declare module 'stripe' {
*/
payment_method_options?: PaymentIntentConfirmParams.PaymentMethodOptions;

/**
* The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
*/
payment_method_types?: Array<string>;

/**
* Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
*/
Expand Down
2 changes: 1 addition & 1 deletion types/PaymentMethods.d.ts
Expand Up @@ -775,7 +775,7 @@ declare module 'stripe' {
/**
* The customer's date of birth, if provided.
*/
dob: Klarna.Dob | null;
dob?: Klarna.Dob | null;
}

namespace Klarna {
Expand Down
1 change: 1 addition & 0 deletions types/SetupAttempts.d.ts
Expand Up @@ -769,6 +769,7 @@ declare module 'stripe' {
| 'setup_intent_mandate_invalid'
| 'setup_intent_setup_attempt_expired'
| 'setup_intent_unexpected_state'
| 'shipping_address_invalid'
| 'shipping_calculation_failed'
| 'sku_inactive'
| 'state_unsupported'
Expand Down
1 change: 1 addition & 0 deletions types/SetupIntents.d.ts
Expand Up @@ -439,6 +439,7 @@ declare module 'stripe' {
| 'setup_intent_mandate_invalid'
| 'setup_intent_setup_attempt_expired'
| 'setup_intent_unexpected_state'
| 'shipping_address_invalid'
| 'shipping_calculation_failed'
| 'sku_inactive'
| 'state_unsupported'
Expand Down
2 changes: 1 addition & 1 deletion types/Tax/CalculationLineItems.d.ts
Expand Up @@ -55,7 +55,7 @@ declare module 'stripe' {
/**
* Detailed account of taxes relevant to this line item.
*/
tax_breakdown: Array<CalculationLineItem.TaxBreakdown> | null;
tax_breakdown?: Array<CalculationLineItem.TaxBreakdown> | null;

/**
* The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource.
Expand Down
11 changes: 10 additions & 1 deletion types/Tax/Calculations.d.ts
Expand Up @@ -44,13 +44,18 @@ declare module 'stripe' {
/**
* The list of items the customer is purchasing.
*/
line_items: ApiList<Stripe.Tax.CalculationLineItem> | null;
line_items?: ApiList<Stripe.Tax.CalculationLineItem> | null;

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

/**
* The details of the ship from location, such as the address.
*/
ship_from_details: Calculation.ShipFromDetails | null;

/**
* The shipping cost details for the calculation.
*/
Expand Down Expand Up @@ -202,6 +207,10 @@ declare module 'stripe' {
}
}

interface ShipFromDetails {
address: Stripe.Address;
}

interface ShippingCost {
/**
* The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount.
Expand Down
46 changes: 46 additions & 0 deletions types/Tax/CalculationsResource.d.ts
Expand Up @@ -29,6 +29,11 @@ declare module 'stripe' {
*/
expand?: Array<string>;

/**
* Details about the address from which the goods are being shipped.
*/
ship_from_details?: CalculationCreateParams.ShipFromDetails;

/**
* Shipping cost details to be used for the calculation.
*/
Expand Down Expand Up @@ -235,6 +240,47 @@ declare module 'stripe' {
type TaxBehavior = 'exclusive' | 'inclusive';
}

interface ShipFromDetails {
/**
* The address from which the goods are being shipped from.
*/
address: ShipFromDetails.Address;
}

namespace ShipFromDetails {
interface Address {
/**
* City, district, suburb, town, or village.
*/
city?: Stripe.Emptyable<string>;

/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country: string;

/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: Stripe.Emptyable<string>;

/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: Stripe.Emptyable<string>;

/**
* ZIP or postal code.
*/
postal_code?: Stripe.Emptyable<string>;

/**
* State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX".
*/
state?: Stripe.Emptyable<string>;
}
}

interface ShippingCost {
/**
* A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) representing the shipping charge. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount.
Expand Down