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

Merged
merged 7 commits into from
Apr 9, 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 @@
v932
v938
6 changes: 6 additions & 0 deletions src/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,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 {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 All @@ -17,6 +18,7 @@ import {Customers as TestHelpersCustomers} from './resources/TestHelpers/Custome
import {DebitReversals as TreasuryDebitReversals} from './resources/Treasury/DebitReversals.js';
import {Disputes as IssuingDisputes} from './resources/Issuing/Disputes.js';
import {EarlyFraudWarnings as RadarEarlyFraudWarnings} from './resources/Radar/EarlyFraudWarnings.js';
import {Features as EntitlementsFeatures} from './resources/Entitlements/Features.js';
import {FinancialAccounts as TreasuryFinancialAccounts} from './resources/Treasury/FinancialAccounts.js';
import {InboundTransfers as TestHelpersTreasuryInboundTransfers} from './resources/TestHelpers/Treasury/InboundTransfers.js';
import {InboundTransfers as TreasuryInboundTransfers} from './resources/Treasury/InboundTransfers.js';
Expand Down Expand Up @@ -133,6 +135,10 @@ export const Climate = resourceNamespace('climate', {
Products: ClimateProducts,
Suppliers: ClimateSuppliers,
});
export const Entitlements = resourceNamespace('entitlements', {
ActiveEntitlements: EntitlementsActiveEntitlements,
Features: EntitlementsFeatures,
});
export const FinancialConnections = resourceNamespace('financialConnections', {
Accounts: FinancialConnectionsAccounts,
Sessions: FinancialConnectionsSessions,
Expand Down
15 changes: 15 additions & 0 deletions src/resources/Entitlements/ActiveEntitlements.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// File generated from our OpenAPI spec

import {StripeResource} from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const ActiveEntitlements = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/entitlements/active_entitlements/{id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/entitlements/active_entitlements',
methodType: 'list',
}),
});
20 changes: 20 additions & 0 deletions src/resources/Entitlements/Features.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// File generated from our OpenAPI spec

import {StripeResource} from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Features = StripeResource.extend({
create: stripeMethod({method: 'POST', fullPath: '/v1/entitlements/features'}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/entitlements/features/{id}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/entitlements/features/{id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/entitlements/features',
methodType: 'list',
}),
});
17 changes: 17 additions & 0 deletions src/resources/Products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ export const Products = StripeResource.extend({
methodType: 'list',
}),
del: stripeMethod({method: 'DELETE', fullPath: '/v1/products/{id}'}),
createFeature: stripeMethod({
method: 'POST',
fullPath: '/v1/products/{product}/features',
}),
deleteFeature: stripeMethod({
method: 'DELETE',
fullPath: '/v1/products/{product}/features/{id}',
}),
listFeatures: stripeMethod({
method: 'GET',
fullPath: '/v1/products/{product}/features',
methodType: 'list',
}),
retrieveFeature: stripeMethod({
method: 'GET',
fullPath: '/v1/products/{product}/features/{id}',
}),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/products/search',
Expand Down
2 changes: 1 addition & 1 deletion test/resources/generated_examples_test.spec.js

Large diffs are not rendered by default.

52 changes: 51 additions & 1 deletion types/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,18 +727,68 @@ declare module 'stripe' {
}

interface Controller {
fees?: Controller.Fees;

/**
* `true` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https://stripe.com/docs/connect/platform-controls-for-standard-accounts). Otherwise, this field is null.
*/
is_controller?: boolean;

losses?: Controller.Losses;

/**
* A value indicating responsibility for collecting requirements on this account. Only returned when the Connect application retrieving the resource controls the account.
*/
requirement_collection?: Controller.RequirementCollection;

stripe_dashboard?: Controller.StripeDashboard;

/**
* The controller type. Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself.
*/
type: Controller.Type;
}

namespace Controller {
interface Fees {
/**
* A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this account.
*/
payer: Fees.Payer;
}

namespace Fees {
type Payer =
| 'account'
| 'application'
| 'application_custom'
| 'application_express';
}

interface Losses {
/**
* A value indicating who is liable when this account can't pay back negative balances from payments.
*/
payments: Losses.Payments;
}

namespace Losses {
type Payments = 'application' | 'stripe';
}

type RequirementCollection = 'application' | 'stripe';

interface StripeDashboard {
/**
* A value indicating the Stripe dashboard this account has access to independent of the Connect application.
*/
type: StripeDashboard.Type;
}

namespace StripeDashboard {
type Type = 'express' | 'full' | 'none';
}

type Type = 'account' | 'application';
}

Expand Down Expand Up @@ -1322,7 +1372,7 @@ declare module 'stripe' {
user_agent?: string | null;
}

type Type = 'custom' | 'express' | 'standard';
type Type = 'custom' | 'express' | 'none' | 'standard';
}

/**
Expand Down
64 changes: 64 additions & 0 deletions types/AccountsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ declare module 'stripe' {
*/
company?: AccountCreateParams.Company;

/**
* A hash of configuration describing the account controller's attributes.
*/
controller?: AccountCreateParams.Controller;

/**
* The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported.
*/
Expand Down Expand Up @@ -827,6 +832,65 @@ declare module 'stripe' {
}
}

interface Controller {
/**
* A hash of configuration for who pays Stripe fees for product usage on this account.
*/
fees?: Controller.Fees;

/**
* A hash of configuration for products that have negative balance liability, and whether Stripe or a Connect application is responsible for them.
*/
losses?: Controller.Losses;

/**
* A value indicating responsibility for collecting updated information when requirements on the account are due or change. Defaults to `stripe`.
*/
requirement_collection?: Controller.RequirementCollection;

/**
* A hash of configuration for Stripe-hosted dashboards.
*/
stripe_dashboard?: Controller.StripeDashboard;
}

namespace Controller {
interface Fees {
/**
* A value indicating the responsible payer of Stripe fees on this account. Defaults to `account`.
*/
payer?: Fees.Payer;
}

namespace Fees {
type Payer = 'account' | 'application';
}

interface Losses {
/**
* A value indicating who is liable when this account can't pay back negative balances resulting from payments. Defaults to `stripe`.
*/
payments?: Losses.Payments;
}

namespace Losses {
type Payments = 'application' | 'stripe';
}

type RequirementCollection = 'application' | 'stripe';

interface StripeDashboard {
/**
* Whether this account should have access to the full Stripe Dashboard (`full`), to the Express Dashboard (`express`), or to no Stripe-hosted dashboard (`none`). Defaults to `full`.
*/
type?: StripeDashboard.Type;
}

namespace StripeDashboard {
type Type = 'express' | 'full' | 'none';
}
}

interface Documents {
/**
* One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check.
Expand Down
19 changes: 19 additions & 0 deletions types/Billing/MeterEventAdjustments.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ declare module 'stripe' {
*/
object: 'billing.meter_event_adjustment';

cancel: MeterEventAdjustment.Cancel;

/**
* The name of the meter event. Corresponds with the `event_name` field on a meter.
*/
event_name: string;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
Expand All @@ -21,9 +28,21 @@ declare module 'stripe' {
* The meter event adjustment's status.
*/
status: MeterEventAdjustment.Status;

/**
* Specifies whether to cancel a single event or a range of events for a time period.
*/
type: 'cancel';
}

namespace MeterEventAdjustment {
interface Cancel {
/**
* Unique identifier for the event.
*/
identifier: string;
}

type Status = 'complete' | 'pending';
}
}
Expand Down
7 changes: 6 additions & 1 deletion types/Billing/MeterEventAdjustmentsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ declare module 'stripe' {
*/
cancel: MeterEventAdjustmentCreateParams.Cancel;

/**
* The name of the meter event. Corresponds with the `event_name` field on a meter.
*/
event_name: string;

/**
* Specifies which fields in the response should be expanded.
*/
Expand All @@ -23,7 +28,7 @@ declare module 'stripe' {
namespace MeterEventAdjustmentCreateParams {
interface Cancel {
/**
* Unique identifier for the event.
* Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them.
*/
identifier: string;
}
Expand Down
37 changes: 37 additions & 0 deletions types/Entitlements/ActiveEntitlements.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// File generated from our OpenAPI spec

declare module 'stripe' {
namespace Stripe {
namespace Entitlements {
/**
* An active entitlement describes access to a feature for a customer.
*/
interface ActiveEntitlement {
/**
* Unique identifier for the object.
*/
id: string;

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

/**
* The feature that the customer is entitled to.
*/
feature: string;

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

/**
* A unique key you provide as your own system identifier. This may be up to 80 characters.
*/
lookup_key: string;
}
}
}
}
49 changes: 49 additions & 0 deletions types/Entitlements/ActiveEntitlementsResource.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// File generated from our OpenAPI spec

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

interface ActiveEntitlementListParams extends PaginationParams {
/**
* The ID of the customer.
*/
customer: string;

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

class ActiveEntitlementsResource {
/**
* Retrieve an active entitlement
*/
retrieve(
id: string,
params?: ActiveEntitlementRetrieveParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Entitlements.ActiveEntitlement>>;
retrieve(
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Entitlements.ActiveEntitlement>>;

/**
* Retrieve a list of active entitlements for a customer
*/
list(
params: ActiveEntitlementListParams,
options?: RequestOptions
): ApiListPromise<Stripe.Entitlements.ActiveEntitlement>;
}
}
}
}
Loading
Loading