Skip to content

Commit

Permalink
Codegen for openapi v218
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Jan 12, 2023
1 parent bbc4acc commit dcaadd2
Show file tree
Hide file tree
Showing 16 changed files with 361 additions and 61 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v217
v218
1 change: 1 addition & 0 deletions lib/resources.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/resources/Quotes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions lib/resources/Tax/Registrations.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ module.exports = {
}),
Tax: resourceNamespace('tax', {
Calculations: require('./resources/Tax/Calculations'),
Registrations: require('./resources/Tax/Registrations'),
Transactions: require('./resources/Tax/Transactions'),
}),
Terminal: resourceNamespace('terminal', {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/Quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = StripeResource.extend({

draftQuote: stripeMethod({
method: 'POST',
fullPath: '/v1/quotes/{quote}/draft',
fullPath: '/v1/quotes/{quote}/mark_draft',
}),

finalizeQuote: stripeMethod({
Expand Down
24 changes: 24 additions & 0 deletions src/resources/Tax/Registrations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// File generated from our OpenAPI spec

'use strict';

const StripeResource = require('../../StripeResource');
const stripeMethod = StripeResource.method;

module.exports = StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/tax/registrations',
}),

update: stripeMethod({
method: 'POST',
fullPath: '/v1/tax/registrations/{id}',
}),

list: stripeMethod({
method: 'GET',
fullPath: '/v1/tax/registrations',
methodType: 'list',
}),
});
32 changes: 32 additions & 0 deletions types/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,10 @@ declare module 'stripe' {
}

interface Controller {
application?: Controller.Application;

dashboard?: Controller.Dashboard;

/**
* `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.
*/
Expand All @@ -651,6 +655,34 @@ declare module 'stripe' {
}

namespace Controller {
interface Application {
/**
* `true` if the Connect application is responsible for negative balances and should manage credit and fraud risk on the account.
*/
loss_liable: boolean;

/**
* `true` if the Connect application is responsible for onboarding the account.
*/
onboarding_owner: boolean;

/**
* `true` if the Connect application is responsible for paying Stripe fees on pricing-control eligible products.
*/
pricing_controls: boolean;
}

interface Dashboard {
/**
* Whether this account has access to the full Stripe dashboard (`full`), to the Express dashboard (`express`), or to no dashboard (`none`).
*/
type: Dashboard.Type;
}

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

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

Expand Down
68 changes: 68 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;

/**
* The configuration of the account when `type` is not provided.
*/
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 @@ -720,6 +725,48 @@ declare module 'stripe' {
}
}

interface Controller {
/**
* The documentation for the application hash.
*/
application?: Controller.Application;

/**
* Properties of the account's dashboard.
*/
dashboard?: Controller.Dashboard;
}

namespace Controller {
interface Application {
/**
* Whether the controller is liable for losses on this account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances).
*/
loss_liable: boolean;

/**
* Whether the controller owns onboarding for this account.
*/
onboarding_owner?: boolean;

/**
* Whether the controller has pricing controls for this account.
*/
pricing_controls?: boolean;
}

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

namespace Dashboard {
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 Expand Up @@ -1289,6 +1336,11 @@ declare module 'stripe' {
*/
company?: AccountUpdateParams.Company;

/**
* The configuration of the account when using unified accounts.
*/
controller?: AccountUpdateParams.Controller;

/**
* Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts).
*/
Expand Down Expand Up @@ -1971,6 +2023,22 @@ declare module 'stripe' {
}
}

interface Controller {
/**
* Properties of the controlling application.
*/
application?: Controller.Application;
}

namespace Controller {
interface Application {
/**
* A Boolean indicating whether the application has pricing controls for this accounts.
*/
pricing_controls?: boolean;
}
}

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
47 changes: 11 additions & 36 deletions types/QuoteLines.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,15 @@ declare module 'stripe' {
/**
* The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
*/
index?: number | null;
index: number | null;
}

namespace AddDiscount {
interface DiscountEnd {
/**
* The discount end timestamp
* The discount end type.
*/
timestamp: number | null;

/**
* The discount end type
*/
type: 'timestamp';
type: 'line_ends_at';
}
}

Expand Down Expand Up @@ -194,22 +189,17 @@ declare module 'stripe' {
* Details to determine how long the discount should be applied for.
*/
discount_end?: Discount.DiscountEnd | null;

/**
* The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
*/
index?: number | null;
}

namespace Discount {
interface DiscountEnd {
/**
* The discount end timestamp
* The discount end timestamp.
*/
timestamp: number | null;

/**
* The discount end type
* The discount end type.
*/
type: 'timestamp';
}
Expand Down Expand Up @@ -244,22 +234,17 @@ declare module 'stripe' {
* Details to determine how long the discount should be applied for.
*/
discount_end?: RemoveDiscount.DiscountEnd | null;

/**
* The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
*/
index?: number | null;
}

namespace RemoveDiscount {
interface DiscountEnd {
/**
* The discount end timestamp
* The discount end timestamp.
*/
timestamp: number | null;

/**
* The discount end type
* The discount end type.
*/
type: 'timestamp';
}
Expand Down Expand Up @@ -287,22 +272,17 @@ declare module 'stripe' {
* Details to determine how long the discount should be applied for.
*/
discount_end?: SetDiscount.DiscountEnd | null;

/**
* The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
*/
index?: number | null;
}

namespace SetDiscount {
interface DiscountEnd {
/**
* The discount end timestamp
* The discount end timestamp.
*/
timestamp: number | null;

/**
* The discount end type
* The discount end type.
*/
type: 'timestamp';
}
Expand Down Expand Up @@ -356,22 +336,17 @@ declare module 'stripe' {
* Details to determine how long the discount should be applied for.
*/
discount_end?: Discount.DiscountEnd | null;

/**
* The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
*/
index?: number | null;
}

namespace Discount {
interface DiscountEnd {
/**
* The discount end timestamp
* The discount end timestamp.
*/
timestamp: number | null;

/**
* The discount end type
* The discount end type.
*/
type: 'timestamp';
}
Expand Down
2 changes: 1 addition & 1 deletion types/Quotes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ declare module 'stripe' {
/**
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted.
*/
proration_behavior?: SubscriptionDataOverride.ProrationBehavior;
proration_behavior?: SubscriptionDataOverride.ProrationBehavior | null;
}

namespace SubscriptionDataOverride {
Expand Down
Loading

0 comments on commit dcaadd2

Please sign in to comment.