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

Merged
merged 17 commits into from
Aug 8, 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 @@
v1169
v1189
2 changes: 2 additions & 0 deletions src/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import {resourceNamespace} from './ResourceNamespace.js';
import {Accounts as FinancialConnectionsAccounts} from './resources/FinancialConnections/Accounts.js';
import {ActiveEntitlements as EntitlementsActiveEntitlements} from './resources/Entitlements/ActiveEntitlements.js';
import {Alerts as BillingAlerts} from './resources/Billing/Alerts.js';
import {Authorizations as TestHelpersIssuingAuthorizations} from './resources/TestHelpers/Issuing/Authorizations.js';
import {Authorizations as IssuingAuthorizations} from './resources/Issuing/Authorizations.js';
import {Calculations as TaxCalculations} from './resources/Tax/Calculations.js';
Expand Down Expand Up @@ -119,6 +120,7 @@ export {Transfers} from './resources/Transfers.js';
export {WebhookEndpoints} from './resources/WebhookEndpoints.js';
export const Apps = resourceNamespace('apps', {Secrets: AppsSecrets});
export const Billing = resourceNamespace('billing', {
Alerts: BillingAlerts,
MeterEventAdjustments: BillingMeterEventAdjustments,
MeterEvents: BillingMeterEvents,
Meters: BillingMeters,
Expand Down
25 changes: 25 additions & 0 deletions src/resources/Billing/Alerts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// File generated from our OpenAPI spec

import {StripeResource} from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Alerts = StripeResource.extend({
create: stripeMethod({method: 'POST', fullPath: '/v1/billing/alerts'}),
retrieve: stripeMethod({method: 'GET', fullPath: '/v1/billing/alerts/{id}'}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/billing/alerts',
methodType: 'list',
}),
activate: stripeMethod({
method: 'POST',
fullPath: '/v1/billing/alerts/{id}/activate',
}),
archive: stripeMethod({
method: 'POST',
fullPath: '/v1/billing/alerts/{id}/archive',
}),
deactivate: stripeMethod({
method: 'POST',
fullPath: '/v1/billing/alerts/{id}/deactivate',
}),
});
4 changes: 4 additions & 0 deletions src/resources/Tax/Calculations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import {StripeResource} from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Calculations = StripeResource.extend({
create: stripeMethod({method: 'POST', fullPath: '/v1/tax/calculations'}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/tax/calculations/{calculation}',
}),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/tax/calculations/{calculation}/line_items',
Expand Down
2 changes: 1 addition & 1 deletion test/resources/generated_examples_test.spec.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions types/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1316,22 +1316,22 @@ declare module 'stripe' {
statement_descriptor: string | null;

/**
* The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only)
* The Kana variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors).
*/
statement_descriptor_kana: string | null;

/**
* The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only)
* The Kanji variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors).
*/
statement_descriptor_kanji: string | null;

/**
* The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion.
* The Kana variation of `statement_descriptor_prefix` used for card charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors).
*/
statement_descriptor_prefix_kana: string | null;

/**
* The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion.
* The Kanji variation of `statement_descriptor_prefix` used for card charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors).
*/
statement_descriptor_prefix_kanji: string | null;
}
Expand Down
12 changes: 6 additions & 6 deletions types/AccountsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1441,17 +1441,17 @@ declare module 'stripe' {

interface Payments {
/**
* The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge.
* The default text that appears on statements for non-card charges outside of Japan. For card charges, if you don't set a `statement_descriptor_prefix`, this text is also used as the statement descriptor prefix. In that case, if concatenating the statement descriptor suffix causes the combined statement descriptor to exceed 22 characters, we truncate the `statement_descriptor` text to limit the full descriptor to 22 characters. For more information about statement descriptors and their requirements, see the [account settings documentation](https://docs.stripe.com/get-started/account/statement-descriptors).
*/
statement_descriptor?: string;

/**
* The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only).
* The Kana variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors).
*/
statement_descriptor_kana?: string;

/**
* The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only).
* The Kanji variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors).
*/
statement_descriptor_kanji?: string;
}
Expand Down Expand Up @@ -2995,17 +2995,17 @@ declare module 'stripe' {

interface Payments {
/**
* The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge.
* The default text that appears on statements for non-card charges outside of Japan. For card charges, if you don't set a `statement_descriptor_prefix`, this text is also used as the statement descriptor prefix. In that case, if concatenating the statement descriptor suffix causes the combined statement descriptor to exceed 22 characters, we truncate the `statement_descriptor` text to limit the full descriptor to 22 characters. For more information about statement descriptors and their requirements, see the [account settings documentation](https://docs.stripe.com/get-started/account/statement-descriptors).
*/
statement_descriptor?: string;

/**
* The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only).
* The Kana variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors).
*/
statement_descriptor_kana?: string;

/**
* The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only).
* The Kanji variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors).
*/
statement_descriptor_kanji?: string;
}
Expand Down
176 changes: 176 additions & 0 deletions types/Billing/AlertsResource.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
// File generated from our OpenAPI spec

declare module 'stripe' {
namespace Stripe {
namespace Billing {
interface AlertCreateParams {
/**
* The type of alert to create.
*/
alert_type: 'usage_threshold';

/**
* The title of the alert.
*/
title: string;

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

/**
* Filters to limit the scope of an alert.
*/
filter?: AlertCreateParams.Filter;

/**
* The configuration of the usage threshold.
*/
usage_threshold_config?: AlertCreateParams.UsageThresholdConfig;
}

namespace AlertCreateParams {
interface Filter {
/**
* Limit the scope to this alert only to this customer.
*/
customer?: string;
}

interface UsageThresholdConfig {
/**
* Defines at which value the alert will fire.
*/
gte: number;

/**
* The [Billing Meter](https://stripe.com/api/billing/meter) ID whose usage is monitored.
*/
meter?: string;

/**
* Whether the alert should only fire only once, or once per billing cycle.
*/
recurrence: 'one_time';
}
}

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

interface AlertListParams extends PaginationParams {
/**
* Filter results to only include this type of alert.
*/
alert_type?: 'usage_threshold';

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

/**
* Filter results to only include alerts with the given meter.
*/
meter?: string;
}

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

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

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

class AlertsResource {
/**
* Creates a billing alert
*/
create(
params: AlertCreateParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Billing.Alert>>;

/**
* Retrieves a billing alert given an ID
*/
retrieve(
id: string,
params?: AlertRetrieveParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Billing.Alert>>;
retrieve(
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Billing.Alert>>;

/**
* Lists billing active and inactive alerts
*/
list(
params?: AlertListParams,
options?: RequestOptions
): ApiListPromise<Stripe.Billing.Alert>;
list(options?: RequestOptions): ApiListPromise<Stripe.Billing.Alert>;

/**
* Reactivates this alert, allowing it to trigger again.
*/
activate(
id: string,
params?: AlertActivateParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Billing.Alert>>;
activate(
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Billing.Alert>>;

/**
* Archives this alert, removing it from the list view and APIs. This is non-reversible.
*/
archive(
id: string,
params?: AlertArchiveParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Billing.Alert>>;
archive(
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Billing.Alert>>;

/**
* Deactivates this alert, preventing it from triggering.
*/
deactivate(
id: string,
params?: AlertDeactivateParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Billing.Alert>>;
deactivate(
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Billing.Alert>>;
}
}
}
}
4 changes: 2 additions & 2 deletions types/Cards.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ declare module 'stripe' {
available_payout_methods?: Array<Card.AvailablePayoutMethod> | null;

/**
* Card brand. Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`.
* Card brand. Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `Girocard`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`.
*/
brand: string;

Expand All @@ -81,7 +81,7 @@ declare module 'stripe' {
country: string | null;

/**
* Three-letter [ISO code for currency](https://stripe.com/docs/payouts). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts.
* Three-letter [ISO code for currency](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. Must be a [supported currency](https://docs.stripe.com/currencies). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts.
*/
currency?: string | null;

Expand Down
11 changes: 8 additions & 3 deletions types/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ declare module 'stripe' {
billing_details: Charge.BillingDetails;

/**
* The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. This only works for card payments.
* The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. This value only exists for card payments.
*/
calculated_statement_descriptor: string | null;

Expand Down Expand Up @@ -214,12 +214,12 @@ declare module 'stripe' {
source_transfer: string | Stripe.Transfer | null;

/**
* For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters.
* For a non-card charge, text that appears on the customer's statement as the [statement descriptor](https://docs.stripe.com/get-started/account/statement-descriptors). This value overrides the account's default statement descriptor. For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix.
*/
statement_descriptor: string | null;

/**
* Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
* Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.corp.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor.
*/
statement_descriptor_suffix: string | null;

Expand Down Expand Up @@ -1211,6 +1211,11 @@ declare module 'stripe' {
* Time at which the payment was collected while offline
*/
stored_at: number | null;

/**
* The method used to process this payment method offline. Only deferred is allowed.
*/
type: 'deferred' | null;
}

type ReadMethod =
Expand Down
Loading
Loading