orb-billing 1.41.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/README.md +13 -13
- package/core.d.ts.map +1 -1
- package/core.js +2 -1
- package/core.js.map +1 -1
- package/core.mjs +2 -1
- package/core.mjs.map +1 -1
- package/error.js +1 -1
- package/error.js.map +1 -1
- package/error.mjs +1 -1
- package/error.mjs.map +1 -1
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/index.mjs +2 -2
- package/index.mjs.map +1 -1
- package/package.json +4 -1
- package/pagination.js +1 -1
- package/pagination.js.map +1 -1
- package/pagination.mjs +1 -1
- package/pagination.mjs.map +1 -1
- package/resource.js +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs +1 -1
- package/resource.mjs.map +1 -1
- package/resources/beta/beta.js +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.js +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/price.js +1 -1
- package/resources/beta/price.js.map +1 -1
- package/resources/beta/price.mjs +1 -1
- package/resources/beta/price.mjs.map +1 -1
- package/resources/coupons/coupons.js +1 -1
- package/resources/coupons/coupons.js.map +1 -1
- package/resources/coupons/coupons.mjs +1 -1
- package/resources/coupons/coupons.mjs.map +1 -1
- package/resources/coupons/index.js +1 -1
- package/resources/coupons/index.js.map +1 -1
- package/resources/coupons/index.mjs +1 -1
- package/resources/coupons/index.mjs.map +1 -1
- package/resources/coupons/subscriptions.js +1 -1
- package/resources/coupons/subscriptions.js.map +1 -1
- package/resources/coupons/subscriptions.mjs +1 -1
- package/resources/coupons/subscriptions.mjs.map +1 -1
- package/resources/credit-notes.d.ts +1 -10
- package/resources/credit-notes.d.ts.map +1 -1
- package/resources/credit-notes.js +1 -1
- package/resources/credit-notes.js.map +1 -1
- package/resources/credit-notes.mjs +1 -1
- package/resources/credit-notes.mjs.map +1 -1
- package/resources/customers/balance-transactions.js +1 -1
- package/resources/customers/balance-transactions.js.map +1 -1
- package/resources/customers/balance-transactions.mjs +1 -1
- package/resources/customers/balance-transactions.mjs.map +1 -1
- package/resources/customers/costs.js +1 -1
- package/resources/customers/costs.js.map +1 -1
- package/resources/customers/costs.mjs +1 -1
- package/resources/customers/costs.mjs.map +1 -1
- package/resources/customers/credits/credits.js +1 -1
- package/resources/customers/credits/credits.js.map +1 -1
- package/resources/customers/credits/credits.mjs +1 -1
- package/resources/customers/credits/credits.mjs.map +1 -1
- package/resources/customers/credits/index.js +1 -1
- package/resources/customers/credits/index.js.map +1 -1
- package/resources/customers/credits/index.mjs +1 -1
- package/resources/customers/credits/index.mjs.map +1 -1
- package/resources/customers/credits/ledger.js +1 -1
- package/resources/customers/credits/ledger.js.map +1 -1
- package/resources/customers/credits/ledger.mjs +1 -1
- package/resources/customers/credits/ledger.mjs.map +1 -1
- package/resources/customers/credits/top-ups.js +1 -1
- package/resources/customers/credits/top-ups.js.map +1 -1
- package/resources/customers/credits/top-ups.mjs +1 -1
- package/resources/customers/credits/top-ups.mjs.map +1 -1
- package/resources/customers/customers.js +1 -1
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +1 -1
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/customers/index.js +1 -1
- package/resources/customers/index.js.map +1 -1
- package/resources/customers/index.mjs +1 -1
- package/resources/customers/index.mjs.map +1 -1
- package/resources/customers/usage.js +1 -1
- package/resources/customers/usage.js.map +1 -1
- package/resources/customers/usage.mjs +1 -1
- package/resources/customers/usage.mjs.map +1 -1
- package/resources/events/backfills.js +1 -1
- package/resources/events/backfills.js.map +1 -1
- package/resources/events/backfills.mjs +1 -1
- package/resources/events/backfills.mjs.map +1 -1
- package/resources/events/events.js +1 -1
- package/resources/events/events.js.map +1 -1
- package/resources/events/events.mjs +1 -1
- package/resources/events/events.mjs.map +1 -1
- package/resources/events/index.js +1 -1
- package/resources/events/index.js.map +1 -1
- package/resources/events/index.mjs +1 -1
- package/resources/events/index.mjs.map +1 -1
- package/resources/index.js +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invoice-line-items.js +1 -1
- package/resources/invoice-line-items.js.map +1 -1
- package/resources/invoice-line-items.mjs +1 -1
- package/resources/invoice-line-items.mjs.map +1 -1
- package/resources/invoices.d.ts +15 -1
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +1 -1
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +1 -1
- package/resources/invoices.mjs.map +1 -1
- package/resources/items.js +1 -1
- package/resources/items.js.map +1 -1
- package/resources/items.mjs +1 -1
- package/resources/items.mjs.map +1 -1
- package/resources/metrics.js +1 -1
- package/resources/metrics.js.map +1 -1
- package/resources/metrics.mjs +1 -1
- package/resources/metrics.mjs.map +1 -1
- package/resources/plans/external-plan-id.js +1 -1
- package/resources/plans/external-plan-id.js.map +1 -1
- package/resources/plans/external-plan-id.mjs +1 -1
- package/resources/plans/external-plan-id.mjs.map +1 -1
- package/resources/plans/index.js +1 -1
- package/resources/plans/index.js.map +1 -1
- package/resources/plans/index.mjs +1 -1
- package/resources/plans/index.mjs.map +1 -1
- package/resources/plans/plans.d.ts +40 -1
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js +1 -1
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs +1 -1
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/external-price-id.js +1 -1
- package/resources/prices/external-price-id.js.map +1 -1
- package/resources/prices/external-price-id.mjs +1 -1
- package/resources/prices/external-price-id.mjs.map +1 -1
- package/resources/prices/index.js +1 -1
- package/resources/prices/index.js.map +1 -1
- package/resources/prices/index.mjs +1 -1
- package/resources/prices/index.mjs.map +1 -1
- package/resources/prices/prices.d.ts +317 -2
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js +1 -1
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs +1 -1
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/shared.js +1 -1
- package/resources/shared.js.map +1 -1
- package/resources/shared.mjs +1 -1
- package/resources/shared.mjs.map +1 -1
- package/resources/subscriptions.d.ts +279 -3
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +1 -1
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +1 -1
- package/resources/subscriptions.mjs.map +1 -1
- package/resources/top-level.js +1 -1
- package/resources/top-level.js.map +1 -1
- package/resources/top-level.mjs +1 -1
- package/resources/top-level.mjs.map +1 -1
- package/src/core.ts +3 -1
- package/src/error.ts +1 -1
- package/src/index.ts +2 -2
- package/src/pagination.ts +1 -1
- package/src/resource.ts +1 -1
- package/src/resources/beta/beta.ts +1 -1
- package/src/resources/beta/index.ts +1 -1
- package/src/resources/beta/price.ts +1 -1
- package/src/resources/coupons/coupons.ts +1 -1
- package/src/resources/coupons/index.ts +1 -1
- package/src/resources/coupons/subscriptions.ts +1 -1
- package/src/resources/credit-notes.ts +2 -15
- package/src/resources/customers/balance-transactions.ts +1 -1
- package/src/resources/customers/costs.ts +1 -1
- package/src/resources/customers/credits/credits.ts +1 -1
- package/src/resources/customers/credits/index.ts +1 -1
- package/src/resources/customers/credits/ledger.ts +1 -1
- package/src/resources/customers/credits/top-ups.ts +1 -1
- package/src/resources/customers/customers.ts +1 -1
- package/src/resources/customers/index.ts +1 -1
- package/src/resources/customers/usage.ts +1 -1
- package/src/resources/events/backfills.ts +1 -1
- package/src/resources/events/events.ts +1 -1
- package/src/resources/events/index.ts +1 -1
- package/src/resources/index.ts +1 -1
- package/src/resources/invoice-line-items.ts +1 -1
- package/src/resources/invoices.ts +19 -2
- package/src/resources/items.ts +1 -1
- package/src/resources/metrics.ts +1 -1
- package/src/resources/plans/external-plan-id.ts +1 -1
- package/src/resources/plans/index.ts +1 -1
- package/src/resources/plans/plans.ts +51 -1
- package/src/resources/prices/external-price-id.ts +1 -1
- package/src/resources/prices/index.ts +1 -1
- package/src/resources/prices/prices.ts +422 -3
- package/src/resources/shared.ts +1 -1
- package/src/resources/subscriptions.ts +349 -1
- package/src/resources/top-level.ts +1 -1
- package/src/uploads.ts +4 -1
- package/src/version.ts +1 -1
- package/uploads.d.ts.map +1 -1
- package/uploads.js +3 -1
- package/uploads.js.map +1 -1
- package/uploads.mjs +3 -1
- package/uploads.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/src/resources/items.ts
CHANGED
package/src/resources/metrics.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless.
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
export { ExternalPlanIDUpdateParams, ExternalPlanID } from './external-plan-id';
|
|
4
4
|
export { Plan, PlanCreateParams, PlanUpdateParams, PlanListParams, PlansPage, Plans } from './plans';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless.
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import * as Core from "../../core";
|
|
4
4
|
import { APIResource } from "../../resource";
|
|
@@ -314,6 +314,7 @@ export interface PlanCreateParams {
|
|
|
314
314
|
| PlanCreateParams.NewPlanThresholdTotalAmountPrice
|
|
315
315
|
| PlanCreateParams.NewPlanTieredPackagePrice
|
|
316
316
|
| PlanCreateParams.NewPlanTieredWithMinimumPrice
|
|
317
|
+
| PlanCreateParams.NewPlanUnitWithPercentPrice
|
|
317
318
|
| PlanCreateParams.NewPlanPackageWithAllocationPrice
|
|
318
319
|
>;
|
|
319
320
|
|
|
@@ -1082,6 +1083,55 @@ export namespace PlanCreateParams {
|
|
|
1082
1083
|
invoice_grouping_key?: string | null;
|
|
1083
1084
|
}
|
|
1084
1085
|
|
|
1086
|
+
export interface NewPlanUnitWithPercentPrice {
|
|
1087
|
+
/**
|
|
1088
|
+
* The cadence to bill for this price on.
|
|
1089
|
+
*/
|
|
1090
|
+
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
|
|
1091
|
+
|
|
1092
|
+
/**
|
|
1093
|
+
* The id of the item the plan will be associated with.
|
|
1094
|
+
*/
|
|
1095
|
+
item_id: string;
|
|
1096
|
+
|
|
1097
|
+
model_type: 'unit_with_percent';
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* The name of the price.
|
|
1101
|
+
*/
|
|
1102
|
+
name: string;
|
|
1103
|
+
|
|
1104
|
+
unit_with_percent_config: Record<string, unknown>;
|
|
1105
|
+
|
|
1106
|
+
/**
|
|
1107
|
+
* The id of the billable metric for the price. Only needed if the price is
|
|
1108
|
+
* usage-based.
|
|
1109
|
+
*/
|
|
1110
|
+
billable_metric_id?: string | null;
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* If the Price represents a fixed cost, the price will be billed in-advance if
|
|
1114
|
+
* this is true, and in-arrears if this is false.
|
|
1115
|
+
*/
|
|
1116
|
+
billed_in_advance?: boolean | null;
|
|
1117
|
+
|
|
1118
|
+
/**
|
|
1119
|
+
* An alias for the price.
|
|
1120
|
+
*/
|
|
1121
|
+
external_price_id?: string | null;
|
|
1122
|
+
|
|
1123
|
+
/**
|
|
1124
|
+
* If the Price represents a fixed cost, this represents the quantity of units
|
|
1125
|
+
* applied.
|
|
1126
|
+
*/
|
|
1127
|
+
fixed_price_quantity?: number | null;
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* The property used to group this price on an invoice
|
|
1131
|
+
*/
|
|
1132
|
+
invoice_grouping_key?: string | null;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1085
1135
|
export interface NewPlanPackageWithAllocationPrice {
|
|
1086
1136
|
/**
|
|
1087
1137
|
* The cadence to bill for this price on.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless.
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
export { ExternalPriceID } from './external-price-id';
|
|
4
4
|
export { Price, PriceCreateParams, PriceListParams, PricesPage, Prices } from './prices';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless.
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import * as Core from "../../core";
|
|
4
4
|
import { APIResource } from "../../resource";
|
|
@@ -298,7 +298,9 @@ export type Price =
|
|
|
298
298
|
| Price.ThresholdTotalAmountPrice
|
|
299
299
|
| Price.TieredPackagePrice
|
|
300
300
|
| Price.TieredWithMinimumPrice
|
|
301
|
-
| Price.PackageWithAllocationPrice
|
|
301
|
+
| Price.PackageWithAllocationPrice
|
|
302
|
+
| Price.UnitWithPercentPrice
|
|
303
|
+
| Price.MatrixWithAllocationPrice;
|
|
302
304
|
|
|
303
305
|
export namespace Price {
|
|
304
306
|
export interface UnitPrice {
|
|
@@ -1399,12 +1401,214 @@ export namespace Price {
|
|
|
1399
1401
|
minimum_amount: string;
|
|
1400
1402
|
}
|
|
1401
1403
|
}
|
|
1404
|
+
|
|
1405
|
+
export interface UnitWithPercentPrice {
|
|
1406
|
+
id: string;
|
|
1407
|
+
|
|
1408
|
+
billable_metric: UnitWithPercentPrice.BillableMetric | null;
|
|
1409
|
+
|
|
1410
|
+
cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
|
|
1411
|
+
|
|
1412
|
+
created_at: string;
|
|
1413
|
+
|
|
1414
|
+
currency: string;
|
|
1415
|
+
|
|
1416
|
+
discount: Shared.Discount | null;
|
|
1417
|
+
|
|
1418
|
+
external_price_id: string | null;
|
|
1419
|
+
|
|
1420
|
+
fixed_price_quantity: number | null;
|
|
1421
|
+
|
|
1422
|
+
item: UnitWithPercentPrice.Item;
|
|
1423
|
+
|
|
1424
|
+
maximum: UnitWithPercentPrice.Maximum | null;
|
|
1425
|
+
|
|
1426
|
+
maximum_amount: string | null;
|
|
1427
|
+
|
|
1428
|
+
minimum: UnitWithPercentPrice.Minimum | null;
|
|
1429
|
+
|
|
1430
|
+
minimum_amount: string | null;
|
|
1431
|
+
|
|
1432
|
+
model_type: 'unit_with_percent';
|
|
1433
|
+
|
|
1434
|
+
name: string;
|
|
1435
|
+
|
|
1436
|
+
plan_phase_order: number | null;
|
|
1437
|
+
|
|
1438
|
+
price_type: 'usage_price' | 'fixed_price';
|
|
1439
|
+
|
|
1440
|
+
unit_with_percent_config: Record<string, unknown>;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
export namespace UnitWithPercentPrice {
|
|
1444
|
+
export interface BillableMetric {
|
|
1445
|
+
id: string;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
export interface Item {
|
|
1449
|
+
id: string;
|
|
1450
|
+
|
|
1451
|
+
name: string;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
export interface Maximum {
|
|
1455
|
+
/**
|
|
1456
|
+
* List of price_ids that this maximum amount applies to. For plan/plan phase
|
|
1457
|
+
* maximums, this can be a subset of prices.
|
|
1458
|
+
*/
|
|
1459
|
+
applies_to_price_ids: Array<string>;
|
|
1460
|
+
|
|
1461
|
+
/**
|
|
1462
|
+
* Maximum amount applied
|
|
1463
|
+
*/
|
|
1464
|
+
maximum_amount: string;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
export interface Minimum {
|
|
1468
|
+
/**
|
|
1469
|
+
* List of price_ids that this minimum amount applies to. For plan/plan phase
|
|
1470
|
+
* minimums, this can be a subset of prices.
|
|
1471
|
+
*/
|
|
1472
|
+
applies_to_price_ids: Array<string>;
|
|
1473
|
+
|
|
1474
|
+
/**
|
|
1475
|
+
* Minimum amount applied
|
|
1476
|
+
*/
|
|
1477
|
+
minimum_amount: string;
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
export interface MatrixWithAllocationPrice {
|
|
1482
|
+
id: string;
|
|
1483
|
+
|
|
1484
|
+
billable_metric: MatrixWithAllocationPrice.BillableMetric | null;
|
|
1485
|
+
|
|
1486
|
+
cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
|
|
1487
|
+
|
|
1488
|
+
created_at: string;
|
|
1489
|
+
|
|
1490
|
+
currency: string;
|
|
1491
|
+
|
|
1492
|
+
discount: Shared.Discount | null;
|
|
1493
|
+
|
|
1494
|
+
external_price_id: string | null;
|
|
1495
|
+
|
|
1496
|
+
fixed_price_quantity: number | null;
|
|
1497
|
+
|
|
1498
|
+
item: MatrixWithAllocationPrice.Item;
|
|
1499
|
+
|
|
1500
|
+
matrix_with_allocation_config: MatrixWithAllocationPrice.MatrixWithAllocationConfig;
|
|
1501
|
+
|
|
1502
|
+
maximum: MatrixWithAllocationPrice.Maximum | null;
|
|
1503
|
+
|
|
1504
|
+
maximum_amount: string | null;
|
|
1505
|
+
|
|
1506
|
+
minimum: MatrixWithAllocationPrice.Minimum | null;
|
|
1507
|
+
|
|
1508
|
+
minimum_amount: string | null;
|
|
1509
|
+
|
|
1510
|
+
model_type: 'matrix_with_allocation';
|
|
1511
|
+
|
|
1512
|
+
name: string;
|
|
1513
|
+
|
|
1514
|
+
plan_phase_order: number | null;
|
|
1515
|
+
|
|
1516
|
+
price_type: 'usage_price' | 'fixed_price';
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
export namespace MatrixWithAllocationPrice {
|
|
1520
|
+
export interface BillableMetric {
|
|
1521
|
+
id: string;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
export interface Item {
|
|
1525
|
+
id: string;
|
|
1526
|
+
|
|
1527
|
+
name: string;
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
export interface MatrixWithAllocationConfig {
|
|
1531
|
+
/**
|
|
1532
|
+
* Allocation to be used to calculate the price
|
|
1533
|
+
*/
|
|
1534
|
+
allocation: number;
|
|
1535
|
+
|
|
1536
|
+
/**
|
|
1537
|
+
* Default per unit rate for any usage not bucketed into a specified matrix_value
|
|
1538
|
+
*/
|
|
1539
|
+
default_unit_amount: string;
|
|
1540
|
+
|
|
1541
|
+
/**
|
|
1542
|
+
* One or two event property values to evaluate matrix groups by
|
|
1543
|
+
*/
|
|
1544
|
+
dimensions: Array<string | null>;
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* Matrix values for specified matrix grouping keys
|
|
1548
|
+
*/
|
|
1549
|
+
matrix_values: Array<MatrixWithAllocationConfig.MatrixValue>;
|
|
1550
|
+
|
|
1551
|
+
/**
|
|
1552
|
+
* Default optional multiplier to scale rated quantities that fall into the default
|
|
1553
|
+
* bucket by
|
|
1554
|
+
*/
|
|
1555
|
+
scaling_factor?: number | null;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
export namespace MatrixWithAllocationConfig {
|
|
1559
|
+
export interface MatrixValue {
|
|
1560
|
+
/**
|
|
1561
|
+
* One or two matrix keys to filter usage to this Matrix value by. For example,
|
|
1562
|
+
* ["region", "tier"] could be used to filter cloud usage by a cloud region and an
|
|
1563
|
+
* instance tier.
|
|
1564
|
+
*/
|
|
1565
|
+
dimension_values: Array<string | null>;
|
|
1566
|
+
|
|
1567
|
+
/**
|
|
1568
|
+
* Unit price for the specified dimension_values
|
|
1569
|
+
*/
|
|
1570
|
+
unit_amount: string;
|
|
1571
|
+
|
|
1572
|
+
/**
|
|
1573
|
+
* Optional multiplier to scale rated quantities by
|
|
1574
|
+
*/
|
|
1575
|
+
scaling_factor?: number | null;
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
export interface Maximum {
|
|
1580
|
+
/**
|
|
1581
|
+
* List of price_ids that this maximum amount applies to. For plan/plan phase
|
|
1582
|
+
* maximums, this can be a subset of prices.
|
|
1583
|
+
*/
|
|
1584
|
+
applies_to_price_ids: Array<string>;
|
|
1585
|
+
|
|
1586
|
+
/**
|
|
1587
|
+
* Maximum amount applied
|
|
1588
|
+
*/
|
|
1589
|
+
maximum_amount: string;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
export interface Minimum {
|
|
1593
|
+
/**
|
|
1594
|
+
* List of price_ids that this minimum amount applies to. For plan/plan phase
|
|
1595
|
+
* minimums, this can be a subset of prices.
|
|
1596
|
+
*/
|
|
1597
|
+
applies_to_price_ids: Array<string>;
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Minimum amount applied
|
|
1601
|
+
*/
|
|
1602
|
+
minimum_amount: string;
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1402
1605
|
}
|
|
1403
1606
|
|
|
1404
1607
|
export type PriceCreateParams =
|
|
1405
1608
|
| PriceCreateParams.NewFloatingUnitPrice
|
|
1406
1609
|
| PriceCreateParams.NewFloatingPackagePrice
|
|
1407
1610
|
| PriceCreateParams.NewFloatingMatrixPrice
|
|
1611
|
+
| PriceCreateParams.NewFloatingMatrixWithAllocationPrice
|
|
1408
1612
|
| PriceCreateParams.NewFloatingTieredPrice
|
|
1409
1613
|
| PriceCreateParams.NewFloatingTieredBpsPrice
|
|
1410
1614
|
| PriceCreateParams.NewFloatingBpsPrice
|
|
@@ -1413,7 +1617,9 @@ export type PriceCreateParams =
|
|
|
1413
1617
|
| PriceCreateParams.NewFloatingThresholdTotalAmountPrice
|
|
1414
1618
|
| PriceCreateParams.NewFloatingTieredPackagePrice
|
|
1415
1619
|
| PriceCreateParams.NewFloatingTieredWithMinimumPrice
|
|
1416
|
-
| PriceCreateParams.NewFloatingPackageWithAllocationPrice
|
|
1620
|
+
| PriceCreateParams.NewFloatingPackageWithAllocationPrice
|
|
1621
|
+
| PriceCreateParams.NewFloatingTieredPackageWithMinimumPrice
|
|
1622
|
+
| PriceCreateParams.NewFloatingUnitWithPercentPrice;
|
|
1417
1623
|
|
|
1418
1624
|
export namespace PriceCreateParams {
|
|
1419
1625
|
export interface NewFloatingUnitPrice {
|
|
@@ -1653,6 +1859,111 @@ export namespace PriceCreateParams {
|
|
|
1653
1859
|
}
|
|
1654
1860
|
}
|
|
1655
1861
|
|
|
1862
|
+
export interface NewFloatingMatrixWithAllocationPrice {
|
|
1863
|
+
/**
|
|
1864
|
+
* The cadence to bill for this price on.
|
|
1865
|
+
*/
|
|
1866
|
+
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
|
|
1867
|
+
|
|
1868
|
+
/**
|
|
1869
|
+
* An ISO 4217 currency string for which this price is billed in.
|
|
1870
|
+
*/
|
|
1871
|
+
currency: string;
|
|
1872
|
+
|
|
1873
|
+
/**
|
|
1874
|
+
* The id of the item the plan will be associated with.
|
|
1875
|
+
*/
|
|
1876
|
+
item_id: string;
|
|
1877
|
+
|
|
1878
|
+
matrix_with_allocation_config: PriceCreateParams.NewFloatingMatrixWithAllocationPrice.MatrixWithAllocationConfig;
|
|
1879
|
+
|
|
1880
|
+
model_type: 'matrix_with_allocation';
|
|
1881
|
+
|
|
1882
|
+
/**
|
|
1883
|
+
* The name of the price.
|
|
1884
|
+
*/
|
|
1885
|
+
name: string;
|
|
1886
|
+
|
|
1887
|
+
/**
|
|
1888
|
+
* The id of the billable metric for the price. Only needed if the price is
|
|
1889
|
+
* usage-based.
|
|
1890
|
+
*/
|
|
1891
|
+
billable_metric_id?: string | null;
|
|
1892
|
+
|
|
1893
|
+
/**
|
|
1894
|
+
* If the Price represents a fixed cost, the price will be billed in-advance if
|
|
1895
|
+
* this is true, and in-arrears if this is false.
|
|
1896
|
+
*/
|
|
1897
|
+
billed_in_advance?: boolean | null;
|
|
1898
|
+
|
|
1899
|
+
/**
|
|
1900
|
+
* An alias for the price.
|
|
1901
|
+
*/
|
|
1902
|
+
external_price_id?: string | null;
|
|
1903
|
+
|
|
1904
|
+
/**
|
|
1905
|
+
* If the Price represents a fixed cost, this represents the quantity of units
|
|
1906
|
+
* applied.
|
|
1907
|
+
*/
|
|
1908
|
+
fixed_price_quantity?: number | null;
|
|
1909
|
+
|
|
1910
|
+
/**
|
|
1911
|
+
* The property used to group this price on an invoice
|
|
1912
|
+
*/
|
|
1913
|
+
invoice_grouping_key?: string | null;
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
export namespace NewFloatingMatrixWithAllocationPrice {
|
|
1917
|
+
export interface MatrixWithAllocationConfig {
|
|
1918
|
+
/**
|
|
1919
|
+
* Allocation to be used to calculate the price
|
|
1920
|
+
*/
|
|
1921
|
+
allocation: number;
|
|
1922
|
+
|
|
1923
|
+
/**
|
|
1924
|
+
* Default per unit rate for any usage not bucketed into a specified matrix_value
|
|
1925
|
+
*/
|
|
1926
|
+
default_unit_amount: string;
|
|
1927
|
+
|
|
1928
|
+
/**
|
|
1929
|
+
* One or two event property values to evaluate matrix groups by
|
|
1930
|
+
*/
|
|
1931
|
+
dimensions: Array<string | null>;
|
|
1932
|
+
|
|
1933
|
+
/**
|
|
1934
|
+
* Matrix values for specified matrix grouping keys
|
|
1935
|
+
*/
|
|
1936
|
+
matrix_values: Array<MatrixWithAllocationConfig.MatrixValue>;
|
|
1937
|
+
|
|
1938
|
+
/**
|
|
1939
|
+
* Default optional multiplier to scale rated quantities that fall into the default
|
|
1940
|
+
* bucket by
|
|
1941
|
+
*/
|
|
1942
|
+
scaling_factor?: number | null;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
export namespace MatrixWithAllocationConfig {
|
|
1946
|
+
export interface MatrixValue {
|
|
1947
|
+
/**
|
|
1948
|
+
* One or two matrix keys to filter usage to this Matrix value by. For example,
|
|
1949
|
+
* ["region", "tier"] could be used to filter cloud usage by a cloud region and an
|
|
1950
|
+
* instance tier.
|
|
1951
|
+
*/
|
|
1952
|
+
dimension_values: Array<string | null>;
|
|
1953
|
+
|
|
1954
|
+
/**
|
|
1955
|
+
* Unit price for the specified dimension_values
|
|
1956
|
+
*/
|
|
1957
|
+
unit_amount: string;
|
|
1958
|
+
|
|
1959
|
+
/**
|
|
1960
|
+
* Optional multiplier to scale rated quantities by
|
|
1961
|
+
*/
|
|
1962
|
+
scaling_factor?: number | null;
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1656
1967
|
export interface NewFloatingTieredPrice {
|
|
1657
1968
|
/**
|
|
1658
1969
|
* The cadence to bill for this price on.
|
|
@@ -2266,6 +2577,114 @@ export namespace PriceCreateParams {
|
|
|
2266
2577
|
*/
|
|
2267
2578
|
invoice_grouping_key?: string | null;
|
|
2268
2579
|
}
|
|
2580
|
+
|
|
2581
|
+
export interface NewFloatingTieredPackageWithMinimumPrice {
|
|
2582
|
+
/**
|
|
2583
|
+
* The cadence to bill for this price on.
|
|
2584
|
+
*/
|
|
2585
|
+
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
|
|
2586
|
+
|
|
2587
|
+
/**
|
|
2588
|
+
* An ISO 4217 currency string for which this price is billed in.
|
|
2589
|
+
*/
|
|
2590
|
+
currency: string;
|
|
2591
|
+
|
|
2592
|
+
/**
|
|
2593
|
+
* The id of the item the plan will be associated with.
|
|
2594
|
+
*/
|
|
2595
|
+
item_id: string;
|
|
2596
|
+
|
|
2597
|
+
model_type: 'tiered_package_with_minimum';
|
|
2598
|
+
|
|
2599
|
+
/**
|
|
2600
|
+
* The name of the price.
|
|
2601
|
+
*/
|
|
2602
|
+
name: string;
|
|
2603
|
+
|
|
2604
|
+
tiered_package_with_minimum_config: Record<string, unknown>;
|
|
2605
|
+
|
|
2606
|
+
/**
|
|
2607
|
+
* The id of the billable metric for the price. Only needed if the price is
|
|
2608
|
+
* usage-based.
|
|
2609
|
+
*/
|
|
2610
|
+
billable_metric_id?: string | null;
|
|
2611
|
+
|
|
2612
|
+
/**
|
|
2613
|
+
* If the Price represents a fixed cost, the price will be billed in-advance if
|
|
2614
|
+
* this is true, and in-arrears if this is false.
|
|
2615
|
+
*/
|
|
2616
|
+
billed_in_advance?: boolean | null;
|
|
2617
|
+
|
|
2618
|
+
/**
|
|
2619
|
+
* An alias for the price.
|
|
2620
|
+
*/
|
|
2621
|
+
external_price_id?: string | null;
|
|
2622
|
+
|
|
2623
|
+
/**
|
|
2624
|
+
* If the Price represents a fixed cost, this represents the quantity of units
|
|
2625
|
+
* applied.
|
|
2626
|
+
*/
|
|
2627
|
+
fixed_price_quantity?: number | null;
|
|
2628
|
+
|
|
2629
|
+
/**
|
|
2630
|
+
* The property used to group this price on an invoice
|
|
2631
|
+
*/
|
|
2632
|
+
invoice_grouping_key?: string | null;
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
export interface NewFloatingUnitWithPercentPrice {
|
|
2636
|
+
/**
|
|
2637
|
+
* The cadence to bill for this price on.
|
|
2638
|
+
*/
|
|
2639
|
+
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
|
|
2640
|
+
|
|
2641
|
+
/**
|
|
2642
|
+
* An ISO 4217 currency string for which this price is billed in.
|
|
2643
|
+
*/
|
|
2644
|
+
currency: string;
|
|
2645
|
+
|
|
2646
|
+
/**
|
|
2647
|
+
* The id of the item the plan will be associated with.
|
|
2648
|
+
*/
|
|
2649
|
+
item_id: string;
|
|
2650
|
+
|
|
2651
|
+
model_type: 'unit_with_percent';
|
|
2652
|
+
|
|
2653
|
+
/**
|
|
2654
|
+
* The name of the price.
|
|
2655
|
+
*/
|
|
2656
|
+
name: string;
|
|
2657
|
+
|
|
2658
|
+
unit_with_percent_config: Record<string, unknown>;
|
|
2659
|
+
|
|
2660
|
+
/**
|
|
2661
|
+
* The id of the billable metric for the price. Only needed if the price is
|
|
2662
|
+
* usage-based.
|
|
2663
|
+
*/
|
|
2664
|
+
billable_metric_id?: string | null;
|
|
2665
|
+
|
|
2666
|
+
/**
|
|
2667
|
+
* If the Price represents a fixed cost, the price will be billed in-advance if
|
|
2668
|
+
* this is true, and in-arrears if this is false.
|
|
2669
|
+
*/
|
|
2670
|
+
billed_in_advance?: boolean | null;
|
|
2671
|
+
|
|
2672
|
+
/**
|
|
2673
|
+
* An alias for the price.
|
|
2674
|
+
*/
|
|
2675
|
+
external_price_id?: string | null;
|
|
2676
|
+
|
|
2677
|
+
/**
|
|
2678
|
+
* If the Price represents a fixed cost, this represents the quantity of units
|
|
2679
|
+
* applied.
|
|
2680
|
+
*/
|
|
2681
|
+
fixed_price_quantity?: number | null;
|
|
2682
|
+
|
|
2683
|
+
/**
|
|
2684
|
+
* The property used to group this price on an invoice
|
|
2685
|
+
*/
|
|
2686
|
+
invoice_grouping_key?: string | null;
|
|
2687
|
+
}
|
|
2269
2688
|
}
|
|
2270
2689
|
|
|
2271
2690
|
export interface PriceListParams extends PageParams {}
|
package/src/resources/shared.ts
CHANGED