diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 402862bf..05aef7cb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.54.0" + ".": "4.55.0" } diff --git a/.stats.yml b/.stats.yml index ae59be0a..8070692c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0dbb8ba730f755468357ebda41332664e8396faf29a6a6a64ad37cf35cf70d0c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-43a4d1d907fd25faa99fef58ba7afb3dd39fae36f955b29bfe27b4bfdaa0ee54.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f10379c..757cb530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 4.55.0 (2025-02-07) + +Full Changelog: [v4.54.0...v4.55.0](https://github.com/orbcorp/orb-node/compare/v4.54.0...v4.55.0) + +### Features + +* **api:** api update ([#501](https://github.com/orbcorp/orb-node/issues/501)) ([c47b1f8](https://github.com/orbcorp/orb-node/commit/c47b1f827e39e97eb98ac0970d49d501f31ef969)) +* **client:** send `X-Stainless-Timeout` header ([#499](https://github.com/orbcorp/orb-node/issues/499)) ([bdbbbcb](https://github.com/orbcorp/orb-node/commit/bdbbbcb430640cccc4d648e672e72e2506f64373)) + ## 4.54.0 (2025-02-04) Full Changelog: [v4.53.0...v4.54.0](https://github.com/orbcorp/orb-node/compare/v4.53.0...v4.54.0) diff --git a/package.json b/package.json index 6cf2c5a1..02288de6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orb-billing", - "version": "4.54.0", + "version": "4.55.0", "description": "The official TypeScript library for the Orb API", "author": "Orb ", "types": "dist/index.d.ts", diff --git a/src/core.ts b/src/core.ts index c0d70da4..17fd5409 100644 --- a/src/core.ts +++ b/src/core.ts @@ -280,6 +280,7 @@ export abstract class APIClient { options: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, ): { req: RequestInit; url: string; timeout: number } { + options = { ...options }; const { method, path, query, headers: headers = {} } = options; const body = @@ -292,9 +293,9 @@ export abstract class APIClient { const url = this.buildURL(path!, query); if ('timeout' in options) validatePositiveInteger('timeout', options.timeout); - const timeout = options.timeout ?? this.timeout; + options.timeout = options.timeout ?? this.timeout; const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url); - const minAgentTimeout = timeout + 1000; + const minAgentTimeout = options.timeout + 1000; if ( typeof (httpAgent as any)?.options?.timeout === 'number' && minAgentTimeout > ((httpAgent as any).options.timeout ?? 0) @@ -323,7 +324,7 @@ export abstract class APIClient { signal: options.signal ?? null, }; - return { req, url, timeout }; + return { req, url, timeout: options.timeout }; } private buildHeaders({ @@ -351,15 +352,22 @@ export abstract class APIClient { delete reqHeaders['content-type']; } - // Don't set the retry count header if it was already set or removed through default headers or by the - // caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to - // account for the removal case. + // Don't set theses headers if they were already set or removed through default headers or by the caller. + // We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account + // for the removal case. if ( getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined && getHeader(headers, 'x-stainless-retry-count') === undefined ) { reqHeaders['x-stainless-retry-count'] = String(retryCount); } + if ( + getHeader(defaultHeaders, 'x-stainless-timeout') === undefined && + getHeader(headers, 'x-stainless-timeout') === undefined && + options.timeout + ) { + reqHeaders['x-stainless-timeout'] = String(options.timeout); + } this.validateHeaders(reqHeaders, headers); diff --git a/src/resources/events/backfills.ts b/src/resources/events/backfills.ts index 3dd66259..ed064f93 100644 --- a/src/resources/events/backfills.ts +++ b/src/resources/events/backfills.ts @@ -132,6 +132,13 @@ export interface BackfillCreateResponse { */ events_ingested: number; + /** + * If `true`, existing events in the backfill's timeframe will be replaced with the + * newly ingested events associated with the backfill. If `false`, newly ingested + * events will be added to the existing events. + */ + replace_existing_events: boolean; + /** * The time at which this backfill was reverted. */ @@ -180,6 +187,13 @@ export interface BackfillListResponse { */ events_ingested: number; + /** + * If `true`, existing events in the backfill's timeframe will be replaced with the + * newly ingested events associated with the backfill. If `false`, newly ingested + * events will be added to the existing events. + */ + replace_existing_events: boolean; + /** * The time at which this backfill was reverted. */ @@ -228,6 +242,13 @@ export interface BackfillCloseResponse { */ events_ingested: number; + /** + * If `true`, existing events in the backfill's timeframe will be replaced with the + * newly ingested events associated with the backfill. If `false`, newly ingested + * events will be added to the existing events. + */ + replace_existing_events: boolean; + /** * The time at which this backfill was reverted. */ @@ -276,6 +297,13 @@ export interface BackfillFetchResponse { */ events_ingested: number; + /** + * If `true`, existing events in the backfill's timeframe will be replaced with the + * newly ingested events associated with the backfill. If `false`, newly ingested + * events will be added to the existing events. + */ + replace_existing_events: boolean; + /** * The time at which this backfill was reverted. */ @@ -324,6 +352,13 @@ export interface BackfillRevertResponse { */ events_ingested: number; + /** + * If `true`, existing events in the backfill's timeframe will be replaced with the + * newly ingested events associated with the backfill. If `false`, newly ingested + * events will be added to the existing events. + */ + replace_existing_events: boolean; + /** * The time at which this backfill was reverted. */ diff --git a/src/resources/invoice-line-items.ts b/src/resources/invoice-line-items.ts index 58d03972..36e1ecbd 100644 --- a/src/resources/invoice-line-items.ts +++ b/src/resources/invoice-line-items.ts @@ -25,29 +25,30 @@ export interface InvoiceLineItemCreateResponse { id: string; /** - * The line amount after any adjustments, before overage conversion, credits and + * The line amount after any adjustments and before overage conversion, credits and * partial invoicing. */ adjusted_subtotal: string; /** - * All adjustments applied to the line item. + * All adjustments (ie. maximums, minimums, discounts) applied to the line item. */ adjustments: Array< - | InvoiceLineItemCreateResponse.AmountDiscountAdjustment - | InvoiceLineItemCreateResponse.PercentageDiscountAdjustment - | InvoiceLineItemCreateResponse.UsageDiscountAdjustment - | InvoiceLineItemCreateResponse.MinimumAdjustment - | InvoiceLineItemCreateResponse.MaximumAdjustment + | InvoiceLineItemCreateResponse.MonetaryUsageDiscountAdjustment + | InvoiceLineItemCreateResponse.MonetaryAmountDiscountAdjustment + | InvoiceLineItemCreateResponse.MonetaryPercentageDiscountAdjustment + | InvoiceLineItemCreateResponse.MonetaryMinimumAdjustment + | InvoiceLineItemCreateResponse.MonetaryMaximumAdjustment >; /** - * The final amount after any discounts or minimums. + * The final amount for a line item after all adjustments and pre paid credits have + * been applied. */ amount: string; /** - * The number of credits used + * The number of prepaid credits applied. */ credits_applied: string; @@ -109,6 +110,9 @@ export interface InvoiceLineItemCreateResponse { */ price: PricesAPI.Price | null; + /** + * Either the fixed fee quantity or the usage during the service period. + */ quantity: number; /** @@ -127,7 +131,7 @@ export interface InvoiceLineItemCreateResponse { >; /** - * The line amount before any line item-specific discounts or minimums. + * The line amount before before any adjustments. */ subtotal: string; @@ -139,16 +143,15 @@ export interface InvoiceLineItemCreateResponse { } export namespace InvoiceLineItemCreateResponse { - export interface AmountDiscountAdjustment { + export interface MonetaryUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; + adjustment_type: 'usage_discount'; /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. + * The value applied by an adjustment. */ - amount_discount: string; + amount: string; /** * The price IDs that this adjustment applies to. @@ -162,42 +165,43 @@ export namespace InvoiceLineItemCreateResponse { is_invoice_level: boolean; /** - * The plan phase in which this adjustment is active. + * The reason for the adjustment. */ - plan_phase_order: number | null; + reason: string | null; /** - * The reason for the adjustment. + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. */ - reason: string | null; + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface MonetaryAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; /** - * The price IDs that this adjustment applies to. + * The value applied by an adjustment. */ - applies_to_price_ids: Array; + amount: string; /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. */ - is_invoice_level: boolean; + amount_discount: string; /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. + * The price IDs that this adjustment applies to. */ - percentage_discount: number; + applies_to_price_ids: Array; /** - * The plan phase in which this adjustment is active. + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. */ - plan_phase_order: number | null; + is_invoice_level: boolean; /** * The reason for the adjustment. @@ -205,10 +209,15 @@ export namespace InvoiceLineItemCreateResponse { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface MonetaryPercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; + + /** + * The value applied by an adjustment. + */ + amount: string; /** * The price IDs that this adjustment applies to. @@ -222,27 +231,27 @@ export namespace InvoiceLineItemCreateResponse { is_invoice_level: boolean; /** - * The plan phase in which this adjustment is active. + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. */ - plan_phase_order: number | null; + percentage_discount: number; /** * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface MonetaryMinimumAdjustment { id: string; adjustment_type: 'minimum'; + /** + * The value applied by an adjustment. + */ + amount: string; + /** * The price IDs that this adjustment applies to. */ @@ -265,22 +274,22 @@ export namespace InvoiceLineItemCreateResponse { */ minimum_amount: string; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - /** * The reason for the adjustment. */ reason: string | null; } - export interface MaximumAdjustment { + export interface MonetaryMaximumAdjustment { id: string; adjustment_type: 'maximum'; + /** + * The value applied by an adjustment. + */ + amount: string; + /** * The price IDs that this adjustment applies to. */ @@ -298,11 +307,6 @@ export namespace InvoiceLineItemCreateResponse { */ maximum_amount: string; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - /** * The reason for the adjustment. */ diff --git a/src/resources/invoices.ts b/src/resources/invoices.ts index 2c1d23d2..ee5a9d5d 100644 --- a/src/resources/invoices.ts +++ b/src/resources/invoices.ts @@ -847,29 +847,30 @@ export namespace Invoice { id: string; /** - * The line amount after any adjustments, before overage conversion, credits and + * The line amount after any adjustments and before overage conversion, credits and * partial invoicing. */ adjusted_subtotal: string; /** - * All adjustments applied to the line item. + * All adjustments (ie. maximums, minimums, discounts) applied to the line item. */ adjustments: Array< - | LineItem.AmountDiscountAdjustment - | LineItem.PercentageDiscountAdjustment - | LineItem.UsageDiscountAdjustment - | LineItem.MinimumAdjustment - | LineItem.MaximumAdjustment + | LineItem.MonetaryUsageDiscountAdjustment + | LineItem.MonetaryAmountDiscountAdjustment + | LineItem.MonetaryPercentageDiscountAdjustment + | LineItem.MonetaryMinimumAdjustment + | LineItem.MonetaryMaximumAdjustment >; /** - * The final amount after any discounts or minimums. + * The final amount for a line item after all adjustments and pre paid credits have + * been applied. */ amount: string; /** - * The number of credits used + * The number of prepaid credits applied. */ credits_applied: string; @@ -931,6 +932,9 @@ export namespace Invoice { */ price: PricesAPI.Price | null; + /** + * Either the fixed fee quantity or the usage during the service period. + */ quantity: number; /** @@ -945,7 +949,7 @@ export namespace Invoice { sub_line_items: Array; /** - * The line amount before any line item-specific discounts or minimums. + * The line amount before before any adjustments. */ subtotal: string; @@ -957,16 +961,15 @@ export namespace Invoice { } export namespace LineItem { - export interface AmountDiscountAdjustment { + export interface MonetaryUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; + adjustment_type: 'usage_discount'; /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. + * The value applied by an adjustment. */ - amount_discount: string; + amount: string; /** * The price IDs that this adjustment applies to. @@ -980,42 +983,43 @@ export namespace Invoice { is_invoice_level: boolean; /** - * The plan phase in which this adjustment is active. + * The reason for the adjustment. */ - plan_phase_order: number | null; + reason: string | null; /** - * The reason for the adjustment. + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. */ - reason: string | null; + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface MonetaryAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; /** - * The price IDs that this adjustment applies to. + * The value applied by an adjustment. */ - applies_to_price_ids: Array; + amount: string; /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. */ - is_invoice_level: boolean; + amount_discount: string; /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. + * The price IDs that this adjustment applies to. */ - percentage_discount: number; + applies_to_price_ids: Array; /** - * The plan phase in which this adjustment is active. + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. */ - plan_phase_order: number | null; + is_invoice_level: boolean; /** * The reason for the adjustment. @@ -1023,10 +1027,15 @@ export namespace Invoice { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface MonetaryPercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; + + /** + * The value applied by an adjustment. + */ + amount: string; /** * The price IDs that this adjustment applies to. @@ -1040,27 +1049,27 @@ export namespace Invoice { is_invoice_level: boolean; /** - * The plan phase in which this adjustment is active. + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. */ - plan_phase_order: number | null; + percentage_discount: number; /** * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface MonetaryMinimumAdjustment { id: string; adjustment_type: 'minimum'; + /** + * The value applied by an adjustment. + */ + amount: string; + /** * The price IDs that this adjustment applies to. */ @@ -1083,22 +1092,22 @@ export namespace Invoice { */ minimum_amount: string; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - /** * The reason for the adjustment. */ reason: string | null; } - export interface MaximumAdjustment { + export interface MonetaryMaximumAdjustment { id: string; adjustment_type: 'maximum'; + /** + * The value applied by an adjustment. + */ + amount: string; + /** * The price IDs that this adjustment applies to. */ @@ -1116,11 +1125,6 @@ export namespace Invoice { */ maximum_amount: string; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - /** * The reason for the adjustment. */ @@ -2053,29 +2057,30 @@ export namespace InvoiceFetchUpcomingResponse { id: string; /** - * The line amount after any adjustments, before overage conversion, credits and + * The line amount after any adjustments and before overage conversion, credits and * partial invoicing. */ adjusted_subtotal: string; /** - * All adjustments applied to the line item. + * All adjustments (ie. maximums, minimums, discounts) applied to the line item. */ adjustments: Array< - | LineItem.AmountDiscountAdjustment - | LineItem.PercentageDiscountAdjustment - | LineItem.UsageDiscountAdjustment - | LineItem.MinimumAdjustment - | LineItem.MaximumAdjustment + | LineItem.MonetaryUsageDiscountAdjustment + | LineItem.MonetaryAmountDiscountAdjustment + | LineItem.MonetaryPercentageDiscountAdjustment + | LineItem.MonetaryMinimumAdjustment + | LineItem.MonetaryMaximumAdjustment >; /** - * The final amount after any discounts or minimums. + * The final amount for a line item after all adjustments and pre paid credits have + * been applied. */ amount: string; /** - * The number of credits used + * The number of prepaid credits applied. */ credits_applied: string; @@ -2137,6 +2142,9 @@ export namespace InvoiceFetchUpcomingResponse { */ price: PricesAPI.Price | null; + /** + * Either the fixed fee quantity or the usage during the service period. + */ quantity: number; /** @@ -2151,7 +2159,7 @@ export namespace InvoiceFetchUpcomingResponse { sub_line_items: Array; /** - * The line amount before any line item-specific discounts or minimums. + * The line amount before before any adjustments. */ subtotal: string; @@ -2163,16 +2171,15 @@ export namespace InvoiceFetchUpcomingResponse { } export namespace LineItem { - export interface AmountDiscountAdjustment { + export interface MonetaryUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; + adjustment_type: 'usage_discount'; /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. + * The value applied by an adjustment. */ - amount_discount: string; + amount: string; /** * The price IDs that this adjustment applies to. @@ -2186,42 +2193,43 @@ export namespace InvoiceFetchUpcomingResponse { is_invoice_level: boolean; /** - * The plan phase in which this adjustment is active. + * The reason for the adjustment. */ - plan_phase_order: number | null; + reason: string | null; /** - * The reason for the adjustment. + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. */ - reason: string | null; + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface MonetaryAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; /** - * The price IDs that this adjustment applies to. + * The value applied by an adjustment. */ - applies_to_price_ids: Array; + amount: string; /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. */ - is_invoice_level: boolean; + amount_discount: string; /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. + * The price IDs that this adjustment applies to. */ - percentage_discount: number; + applies_to_price_ids: Array; /** - * The plan phase in which this adjustment is active. + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. */ - plan_phase_order: number | null; + is_invoice_level: boolean; /** * The reason for the adjustment. @@ -2229,10 +2237,15 @@ export namespace InvoiceFetchUpcomingResponse { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface MonetaryPercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; + + /** + * The value applied by an adjustment. + */ + amount: string; /** * The price IDs that this adjustment applies to. @@ -2246,27 +2259,27 @@ export namespace InvoiceFetchUpcomingResponse { is_invoice_level: boolean; /** - * The plan phase in which this adjustment is active. + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. */ - plan_phase_order: number | null; + percentage_discount: number; /** * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface MonetaryMinimumAdjustment { id: string; adjustment_type: 'minimum'; + /** + * The value applied by an adjustment. + */ + amount: string; + /** * The price IDs that this adjustment applies to. */ @@ -2289,22 +2302,22 @@ export namespace InvoiceFetchUpcomingResponse { */ minimum_amount: string; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - /** * The reason for the adjustment. */ reason: string | null; } - export interface MaximumAdjustment { + export interface MonetaryMaximumAdjustment { id: string; adjustment_type: 'maximum'; + /** + * The value applied by an adjustment. + */ + amount: string; + /** * The price IDs that this adjustment applies to. */ @@ -2322,11 +2335,6 @@ export namespace InvoiceFetchUpcomingResponse { */ maximum_amount: string; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - /** * The reason for the adjustment. */ diff --git a/src/resources/plans/plans.ts b/src/resources/plans/plans.ts index 91dc134e..7d3d2dcc 100644 --- a/src/resources/plans/plans.ts +++ b/src/resources/plans/plans.ts @@ -88,11 +88,11 @@ export interface Plan { * across all phases of the plan. */ adjustments: Array< - | Plan.AmountDiscountAdjustment - | Plan.PercentageDiscountAdjustment - | Plan.UsageDiscountAdjustment - | Plan.MinimumAdjustment - | Plan.MaximumAdjustment + | Plan.PlanPhaseUsageDiscountAdjustment + | Plan.PlanPhaseAmountDiscountAdjustment + | Plan.PlanPhasePercentageDiscountAdjustment + | Plan.PlanPhaseMinimumAdjustment + | Plan.PlanPhaseMaximumAdjustment >; base_plan: Plan.BasePlan | null; @@ -179,16 +179,10 @@ export interface Plan { } export namespace Plan { - export interface AmountDiscountAdjustment { + export interface PlanPhaseUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + adjustment_type: 'usage_discount'; /** * The price IDs that this adjustment applies to. @@ -210,12 +204,24 @@ export namespace Plan { * The reason for the adjustment. */ reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface PlanPhaseAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; /** * The price IDs that this adjustment applies to. @@ -228,12 +234,6 @@ export namespace Plan { */ is_invoice_level: boolean; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - /** * The plan phase in which this adjustment is active. */ @@ -245,10 +245,10 @@ export namespace Plan { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface PlanPhasePercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; /** * The price IDs that this adjustment applies to. @@ -261,6 +261,12 @@ export namespace Plan { */ is_invoice_level: boolean; + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + /** * The plan phase in which this adjustment is active. */ @@ -270,15 +276,9 @@ export namespace Plan { * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; @@ -316,7 +316,7 @@ export namespace Plan { reason: string | null; } - export interface MaximumAdjustment { + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts index 650cd98d..6faba406 100644 --- a/src/resources/subscriptions.ts +++ b/src/resources/subscriptions.ts @@ -1228,11 +1228,11 @@ export namespace Subscription { id: string; adjustment: - | AdjustmentInterval.AmountDiscountAdjustment - | AdjustmentInterval.PercentageDiscountAdjustment - | AdjustmentInterval.UsageDiscountAdjustment - | AdjustmentInterval.MinimumAdjustment - | AdjustmentInterval.MaximumAdjustment; + | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment + | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment + | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment + | AdjustmentInterval.PlanPhaseMinimumAdjustment + | AdjustmentInterval.PlanPhaseMaximumAdjustment; /** * The price interval IDs that this adjustment applies to. @@ -1251,16 +1251,10 @@ export namespace Subscription { } export namespace AdjustmentInterval { - export interface AmountDiscountAdjustment { + export interface PlanPhaseUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + adjustment_type: 'usage_discount'; /** * The price IDs that this adjustment applies to. @@ -1282,12 +1276,24 @@ export namespace Subscription { * The reason for the adjustment. */ reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface PlanPhaseAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; /** * The price IDs that this adjustment applies to. @@ -1300,12 +1306,6 @@ export namespace Subscription { */ is_invoice_level: boolean; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - /** * The plan phase in which this adjustment is active. */ @@ -1317,10 +1317,10 @@ export namespace Subscription { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface PlanPhasePercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; /** * The price IDs that this adjustment applies to. @@ -1333,6 +1333,12 @@ export namespace Subscription { */ is_invoice_level: boolean; + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + /** * The plan phase in which this adjustment is active. */ @@ -1342,15 +1348,9 @@ export namespace Subscription { * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; @@ -1388,7 +1388,7 @@ export namespace Subscription { reason: string | null; } - export interface MaximumAdjustment { + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; @@ -1914,11 +1914,11 @@ export namespace SubscriptionCreateResponse { id: string; adjustment: - | AdjustmentInterval.AmountDiscountAdjustment - | AdjustmentInterval.PercentageDiscountAdjustment - | AdjustmentInterval.UsageDiscountAdjustment - | AdjustmentInterval.MinimumAdjustment - | AdjustmentInterval.MaximumAdjustment; + | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment + | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment + | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment + | AdjustmentInterval.PlanPhaseMinimumAdjustment + | AdjustmentInterval.PlanPhaseMaximumAdjustment; /** * The price interval IDs that this adjustment applies to. @@ -1937,16 +1937,10 @@ export namespace SubscriptionCreateResponse { } export namespace AdjustmentInterval { - export interface AmountDiscountAdjustment { + export interface PlanPhaseUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + adjustment_type: 'usage_discount'; /** * The price IDs that this adjustment applies to. @@ -1968,12 +1962,24 @@ export namespace SubscriptionCreateResponse { * The reason for the adjustment. */ reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface PlanPhaseAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; /** * The price IDs that this adjustment applies to. @@ -1986,12 +1992,6 @@ export namespace SubscriptionCreateResponse { */ is_invoice_level: boolean; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - /** * The plan phase in which this adjustment is active. */ @@ -2003,10 +2003,10 @@ export namespace SubscriptionCreateResponse { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface PlanPhasePercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; /** * The price IDs that this adjustment applies to. @@ -2019,6 +2019,12 @@ export namespace SubscriptionCreateResponse { */ is_invoice_level: boolean; + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + /** * The plan phase in which this adjustment is active. */ @@ -2028,15 +2034,9 @@ export namespace SubscriptionCreateResponse { * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; @@ -2074,7 +2074,7 @@ export namespace SubscriptionCreateResponse { reason: string | null; } - export interface MaximumAdjustment { + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; @@ -2518,11 +2518,11 @@ export namespace SubscriptionCancelResponse { id: string; adjustment: - | AdjustmentInterval.AmountDiscountAdjustment - | AdjustmentInterval.PercentageDiscountAdjustment - | AdjustmentInterval.UsageDiscountAdjustment - | AdjustmentInterval.MinimumAdjustment - | AdjustmentInterval.MaximumAdjustment; + | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment + | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment + | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment + | AdjustmentInterval.PlanPhaseMinimumAdjustment + | AdjustmentInterval.PlanPhaseMaximumAdjustment; /** * The price interval IDs that this adjustment applies to. @@ -2541,16 +2541,10 @@ export namespace SubscriptionCancelResponse { } export namespace AdjustmentInterval { - export interface AmountDiscountAdjustment { + export interface PlanPhaseUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + adjustment_type: 'usage_discount'; /** * The price IDs that this adjustment applies to. @@ -2572,12 +2566,24 @@ export namespace SubscriptionCancelResponse { * The reason for the adjustment. */ reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface PlanPhaseAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; /** * The price IDs that this adjustment applies to. @@ -2590,12 +2596,6 @@ export namespace SubscriptionCancelResponse { */ is_invoice_level: boolean; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - /** * The plan phase in which this adjustment is active. */ @@ -2607,10 +2607,10 @@ export namespace SubscriptionCancelResponse { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface PlanPhasePercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; /** * The price IDs that this adjustment applies to. @@ -2623,6 +2623,12 @@ export namespace SubscriptionCancelResponse { */ is_invoice_level: boolean; + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + /** * The plan phase in which this adjustment is active. */ @@ -2632,15 +2638,9 @@ export namespace SubscriptionCancelResponse { * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; @@ -2678,7 +2678,7 @@ export namespace SubscriptionCancelResponse { reason: string | null; } - export interface MaximumAdjustment { + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; @@ -3204,11 +3204,11 @@ export namespace SubscriptionPriceIntervalsResponse { id: string; adjustment: - | AdjustmentInterval.AmountDiscountAdjustment - | AdjustmentInterval.PercentageDiscountAdjustment - | AdjustmentInterval.UsageDiscountAdjustment - | AdjustmentInterval.MinimumAdjustment - | AdjustmentInterval.MaximumAdjustment; + | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment + | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment + | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment + | AdjustmentInterval.PlanPhaseMinimumAdjustment + | AdjustmentInterval.PlanPhaseMaximumAdjustment; /** * The price interval IDs that this adjustment applies to. @@ -3227,16 +3227,10 @@ export namespace SubscriptionPriceIntervalsResponse { } export namespace AdjustmentInterval { - export interface AmountDiscountAdjustment { + export interface PlanPhaseUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + adjustment_type: 'usage_discount'; /** * The price IDs that this adjustment applies to. @@ -3258,12 +3252,24 @@ export namespace SubscriptionPriceIntervalsResponse { * The reason for the adjustment. */ reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface PlanPhaseAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; /** * The price IDs that this adjustment applies to. @@ -3276,12 +3282,6 @@ export namespace SubscriptionPriceIntervalsResponse { */ is_invoice_level: boolean; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - /** * The plan phase in which this adjustment is active. */ @@ -3293,10 +3293,10 @@ export namespace SubscriptionPriceIntervalsResponse { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface PlanPhasePercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; /** * The price IDs that this adjustment applies to. @@ -3309,6 +3309,12 @@ export namespace SubscriptionPriceIntervalsResponse { */ is_invoice_level: boolean; + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + /** * The plan phase in which this adjustment is active. */ @@ -3318,15 +3324,9 @@ export namespace SubscriptionPriceIntervalsResponse { * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; @@ -3364,7 +3364,7 @@ export namespace SubscriptionPriceIntervalsResponse { reason: string | null; } - export interface MaximumAdjustment { + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; @@ -3808,11 +3808,11 @@ export namespace SubscriptionSchedulePlanChangeResponse { id: string; adjustment: - | AdjustmentInterval.AmountDiscountAdjustment - | AdjustmentInterval.PercentageDiscountAdjustment - | AdjustmentInterval.UsageDiscountAdjustment - | AdjustmentInterval.MinimumAdjustment - | AdjustmentInterval.MaximumAdjustment; + | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment + | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment + | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment + | AdjustmentInterval.PlanPhaseMinimumAdjustment + | AdjustmentInterval.PlanPhaseMaximumAdjustment; /** * The price interval IDs that this adjustment applies to. @@ -3831,16 +3831,10 @@ export namespace SubscriptionSchedulePlanChangeResponse { } export namespace AdjustmentInterval { - export interface AmountDiscountAdjustment { + export interface PlanPhaseUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + adjustment_type: 'usage_discount'; /** * The price IDs that this adjustment applies to. @@ -3862,12 +3856,24 @@ export namespace SubscriptionSchedulePlanChangeResponse { * The reason for the adjustment. */ reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface PlanPhaseAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; /** * The price IDs that this adjustment applies to. @@ -3880,12 +3886,6 @@ export namespace SubscriptionSchedulePlanChangeResponse { */ is_invoice_level: boolean; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - /** * The plan phase in which this adjustment is active. */ @@ -3897,10 +3897,10 @@ export namespace SubscriptionSchedulePlanChangeResponse { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface PlanPhasePercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; /** * The price IDs that this adjustment applies to. @@ -3913,6 +3913,12 @@ export namespace SubscriptionSchedulePlanChangeResponse { */ is_invoice_level: boolean; + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + /** * The plan phase in which this adjustment is active. */ @@ -3922,15 +3928,9 @@ export namespace SubscriptionSchedulePlanChangeResponse { * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; @@ -3968,7 +3968,7 @@ export namespace SubscriptionSchedulePlanChangeResponse { reason: string | null; } - export interface MaximumAdjustment { + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; @@ -4412,11 +4412,11 @@ export namespace SubscriptionTriggerPhaseResponse { id: string; adjustment: - | AdjustmentInterval.AmountDiscountAdjustment - | AdjustmentInterval.PercentageDiscountAdjustment - | AdjustmentInterval.UsageDiscountAdjustment - | AdjustmentInterval.MinimumAdjustment - | AdjustmentInterval.MaximumAdjustment; + | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment + | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment + | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment + | AdjustmentInterval.PlanPhaseMinimumAdjustment + | AdjustmentInterval.PlanPhaseMaximumAdjustment; /** * The price interval IDs that this adjustment applies to. @@ -4435,16 +4435,10 @@ export namespace SubscriptionTriggerPhaseResponse { } export namespace AdjustmentInterval { - export interface AmountDiscountAdjustment { + export interface PlanPhaseUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + adjustment_type: 'usage_discount'; /** * The price IDs that this adjustment applies to. @@ -4466,12 +4460,24 @@ export namespace SubscriptionTriggerPhaseResponse { * The reason for the adjustment. */ reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface PlanPhaseAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; /** * The price IDs that this adjustment applies to. @@ -4484,12 +4490,6 @@ export namespace SubscriptionTriggerPhaseResponse { */ is_invoice_level: boolean; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - /** * The plan phase in which this adjustment is active. */ @@ -4501,10 +4501,10 @@ export namespace SubscriptionTriggerPhaseResponse { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface PlanPhasePercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; /** * The price IDs that this adjustment applies to. @@ -4517,6 +4517,12 @@ export namespace SubscriptionTriggerPhaseResponse { */ is_invoice_level: boolean; + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + /** * The plan phase in which this adjustment is active. */ @@ -4526,15 +4532,9 @@ export namespace SubscriptionTriggerPhaseResponse { * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; @@ -4572,7 +4572,7 @@ export namespace SubscriptionTriggerPhaseResponse { reason: string | null; } - export interface MaximumAdjustment { + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; @@ -5016,11 +5016,11 @@ export namespace SubscriptionUnscheduleCancellationResponse { id: string; adjustment: - | AdjustmentInterval.AmountDiscountAdjustment - | AdjustmentInterval.PercentageDiscountAdjustment - | AdjustmentInterval.UsageDiscountAdjustment - | AdjustmentInterval.MinimumAdjustment - | AdjustmentInterval.MaximumAdjustment; + | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment + | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment + | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment + | AdjustmentInterval.PlanPhaseMinimumAdjustment + | AdjustmentInterval.PlanPhaseMaximumAdjustment; /** * The price interval IDs that this adjustment applies to. @@ -5039,16 +5039,10 @@ export namespace SubscriptionUnscheduleCancellationResponse { } export namespace AdjustmentInterval { - export interface AmountDiscountAdjustment { + export interface PlanPhaseUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + adjustment_type: 'usage_discount'; /** * The price IDs that this adjustment applies to. @@ -5070,12 +5064,24 @@ export namespace SubscriptionUnscheduleCancellationResponse { * The reason for the adjustment. */ reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface PlanPhaseAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; /** * The price IDs that this adjustment applies to. @@ -5088,12 +5094,6 @@ export namespace SubscriptionUnscheduleCancellationResponse { */ is_invoice_level: boolean; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - /** * The plan phase in which this adjustment is active. */ @@ -5105,10 +5105,10 @@ export namespace SubscriptionUnscheduleCancellationResponse { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface PlanPhasePercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; /** * The price IDs that this adjustment applies to. @@ -5121,6 +5121,12 @@ export namespace SubscriptionUnscheduleCancellationResponse { */ is_invoice_level: boolean; + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + /** * The plan phase in which this adjustment is active. */ @@ -5130,15 +5136,9 @@ export namespace SubscriptionUnscheduleCancellationResponse { * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; @@ -5176,7 +5176,7 @@ export namespace SubscriptionUnscheduleCancellationResponse { reason: string | null; } - export interface MaximumAdjustment { + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; @@ -5620,11 +5620,11 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { id: string; adjustment: - | AdjustmentInterval.AmountDiscountAdjustment - | AdjustmentInterval.PercentageDiscountAdjustment - | AdjustmentInterval.UsageDiscountAdjustment - | AdjustmentInterval.MinimumAdjustment - | AdjustmentInterval.MaximumAdjustment; + | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment + | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment + | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment + | AdjustmentInterval.PlanPhaseMinimumAdjustment + | AdjustmentInterval.PlanPhaseMaximumAdjustment; /** * The price interval IDs that this adjustment applies to. @@ -5643,16 +5643,10 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { } export namespace AdjustmentInterval { - export interface AmountDiscountAdjustment { + export interface PlanPhaseUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + adjustment_type: 'usage_discount'; /** * The price IDs that this adjustment applies to. @@ -5674,12 +5668,24 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { * The reason for the adjustment. */ reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface PlanPhaseAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; /** * The price IDs that this adjustment applies to. @@ -5692,12 +5698,6 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { */ is_invoice_level: boolean; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - /** * The plan phase in which this adjustment is active. */ @@ -5709,10 +5709,10 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface PlanPhasePercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; /** * The price IDs that this adjustment applies to. @@ -5725,6 +5725,12 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { */ is_invoice_level: boolean; + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + /** * The plan phase in which this adjustment is active. */ @@ -5734,15 +5740,9 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; @@ -5780,7 +5780,7 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { reason: string | null; } - export interface MaximumAdjustment { + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; @@ -6224,11 +6224,11 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { id: string; adjustment: - | AdjustmentInterval.AmountDiscountAdjustment - | AdjustmentInterval.PercentageDiscountAdjustment - | AdjustmentInterval.UsageDiscountAdjustment - | AdjustmentInterval.MinimumAdjustment - | AdjustmentInterval.MaximumAdjustment; + | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment + | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment + | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment + | AdjustmentInterval.PlanPhaseMinimumAdjustment + | AdjustmentInterval.PlanPhaseMaximumAdjustment; /** * The price interval IDs that this adjustment applies to. @@ -6247,16 +6247,10 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { } export namespace AdjustmentInterval { - export interface AmountDiscountAdjustment { + export interface PlanPhaseUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + adjustment_type: 'usage_discount'; /** * The price IDs that this adjustment applies to. @@ -6278,12 +6272,24 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { * The reason for the adjustment. */ reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface PlanPhaseAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; /** * The price IDs that this adjustment applies to. @@ -6296,12 +6302,6 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { */ is_invoice_level: boolean; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - /** * The plan phase in which this adjustment is active. */ @@ -6313,10 +6313,10 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface PlanPhasePercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; /** * The price IDs that this adjustment applies to. @@ -6329,6 +6329,12 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { */ is_invoice_level: boolean; + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + /** * The plan phase in which this adjustment is active. */ @@ -6338,15 +6344,9 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; @@ -6384,7 +6384,7 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { reason: string | null; } - export interface MaximumAdjustment { + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; @@ -6828,11 +6828,11 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { id: string; adjustment: - | AdjustmentInterval.AmountDiscountAdjustment - | AdjustmentInterval.PercentageDiscountAdjustment - | AdjustmentInterval.UsageDiscountAdjustment - | AdjustmentInterval.MinimumAdjustment - | AdjustmentInterval.MaximumAdjustment; + | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment + | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment + | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment + | AdjustmentInterval.PlanPhaseMinimumAdjustment + | AdjustmentInterval.PlanPhaseMaximumAdjustment; /** * The price interval IDs that this adjustment applies to. @@ -6851,16 +6851,10 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { } export namespace AdjustmentInterval { - export interface AmountDiscountAdjustment { + export interface PlanPhaseUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + adjustment_type: 'usage_discount'; /** * The price IDs that this adjustment applies to. @@ -6882,12 +6876,24 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { * The reason for the adjustment. */ reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface PlanPhaseAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; /** * The price IDs that this adjustment applies to. @@ -6900,12 +6906,6 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { */ is_invoice_level: boolean; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - /** * The plan phase in which this adjustment is active. */ @@ -6917,10 +6917,10 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface PlanPhasePercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; /** * The price IDs that this adjustment applies to. @@ -6933,6 +6933,12 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { */ is_invoice_level: boolean; + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + /** * The plan phase in which this adjustment is active. */ @@ -6942,15 +6948,9 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; @@ -6988,7 +6988,7 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { reason: string | null; } - export interface MaximumAdjustment { + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; @@ -7432,11 +7432,11 @@ export namespace SubscriptionUpdateTrialResponse { id: string; adjustment: - | AdjustmentInterval.AmountDiscountAdjustment - | AdjustmentInterval.PercentageDiscountAdjustment - | AdjustmentInterval.UsageDiscountAdjustment - | AdjustmentInterval.MinimumAdjustment - | AdjustmentInterval.MaximumAdjustment; + | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment + | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment + | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment + | AdjustmentInterval.PlanPhaseMinimumAdjustment + | AdjustmentInterval.PlanPhaseMaximumAdjustment; /** * The price interval IDs that this adjustment applies to. @@ -7455,16 +7455,10 @@ export namespace SubscriptionUpdateTrialResponse { } export namespace AdjustmentInterval { - export interface AmountDiscountAdjustment { + export interface PlanPhaseUsageDiscountAdjustment { id: string; - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + adjustment_type: 'usage_discount'; /** * The price IDs that this adjustment applies to. @@ -7486,12 +7480,24 @@ export namespace SubscriptionUpdateTrialResponse { * The reason for the adjustment. */ reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; } - export interface PercentageDiscountAdjustment { + export interface PlanPhaseAmountDiscountAdjustment { id: string; - adjustment_type: 'percentage_discount'; + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; /** * The price IDs that this adjustment applies to. @@ -7504,12 +7510,6 @@ export namespace SubscriptionUpdateTrialResponse { */ is_invoice_level: boolean; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - /** * The plan phase in which this adjustment is active. */ @@ -7521,10 +7521,10 @@ export namespace SubscriptionUpdateTrialResponse { reason: string | null; } - export interface UsageDiscountAdjustment { + export interface PlanPhasePercentageDiscountAdjustment { id: string; - adjustment_type: 'usage_discount'; + adjustment_type: 'percentage_discount'; /** * The price IDs that this adjustment applies to. @@ -7537,6 +7537,12 @@ export namespace SubscriptionUpdateTrialResponse { */ is_invoice_level: boolean; + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + /** * The plan phase in which this adjustment is active. */ @@ -7546,15 +7552,9 @@ export namespace SubscriptionUpdateTrialResponse { * The reason for the adjustment. */ reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; } - export interface MinimumAdjustment { + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; @@ -7592,7 +7592,7 @@ export namespace SubscriptionUpdateTrialResponse { reason: string | null; } - export interface MaximumAdjustment { + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; @@ -8046,8 +8046,7 @@ export namespace SubscriptionCreateParams { /** * The end date of the adjustment interval. This is the date that the adjustment - * will stop affecting prices on the subscription. If null, the adjustment will - * start when the phase or subscription starts. + * will stop affecting prices on the subscription. */ end_date?: string | null; @@ -17018,8 +17017,7 @@ export namespace SubscriptionSchedulePlanChangeParams { /** * The end date of the adjustment interval. This is the date that the adjustment - * will stop affecting prices on the subscription. If null, the adjustment will - * start when the phase or subscription starts. + * will stop affecting prices on the subscription. */ end_date?: string | null; diff --git a/src/version.ts b/src/version.ts index bca401fd..70a133b5 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.54.0'; // x-release-please-version +export const VERSION = '4.55.0'; // x-release-please-version