@metronome/sdk 3.6.0 → 3.7.0

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.
Files changed (279) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/api-promise.d.mts +1 -0
  3. package/api-promise.d.mts.map +1 -1
  4. package/api-promise.d.ts +1 -0
  5. package/api-promise.d.ts.map +1 -1
  6. package/api-promise.mjs +1 -0
  7. package/api-promise.mjs.map +1 -1
  8. package/client.d.mts.map +1 -1
  9. package/client.d.ts.map +1 -1
  10. package/client.mjs.map +1 -1
  11. package/core/api-promise.d.mts.map +1 -1
  12. package/core/api-promise.d.ts.map +1 -1
  13. package/core/api-promise.mjs.map +1 -1
  14. package/core/error.mjs.map +1 -1
  15. package/core/pagination.d.mts.map +1 -1
  16. package/core/pagination.d.ts.map +1 -1
  17. package/core/pagination.mjs.map +1 -1
  18. package/core/resource.d.mts.map +1 -1
  19. package/core/resource.d.ts.map +1 -1
  20. package/core/uploads.d.mts.map +1 -1
  21. package/core/uploads.d.ts.map +1 -1
  22. package/core/uploads.mjs.map +1 -1
  23. package/error.d.mts +1 -0
  24. package/error.d.mts.map +1 -1
  25. package/error.d.ts +1 -0
  26. package/error.d.ts.map +1 -1
  27. package/error.mjs +1 -0
  28. package/error.mjs.map +1 -1
  29. package/index.d.mts.map +1 -1
  30. package/index.d.ts.map +1 -1
  31. package/index.mjs.map +1 -1
  32. package/internal/detect-platform.mjs.map +1 -1
  33. package/internal/headers.mjs.map +1 -1
  34. package/internal/parse.d.mts.map +1 -1
  35. package/internal/parse.d.ts.map +1 -1
  36. package/internal/parse.mjs.map +1 -1
  37. package/internal/qs/formats.d.mts.map +1 -1
  38. package/internal/qs/formats.d.ts.map +1 -1
  39. package/internal/qs/index.d.mts +2 -2
  40. package/internal/qs/index.d.mts.map +1 -1
  41. package/internal/qs/index.d.ts +2 -2
  42. package/internal/qs/index.d.ts.map +1 -1
  43. package/internal/qs/index.mjs.map +1 -1
  44. package/internal/qs/stringify.d.mts.map +1 -1
  45. package/internal/qs/stringify.d.ts.map +1 -1
  46. package/internal/qs/stringify.mjs.map +1 -1
  47. package/internal/qs/utils.d.mts.map +1 -1
  48. package/internal/qs/utils.d.ts.map +1 -1
  49. package/internal/qs/utils.mjs.map +1 -1
  50. package/internal/request-options.d.mts.map +1 -1
  51. package/internal/request-options.d.ts.map +1 -1
  52. package/internal/shims.d.mts +6 -0
  53. package/internal/shims.d.mts.map +1 -1
  54. package/internal/shims.d.ts +6 -0
  55. package/internal/shims.d.ts.map +1 -1
  56. package/internal/to-file.d.mts.map +1 -1
  57. package/internal/to-file.d.ts.map +1 -1
  58. package/internal/to-file.mjs.map +1 -1
  59. package/internal/types.d.mts +4 -4
  60. package/internal/types.d.mts.map +1 -1
  61. package/internal/types.d.ts +4 -4
  62. package/internal/types.d.ts.map +1 -1
  63. package/internal/uploads.d.mts.map +1 -1
  64. package/internal/uploads.d.ts.map +1 -1
  65. package/internal/uploads.mjs.map +1 -1
  66. package/internal/utils/base64.mjs.map +1 -1
  67. package/internal/utils/log.d.mts.map +1 -1
  68. package/internal/utils/log.d.ts.map +1 -1
  69. package/internal/utils/log.mjs.map +1 -1
  70. package/internal/utils/path.mjs.map +1 -1
  71. package/internal/utils/query.mjs.map +1 -1
  72. package/internal/utils/values.mjs.map +1 -1
  73. package/internal/utils.d.mts.map +1 -1
  74. package/internal/utils.d.ts.map +1 -1
  75. package/internal/utils.mjs.map +1 -1
  76. package/package.json +1 -1
  77. package/pagination.d.mts +1 -0
  78. package/pagination.d.mts.map +1 -1
  79. package/pagination.d.ts +1 -0
  80. package/pagination.d.ts.map +1 -1
  81. package/pagination.mjs +1 -0
  82. package/pagination.mjs.map +1 -1
  83. package/resource.d.mts +1 -0
  84. package/resource.d.mts.map +1 -1
  85. package/resource.d.ts +1 -0
  86. package/resource.d.ts.map +1 -1
  87. package/resource.mjs +1 -0
  88. package/resource.mjs.map +1 -1
  89. package/resources/index.d.mts.map +1 -1
  90. package/resources/index.d.ts.map +1 -1
  91. package/resources/index.mjs.map +1 -1
  92. package/resources/shared.d.mts +226 -0
  93. package/resources/shared.d.mts.map +1 -1
  94. package/resources/shared.d.ts +226 -0
  95. package/resources/shared.d.ts.map +1 -1
  96. package/resources/v1/alerts.d.mts.map +1 -1
  97. package/resources/v1/alerts.d.ts.map +1 -1
  98. package/resources/v1/alerts.mjs.map +1 -1
  99. package/resources/v1/audit-logs.d.mts.map +1 -1
  100. package/resources/v1/audit-logs.d.ts.map +1 -1
  101. package/resources/v1/audit-logs.mjs.map +1 -1
  102. package/resources/v1/billable-metrics.d.mts.map +1 -1
  103. package/resources/v1/billable-metrics.d.ts.map +1 -1
  104. package/resources/v1/billable-metrics.mjs.map +1 -1
  105. package/resources/v1/contracts/contracts.d.mts +406 -1
  106. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  107. package/resources/v1/contracts/contracts.d.ts +406 -1
  108. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  109. package/resources/v1/contracts/contracts.js.map +1 -1
  110. package/resources/v1/contracts/contracts.mjs.map +1 -1
  111. package/resources/v1/contracts/index.d.mts.map +1 -1
  112. package/resources/v1/contracts/index.d.ts.map +1 -1
  113. package/resources/v1/contracts/index.mjs.map +1 -1
  114. package/resources/v1/contracts/named-schedules.d.mts.map +1 -1
  115. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  116. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  117. package/resources/v1/contracts/products.d.mts.map +1 -1
  118. package/resources/v1/contracts/products.d.ts.map +1 -1
  119. package/resources/v1/contracts/products.mjs.map +1 -1
  120. package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -1
  121. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
  122. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
  123. package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -1
  124. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  125. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  126. package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -1
  127. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  128. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  129. package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -1
  130. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  131. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  132. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
  133. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  134. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  135. package/resources/v1/contracts/rate-cards.d.mts.map +1 -1
  136. package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
  137. package/resources/v1/contracts/rate-cards.mjs.map +1 -1
  138. package/resources/v1/contracts.d.mts.map +1 -1
  139. package/resources/v1/contracts.d.ts.map +1 -1
  140. package/resources/v1/contracts.mjs.map +1 -1
  141. package/resources/v1/credit-grants.d.mts.map +1 -1
  142. package/resources/v1/credit-grants.d.ts.map +1 -1
  143. package/resources/v1/credit-grants.mjs.map +1 -1
  144. package/resources/v1/custom-fields.d.mts.map +1 -1
  145. package/resources/v1/custom-fields.d.ts.map +1 -1
  146. package/resources/v1/custom-fields.mjs.map +1 -1
  147. package/resources/v1/customers/alerts.d.mts.map +1 -1
  148. package/resources/v1/customers/alerts.d.ts.map +1 -1
  149. package/resources/v1/customers/alerts.mjs.map +1 -1
  150. package/resources/v1/customers/billing-config.d.mts.map +1 -1
  151. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  152. package/resources/v1/customers/billing-config.mjs.map +1 -1
  153. package/resources/v1/customers/commits.d.mts.map +1 -1
  154. package/resources/v1/customers/commits.d.ts.map +1 -1
  155. package/resources/v1/customers/commits.mjs.map +1 -1
  156. package/resources/v1/customers/credits.d.mts.map +1 -1
  157. package/resources/v1/customers/credits.d.ts.map +1 -1
  158. package/resources/v1/customers/credits.mjs.map +1 -1
  159. package/resources/v1/customers/customers.d.mts.map +1 -1
  160. package/resources/v1/customers/customers.d.ts.map +1 -1
  161. package/resources/v1/customers/customers.mjs.map +1 -1
  162. package/resources/v1/customers/index.d.mts.map +1 -1
  163. package/resources/v1/customers/index.d.ts.map +1 -1
  164. package/resources/v1/customers/index.mjs.map +1 -1
  165. package/resources/v1/customers/invoices.d.mts.map +1 -1
  166. package/resources/v1/customers/invoices.d.ts.map +1 -1
  167. package/resources/v1/customers/invoices.mjs.map +1 -1
  168. package/resources/v1/customers/named-schedules.d.mts.map +1 -1
  169. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  170. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  171. package/resources/v1/customers/plans.d.mts.map +1 -1
  172. package/resources/v1/customers/plans.d.ts.map +1 -1
  173. package/resources/v1/customers/plans.mjs.map +1 -1
  174. package/resources/v1/customers.d.mts.map +1 -1
  175. package/resources/v1/customers.d.ts.map +1 -1
  176. package/resources/v1/customers.mjs.map +1 -1
  177. package/resources/v1/dashboards.d.mts.map +1 -1
  178. package/resources/v1/dashboards.d.ts.map +1 -1
  179. package/resources/v1/dashboards.mjs.map +1 -1
  180. package/resources/v1/index.d.mts +0 -1
  181. package/resources/v1/index.d.mts.map +1 -1
  182. package/resources/v1/index.d.ts +0 -1
  183. package/resources/v1/index.d.ts.map +1 -1
  184. package/resources/v1/index.js +1 -3
  185. package/resources/v1/index.js.map +1 -1
  186. package/resources/v1/index.mjs +0 -1
  187. package/resources/v1/index.mjs.map +1 -1
  188. package/resources/v1/invoices.d.mts.map +1 -1
  189. package/resources/v1/invoices.d.ts.map +1 -1
  190. package/resources/v1/invoices.mjs.map +1 -1
  191. package/resources/v1/packages.d.mts +57 -4
  192. package/resources/v1/packages.d.mts.map +1 -1
  193. package/resources/v1/packages.d.ts +57 -4
  194. package/resources/v1/packages.d.ts.map +1 -1
  195. package/resources/v1/packages.js +3 -4
  196. package/resources/v1/packages.js.map +1 -1
  197. package/resources/v1/packages.mjs +3 -4
  198. package/resources/v1/packages.mjs.map +1 -1
  199. package/resources/v1/plans.d.mts.map +1 -1
  200. package/resources/v1/plans.d.ts.map +1 -1
  201. package/resources/v1/plans.mjs.map +1 -1
  202. package/resources/v1/pricing-units.d.mts.map +1 -1
  203. package/resources/v1/pricing-units.d.ts.map +1 -1
  204. package/resources/v1/pricing-units.mjs.map +1 -1
  205. package/resources/v1/services.d.mts.map +1 -1
  206. package/resources/v1/services.d.ts.map +1 -1
  207. package/resources/v1/services.mjs.map +1 -1
  208. package/resources/v1/settings/billing-providers.d.mts.map +1 -1
  209. package/resources/v1/settings/billing-providers.d.ts.map +1 -1
  210. package/resources/v1/settings/billing-providers.mjs.map +1 -1
  211. package/resources/v1/settings/index.d.mts.map +1 -1
  212. package/resources/v1/settings/index.d.ts.map +1 -1
  213. package/resources/v1/settings/index.mjs.map +1 -1
  214. package/resources/v1/settings/settings.d.mts.map +1 -1
  215. package/resources/v1/settings/settings.d.ts.map +1 -1
  216. package/resources/v1/settings/settings.mjs.map +1 -1
  217. package/resources/v1/settings.d.mts.map +1 -1
  218. package/resources/v1/settings.d.ts.map +1 -1
  219. package/resources/v1/settings.mjs.map +1 -1
  220. package/resources/v1/usage.d.mts.map +1 -1
  221. package/resources/v1/usage.d.ts.map +1 -1
  222. package/resources/v1/usage.mjs.map +1 -1
  223. package/resources/v1/v1.d.mts +0 -4
  224. package/resources/v1/v1.d.mts.map +1 -1
  225. package/resources/v1/v1.d.ts +0 -4
  226. package/resources/v1/v1.d.ts.map +1 -1
  227. package/resources/v1/v1.js +0 -4
  228. package/resources/v1/v1.js.map +1 -1
  229. package/resources/v1/v1.mjs +0 -4
  230. package/resources/v1/v1.mjs.map +1 -1
  231. package/resources/v1.d.mts.map +1 -1
  232. package/resources/v1.d.ts.map +1 -1
  233. package/resources/v1.mjs.map +1 -1
  234. package/resources/v2/contracts.d.mts +1337 -1
  235. package/resources/v2/contracts.d.mts.map +1 -1
  236. package/resources/v2/contracts.d.ts +1337 -1
  237. package/resources/v2/contracts.d.ts.map +1 -1
  238. package/resources/v2/contracts.mjs.map +1 -1
  239. package/resources/v2/index.d.mts.map +1 -1
  240. package/resources/v2/index.d.ts.map +1 -1
  241. package/resources/v2/index.mjs.map +1 -1
  242. package/resources/v2/v2.d.mts.map +1 -1
  243. package/resources/v2/v2.d.ts.map +1 -1
  244. package/resources/v2/v2.mjs.map +1 -1
  245. package/resources/v2.d.mts.map +1 -1
  246. package/resources/v2.d.ts.map +1 -1
  247. package/resources/v2.mjs.map +1 -1
  248. package/resources/webhooks.d.mts.map +1 -1
  249. package/resources/webhooks.d.ts.map +1 -1
  250. package/resources/webhooks.mjs.map +1 -1
  251. package/resources.d.mts.map +1 -1
  252. package/resources.d.ts.map +1 -1
  253. package/resources.mjs.map +1 -1
  254. package/src/resources/shared.ts +290 -0
  255. package/src/resources/v1/contracts/contracts.ts +530 -1
  256. package/src/resources/v1/index.ts +0 -11
  257. package/src/resources/v1/packages.ts +81 -4
  258. package/src/resources/v1/v1.ts +0 -26
  259. package/src/resources/v2/contracts.ts +1756 -1
  260. package/src/version.ts +1 -1
  261. package/uploads.d.mts +1 -0
  262. package/uploads.d.mts.map +1 -1
  263. package/uploads.d.ts +1 -0
  264. package/uploads.d.ts.map +1 -1
  265. package/uploads.mjs +1 -0
  266. package/uploads.mjs.map +1 -1
  267. package/version.d.mts +1 -1
  268. package/version.d.ts +1 -1
  269. package/version.js +1 -1
  270. package/version.mjs +1 -1
  271. package/resources/v1/payments.d.mts +0 -127
  272. package/resources/v1/payments.d.mts.map +0 -1
  273. package/resources/v1/payments.d.ts +0 -127
  274. package/resources/v1/payments.d.ts.map +0 -1
  275. package/resources/v1/payments.js +0 -71
  276. package/resources/v1/payments.js.map +0 -1
  277. package/resources/v1/payments.mjs +0 -67
  278. package/resources/v1/payments.mjs.map +0 -1
  279. package/src/resources/v1/payments.ts +0 -187
@@ -183,6 +183,11 @@ export interface Commit {
183
183
  */
184
184
  specifiers?: Array<CommitSpecifier>;
185
185
 
186
+ /**
187
+ * Optional attributes controlling how this commit interacts with spend trackers.
188
+ */
189
+ spend_tracker_attributes?: Commit.SpendTrackerAttributes;
190
+
186
191
  /**
187
192
  * The subscription configuration for this commit, if it was generated from a
188
193
  * recurring commit with a subscription attached.
@@ -380,6 +385,17 @@ export namespace Commit {
380
385
  contract_id: string;
381
386
  }
382
387
 
388
+ /**
389
+ * Optional attributes controlling how this commit interacts with spend trackers.
390
+ */
391
+ export interface SpendTrackerAttributes {
392
+ /**
393
+ * If true, this commit is included in spend trackers with discounted set to
394
+ * DISCOUNTED_ONLY
395
+ */
396
+ counts_as_discounted: boolean;
397
+ }
398
+
383
399
  /**
384
400
  * The subscription configuration for this commit, if it was generated from a
385
401
  * recurring commit with a subscription attached.
@@ -532,6 +548,11 @@ export interface Contract {
532
548
 
533
549
  spend_threshold_configuration?: SpendThresholdConfiguration;
534
550
 
551
+ /**
552
+ * Spend trackers attached to this contract.
553
+ */
554
+ spend_trackers?: Array<Contract.SpendTracker>;
555
+
535
556
  /**
536
557
  * List of subscriptions on the contract.
537
558
  */
@@ -642,6 +663,39 @@ export namespace Contract {
642
663
  */
643
664
  configuration?: { [key: string]: unknown };
644
665
  }
666
+
667
+ export interface SpendTracker {
668
+ /**
669
+ * Human-readable identifier, unique per contract.
670
+ */
671
+ alias: string;
672
+
673
+ applicable_spend_specifiers: Array<SpendTracker.ApplicableSpendSpecifier>;
674
+
675
+ credit_type_id: string;
676
+
677
+ reset_frequency: 'BILLING_PERIOD';
678
+
679
+ accumulated_spend?: SpendTracker.AccumulatedSpend;
680
+ }
681
+
682
+ export namespace SpendTracker {
683
+ export interface ApplicableSpendSpecifier {
684
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
685
+
686
+ spend_type: 'COMMIT_PURCHASE';
687
+
688
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
689
+ }
690
+
691
+ export interface AccumulatedSpend {
692
+ amount: number;
693
+
694
+ period_ending_before: string;
695
+
696
+ period_starting_at: string;
697
+ }
698
+ }
645
699
  }
646
700
 
647
701
  export interface ContractV2 {
@@ -758,6 +812,11 @@ export interface ContractV2 {
758
812
 
759
813
  spend_threshold_configuration?: SpendThresholdConfigurationV2;
760
814
 
815
+ /**
816
+ * Spend trackers attached to this contract.
817
+ */
818
+ spend_trackers?: Array<ContractV2.SpendTracker>;
819
+
761
820
  /**
762
821
  * List of subscriptions on the contract.
763
822
  */
@@ -895,6 +954,11 @@ export namespace ContractV2 {
895
954
  */
896
955
  specifiers?: Array<Shared.CommitSpecifier>;
897
956
 
957
+ /**
958
+ * Optional attributes controlling how this commit interacts with spend trackers.
959
+ */
960
+ spend_tracker_attributes?: Commit.SpendTrackerAttributes;
961
+
898
962
  /**
899
963
  * Attach a subscription to the recurring commit/credit.
900
964
  */
@@ -1082,6 +1146,17 @@ export namespace ContractV2 {
1082
1146
 
1083
1147
  contract_id: string;
1084
1148
  }
1149
+
1150
+ /**
1151
+ * Optional attributes controlling how this commit interacts with spend trackers.
1152
+ */
1153
+ export interface SpendTrackerAttributes {
1154
+ /**
1155
+ * If true, this commit is included in spend trackers with discounted set to
1156
+ * DISCOUNTED_ONLY
1157
+ */
1158
+ counts_as_discounted: boolean;
1159
+ }
1085
1160
  }
1086
1161
 
1087
1162
  export interface Override {
@@ -1858,6 +1933,39 @@ export namespace ContractV2 {
1858
1933
  }
1859
1934
  }
1860
1935
 
1936
+ export interface SpendTracker {
1937
+ /**
1938
+ * Human-readable identifier, unique per contract.
1939
+ */
1940
+ alias: string;
1941
+
1942
+ applicable_spend_specifiers: Array<SpendTracker.ApplicableSpendSpecifier>;
1943
+
1944
+ credit_type_id: string;
1945
+
1946
+ reset_frequency: 'BILLING_PERIOD';
1947
+
1948
+ accumulated_spend?: SpendTracker.AccumulatedSpend;
1949
+ }
1950
+
1951
+ export namespace SpendTracker {
1952
+ export interface ApplicableSpendSpecifier {
1953
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
1954
+
1955
+ spend_type: 'COMMIT_PURCHASE';
1956
+
1957
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
1958
+ }
1959
+
1960
+ export interface AccumulatedSpend {
1961
+ amount: number;
1962
+
1963
+ period_ending_before: string;
1964
+
1965
+ period_starting_at: string;
1966
+ }
1967
+ }
1968
+
1861
1969
  export interface Subscription {
1862
1970
  /**
1863
1971
  * Previous, current, and next billing periods for the subscription.
@@ -2058,6 +2166,11 @@ export interface ContractWithoutAmendments {
2058
2166
 
2059
2167
  spend_threshold_configuration?: SpendThresholdConfiguration;
2060
2168
 
2169
+ /**
2170
+ * Spend trackers attached to this contract.
2171
+ */
2172
+ spend_trackers?: Array<ContractWithoutAmendments.SpendTracker>;
2173
+
2061
2174
  /**
2062
2175
  * This field's availability is dependent on your client's configuration.
2063
2176
  */
@@ -2396,6 +2509,39 @@ export namespace ContractWithoutAmendments {
2396
2509
  reseller_contract_value?: number;
2397
2510
  }
2398
2511
 
2512
+ export interface SpendTracker {
2513
+ /**
2514
+ * Human-readable identifier, unique per contract.
2515
+ */
2516
+ alias: string;
2517
+
2518
+ applicable_spend_specifiers: Array<SpendTracker.ApplicableSpendSpecifier>;
2519
+
2520
+ credit_type_id: string;
2521
+
2522
+ reset_frequency: 'BILLING_PERIOD';
2523
+
2524
+ accumulated_spend?: SpendTracker.AccumulatedSpend;
2525
+ }
2526
+
2527
+ export namespace SpendTracker {
2528
+ export interface ApplicableSpendSpecifier {
2529
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
2530
+
2531
+ spend_type: 'COMMIT_PURCHASE';
2532
+
2533
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
2534
+ }
2535
+
2536
+ export interface AccumulatedSpend {
2537
+ amount: number;
2538
+
2539
+ period_ending_before: string;
2540
+
2541
+ period_starting_at: string;
2542
+ }
2543
+ }
2544
+
2399
2545
  export interface UsageFilter {
2400
2546
  current: Shared.BaseUsageFilter | null;
2401
2547
 
@@ -3075,6 +3221,8 @@ export interface PrepaidBalanceThresholdConfiguration {
3075
3221
  custom_credit_type_id?: string;
3076
3222
 
3077
3223
  discount_configuration?: PrepaidBalanceThresholdConfiguration.DiscountConfiguration;
3224
+
3225
+ threshold_balance_specifiers?: Array<PrepaidBalanceThresholdConfiguration.ThresholdBalanceSpecifier>;
3078
3226
  }
3079
3227
 
3080
3228
  export namespace PrepaidBalanceThresholdConfiguration {
@@ -3109,6 +3257,54 @@ export namespace PrepaidBalanceThresholdConfiguration {
3109
3257
  * (a 15% discount).
3110
3258
  */
3111
3259
  payment_fraction: number;
3260
+
3261
+ /**
3262
+ * If provided, the discount stops applying once the spend tracker has accumulated
3263
+ * this much spend in the billing period.
3264
+ */
3265
+ cap?: DiscountConfiguration.Cap;
3266
+ }
3267
+
3268
+ export namespace DiscountConfiguration {
3269
+ /**
3270
+ * If provided, the discount stops applying once the spend tracker has accumulated
3271
+ * this much spend in the billing period.
3272
+ */
3273
+ export interface Cap {
3274
+ /**
3275
+ * Accumulated spend ceiling above which the discount stops applying.
3276
+ */
3277
+ amount: number;
3278
+
3279
+ /**
3280
+ * Alias of the spend tracker this cap is measured against.
3281
+ */
3282
+ spend_tracker_alias: string;
3283
+ }
3284
+ }
3285
+
3286
+ export interface ThresholdBalanceSpecifier {
3287
+ exclude: Array<ThresholdBalanceSpecifier.Exclude>;
3288
+ }
3289
+
3290
+ export namespace ThresholdBalanceSpecifier {
3291
+ export interface Exclude {
3292
+ /**
3293
+ * If provided, balances with all the custom fields will not be considered when
3294
+ * evaluating threshold billing
3295
+ */
3296
+ custom_field_filters: Array<Exclude.CustomFieldFilter>;
3297
+ }
3298
+
3299
+ export namespace Exclude {
3300
+ export interface CustomFieldFilter {
3301
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
3302
+
3303
+ key: string;
3304
+
3305
+ value: string;
3306
+ }
3307
+ }
3112
3308
  }
3113
3309
  }
3114
3310
 
@@ -3142,6 +3338,8 @@ export interface PrepaidBalanceThresholdConfigurationV2 {
3142
3338
  custom_credit_type_id?: string;
3143
3339
 
3144
3340
  discount_configuration?: PrepaidBalanceThresholdConfigurationV2.DiscountConfiguration;
3341
+
3342
+ threshold_balance_specifiers?: Array<PrepaidBalanceThresholdConfigurationV2.ThresholdBalanceSpecifier>;
3145
3343
  }
3146
3344
 
3147
3345
  export namespace PrepaidBalanceThresholdConfigurationV2 {
@@ -3178,6 +3376,50 @@ export namespace PrepaidBalanceThresholdConfigurationV2 {
3178
3376
  * (a 15% discount).
3179
3377
  */
3180
3378
  payment_fraction: number;
3379
+
3380
+ /**
3381
+ * If provided, the discount stops applying once the spend tracker has accumulated
3382
+ * this much spend in the billing period.
3383
+ */
3384
+ cap?: DiscountConfiguration.Cap;
3385
+ }
3386
+
3387
+ export namespace DiscountConfiguration {
3388
+ /**
3389
+ * If provided, the discount stops applying once the spend tracker has accumulated
3390
+ * this much spend in the billing period.
3391
+ */
3392
+ export interface Cap {
3393
+ /**
3394
+ * Accumulated spend ceiling above which the discount stops applying.
3395
+ */
3396
+ amount: number;
3397
+
3398
+ /**
3399
+ * Alias of the spend tracker this cap is measured against.
3400
+ */
3401
+ spend_tracker_alias: string;
3402
+ }
3403
+ }
3404
+
3405
+ export interface ThresholdBalanceSpecifier {
3406
+ exclude: Array<ThresholdBalanceSpecifier.Exclude>;
3407
+ }
3408
+
3409
+ export namespace ThresholdBalanceSpecifier {
3410
+ export interface Exclude {
3411
+ custom_field_filters: Array<Exclude.CustomFieldFilter>;
3412
+ }
3413
+
3414
+ export namespace Exclude {
3415
+ export interface CustomFieldFilter {
3416
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
3417
+
3418
+ key: string;
3419
+
3420
+ value: string;
3421
+ }
3422
+ }
3181
3423
  }
3182
3424
  }
3183
3425
 
@@ -3412,6 +3654,30 @@ export namespace SpendThresholdConfiguration {
3412
3654
  * (a 15% discount).
3413
3655
  */
3414
3656
  payment_fraction: number;
3657
+
3658
+ /**
3659
+ * If provided, the discount stops applying once the spend tracker has accumulated
3660
+ * this much spend in the billing period.
3661
+ */
3662
+ cap?: DiscountConfiguration.Cap;
3663
+ }
3664
+
3665
+ export namespace DiscountConfiguration {
3666
+ /**
3667
+ * If provided, the discount stops applying once the spend tracker has accumulated
3668
+ * this much spend in the billing period.
3669
+ */
3670
+ export interface Cap {
3671
+ /**
3672
+ * Accumulated spend ceiling above which the discount stops applying.
3673
+ */
3674
+ amount: number;
3675
+
3676
+ /**
3677
+ * Alias of the spend tracker this cap is measured against.
3678
+ */
3679
+ spend_tracker_alias: string;
3680
+ }
3415
3681
  }
3416
3682
  }
3417
3683
 
@@ -3444,6 +3710,30 @@ export namespace SpendThresholdConfigurationV2 {
3444
3710
  * (a 15% discount).
3445
3711
  */
3446
3712
  payment_fraction: number;
3713
+
3714
+ /**
3715
+ * If provided, the discount stops applying once the spend tracker has accumulated
3716
+ * this much spend in the billing period.
3717
+ */
3718
+ cap?: DiscountConfiguration.Cap;
3719
+ }
3720
+
3721
+ export namespace DiscountConfiguration {
3722
+ /**
3723
+ * If provided, the discount stops applying once the spend tracker has accumulated
3724
+ * this much spend in the billing period.
3725
+ */
3726
+ export interface Cap {
3727
+ /**
3728
+ * Accumulated spend ceiling above which the discount stops applying.
3729
+ */
3730
+ amount: number;
3731
+
3732
+ /**
3733
+ * Alias of the spend tracker this cap is measured against.
3734
+ */
3735
+ spend_tracker_alias: string;
3736
+ }
3447
3737
  }
3448
3738
  }
3449
3739