Skip to content

Commit

Permalink
Merge pull request #1053 from stripe/remi/codegen-e215279
Browse files Browse the repository at this point in the history
Multiple API changes
  • Loading branch information
remi-stripe committed Oct 26, 2020
2 parents f8b3194 + 4f1b82f commit 370c546
Show file tree
Hide file tree
Showing 47 changed files with 344 additions and 271 deletions.
10 changes: 5 additions & 5 deletions lib/resources/Accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ const stripeMethod = StripeResource.method;
module.exports = StripeResource.extend({
path: '',

reject: stripeMethod({
method: 'POST',
path: 'accounts/{account}/reject',
}),

create: stripeMethod({
method: 'POST',
path: 'accounts',
Expand All @@ -30,6 +25,11 @@ module.exports = StripeResource.extend({
methodType: 'list',
}),

reject: stripeMethod({
method: 'POST',
path: 'accounts/{account}/reject',
}),

retrieve(id) {
// No longer allow an api key to be passed as the first string to this function due to ambiguity between
// old account ids and api keys. To request the account for an api key, send null as the id
Expand Down
10 changes: 5 additions & 5 deletions lib/resources/Customers.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ module.exports = StripeResource.extend({
path: '/{customer}/sources',
}),

deleteSource: stripeMethod({
method: 'DELETE',
path: '/{customer}/sources/{id}',
}),

listSources: stripeMethod({
method: 'GET',
path: '/{customer}/sources',
Expand All @@ -57,11 +62,6 @@ module.exports = StripeResource.extend({
path: '/{customer}/sources/{id}',
}),

deleteSource: stripeMethod({
method: 'DELETE',
path: '/{customer}/sources/{id}',
}),

verifySource: stripeMethod({
method: 'POST',
path: '/{customer}/sources/{id}/verify',
Expand Down
10 changes: 5 additions & 5 deletions lib/resources/Invoices.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ module.exports = StripeResource.extend({
path: '/{invoice}/pay',
}),

sendInvoice: stripeMethod({
method: 'POST',
path: '/{invoice}/send',
}),

retrieveUpcoming: stripeMethod({
method: 'GET',
path: '/upcoming',
}),

sendInvoice: stripeMethod({
method: 'POST',
path: '/{invoice}/send',
}),

voidInvoice: stripeMethod({
method: 'POST',
path: '/{invoice}/void',
Expand Down
2 changes: 1 addition & 1 deletion lib/resources/Subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const stripeMethod = StripeResource.method;
module.exports = StripeResource.extend({
path: 'subscriptions',

includeBasic: ['create', 'list', 'retrieve', 'update', 'del'],
includeBasic: ['create', 'del', 'list', 'retrieve', 'update'],

deleteDiscount: stripeMethod({
method: 'DELETE',
Expand Down
16 changes: 8 additions & 8 deletions types/2020-08-27/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;

/**
* Options for customizing how the account functions within Stripe.
Expand Down Expand Up @@ -1218,7 +1218,7 @@ declare module 'stripe' {
/**
* The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.
*/
structure?: Company.Structure | null;
structure?: Stripe.Emptyable<Company.Structure>;

/**
* The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.)
Expand Down Expand Up @@ -1332,7 +1332,7 @@ declare module 'stripe' {
/**
* The individual's date of birth.
*/
dob?: Individual.Dob | null;
dob?: Stripe.Emptyable<Individual.Dob>;

/**
* The individual's email address.
Expand Down Expand Up @@ -1387,7 +1387,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;

/**
* The individual's phone number.
Expand Down Expand Up @@ -1739,7 +1739,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;

/**
* Options for customizing how the account functions within Stripe.
Expand Down Expand Up @@ -2121,7 +2121,7 @@ declare module 'stripe' {
/**
* The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.
*/
structure?: Company.Structure | null;
structure?: Stripe.Emptyable<Company.Structure>;

/**
* The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.)
Expand Down Expand Up @@ -2235,7 +2235,7 @@ declare module 'stripe' {
/**
* The individual's date of birth.
*/
dob?: Individual.Dob | null;
dob?: Stripe.Emptyable<Individual.Dob>;

/**
* The individual's email address.
Expand Down Expand Up @@ -2290,7 +2290,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;

/**
* The individual's phone number.
Expand Down
6 changes: 3 additions & 3 deletions types/2020-08-27/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;

/**
* The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/charges-transfers#on-behalf-of).
Expand Down Expand Up @@ -1671,7 +1671,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;

/**
* This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address.
Expand All @@ -1694,7 +1694,7 @@ declare module 'stripe' {
/**
* Either `safe` or `fraudulent`.
*/
user_report: FraudDetails.UserReport | null;
user_report: Stripe.Emptyable<FraudDetails.UserReport>;
}

namespace FraudDetails {
Expand Down
4 changes: 2 additions & 2 deletions types/2020-08-27/Coupons.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;

/**
* Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set.
Expand Down Expand Up @@ -205,7 +205,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;

/**
* Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set.
Expand Down
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 @@ -198,7 +198,7 @@ declare module 'stripe' {
/**
* The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`.
*/
tax_rates?: Array<string> | null;
tax_rates?: Stripe.Emptyable<Array<string>>;

/**
* Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`
Expand Down
4 changes: 2 additions & 2 deletions types/2020-08-27/CreditNotes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ declare module 'stripe' {
/**
* The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`.
*/
tax_rates?: Array<string> | null;
tax_rates?: Stripe.Emptyable<Array<string>>;

/**
* Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`
Expand Down Expand Up @@ -409,7 +409,7 @@ declare module 'stripe' {
/**
* The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`.
*/
tax_rates?: Array<string> | null;
tax_rates?: Stripe.Emptyable<Array<string>>;

/**
* Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`
Expand Down
4 changes: 2 additions & 2 deletions types/2020-08-27/CustomerBalanceTransactions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;
}

interface CustomerBalanceTransactionRetrieveParams {
Expand All @@ -132,7 +132,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;
}

interface CustomerBalanceTransactionListParams extends PaginationParams {
Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/CustomerSources.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;

/**
* Cardholder name.
Expand Down
20 changes: 10 additions & 10 deletions types/2020-08-27/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ declare module 'stripe' {
/**
* The customer's address.
*/
address?: AddressParam | null;
address?: Stripe.Emptyable<AddressParam>;

/**
* An integer amount in %s that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.
Expand Down Expand Up @@ -247,7 +247,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;

/**
* The customer's full name or business name.
Expand Down Expand Up @@ -279,14 +279,14 @@ declare module 'stripe' {
/**
* The customer's shipping information. Appears on invoices emailed to this customer.
*/
shipping?: CustomerCreateParams.Shipping | null;
shipping?: Stripe.Emptyable<CustomerCreateParams.Shipping>;

source?: string;

/**
* The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
*/
tax_exempt?: CustomerCreateParams.TaxExempt | null;
tax_exempt?: Stripe.Emptyable<CustomerCreateParams.TaxExempt>;

/**
* The customer's tax IDs.
Expand All @@ -299,7 +299,7 @@ declare module 'stripe' {
/**
* Default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields.
*/
custom_fields?: Array<InvoiceSettings.CustomField> | null;
custom_fields?: Stripe.Emptyable<Array<InvoiceSettings.CustomField>>;

/**
* ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices.
Expand Down Expand Up @@ -405,7 +405,7 @@ declare module 'stripe' {
/**
* The customer's address.
*/
address?: AddressParam | null;
address?: Stripe.Emptyable<AddressParam>;

/**
* An integer amount in %s that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.
Expand Down Expand Up @@ -451,7 +451,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;

/**
* The customer's full name or business name.
Expand Down Expand Up @@ -481,14 +481,14 @@ declare module 'stripe' {
/**
* The customer's shipping information. Appears on invoices emailed to this customer.
*/
shipping?: CustomerUpdateParams.Shipping | null;
shipping?: Stripe.Emptyable<CustomerUpdateParams.Shipping>;

source?: string;

/**
* The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
*/
tax_exempt?: CustomerUpdateParams.TaxExempt | null;
tax_exempt?: Stripe.Emptyable<CustomerUpdateParams.TaxExempt>;

/**
* Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`.
Expand All @@ -501,7 +501,7 @@ declare module 'stripe' {
/**
* Default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields.
*/
custom_fields?: Array<InvoiceSettings.CustomField> | null;
custom_fields?: Stripe.Emptyable<Array<InvoiceSettings.CustomField>>;

/**
* ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices.
Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/Disputes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;

/**
* Whether to immediately submit evidence to the bank. If `false`, evidence is staged on the dispute. Staged evidence is visible in the API and Dashboard, and can be submitted to the bank by making another request with this attribute set to `true` (the default).
Expand Down
6 changes: 4 additions & 2 deletions types/2020-08-27/ExternalAccounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ declare module 'stripe' {
/**
* The type of entity that holds the account. This can be either `individual` or `company`.
*/
account_holder_type?: ExternalAccountUpdateParams.AccountHolderType | null;
account_holder_type?: Stripe.Emptyable<
ExternalAccountUpdateParams.AccountHolderType
>;

/**
* City/District/Suburb/Town/Village.
Expand Down Expand Up @@ -94,7 +96,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;

/**
* Cardholder name.
Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/FeeRefunds.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;
}

interface FeeRefundListParams extends PaginationParams {
Expand Down
6 changes: 3 additions & 3 deletions types/2020-08-27/FileLinks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ declare module 'stripe' {
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;
}

interface FileLinkRetrieveParams {
Expand All @@ -89,12 +89,12 @@ declare module 'stripe' {
/**
* A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately.
*/
expires_at?: 'now' | number | null;
expires_at?: Stripe.Emptyable<'now' | number>;

/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
metadata?: Stripe.Emptyable<MetadataParam>;
}

interface FileLinkListParams extends PaginationParams {
Expand Down
Loading

0 comments on commit 370c546

Please sign in to comment.