orb-billing 1.13.0 → 1.15.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 (624) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +55 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +21 -0
  5. data/lib/orb/internal/transport/base_client.rb +5 -0
  6. data/lib/orb/internal/type/union.rb +13 -27
  7. data/lib/orb/internal/util.rb +22 -7
  8. data/lib/orb/models/accounting_provider_config.rb +14 -3
  9. data/lib/orb/models/adjustment_interval.rb +185 -3
  10. data/lib/orb/models/alert.rb +114 -1
  11. data/lib/orb/models/alert_create_for_customer_params.rb +8 -1
  12. data/lib/orb/models/alert_create_for_external_customer_params.rb +8 -1
  13. data/lib/orb/models/alert_create_for_subscription_params.rb +142 -1
  14. data/lib/orb/models/alert_disable_params.rb +8 -1
  15. data/lib/orb/models/alert_enable_params.rb +8 -1
  16. data/lib/orb/models/alert_retrieve_params.rb +7 -1
  17. data/lib/orb/models/alert_update_params.rb +120 -1
  18. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +3296 -631
  19. data/lib/orb/models/beta/external_plan_id_fetch_plan_version_params.rb +7 -1
  20. data/lib/orb/models/beta/external_plan_id_set_default_plan_version_params.rb +8 -1
  21. data/lib/orb/models/beta_create_plan_version_params.rb +3263 -622
  22. data/lib/orb/models/beta_fetch_plan_version_params.rb +7 -1
  23. data/lib/orb/models/beta_set_default_plan_version_params.rb +8 -1
  24. data/lib/orb/models/changed_subscription_resources.rb +200 -10
  25. data/lib/orb/models/conversion_rate_config.rb +18 -0
  26. data/lib/orb/models/coupon_archive_params.rb +7 -1
  27. data/lib/orb/models/coupon_fetch_params.rb +7 -1
  28. data/lib/orb/models/coupons/subscription_list_params.rb +8 -1
  29. data/lib/orb/models/credit_block_delete_params.rb +7 -1
  30. data/lib/orb/models/credit_block_list_invoices_params.rb +7 -1
  31. data/lib/orb/models/credit_block_list_invoices_response.rb +155 -1
  32. data/lib/orb/models/credit_block_retrieve_params.rb +7 -1
  33. data/lib/orb/models/credit_block_retrieve_response.rb +150 -1
  34. data/lib/orb/models/credit_note_fetch_params.rb +7 -1
  35. data/lib/orb/models/customer.rb +122 -3
  36. data/lib/orb/models/customer_create_params.rb +17 -1
  37. data/lib/orb/models/customer_delete_params.rb +7 -1
  38. data/lib/orb/models/customer_fetch_by_external_id_params.rb +7 -1
  39. data/lib/orb/models/customer_fetch_params.rb +7 -1
  40. data/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rb +7 -1
  41. data/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rb +7 -1
  42. data/lib/orb/models/customer_tax_id.rb +15 -1
  43. data/lib/orb/models/customer_update_by_external_id_params.rb +39 -5
  44. data/lib/orb/models/customer_update_params.rb +39 -5
  45. data/lib/orb/models/customers/balance_transaction_create_params.rb +8 -1
  46. data/lib/orb/models/customers/balance_transaction_list_params.rb +8 -1
  47. data/lib/orb/models/customers/cost_list_by_external_id_params.rb +8 -1
  48. data/lib/orb/models/customers/cost_list_params.rb +8 -1
  49. data/lib/orb/models/customers/credit_list_by_external_id_params.rb +8 -1
  50. data/lib/orb/models/customers/credit_list_by_external_id_response.rb +155 -1
  51. data/lib/orb/models/customers/credit_list_params.rb +8 -1
  52. data/lib/orb/models/customers/credit_list_response.rb +152 -1
  53. data/lib/orb/models/customers/credits/decrement_ledger_entry.rb +5 -1
  54. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +582 -315
  55. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +580 -313
  56. data/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rb +8 -1
  57. data/lib/orb/models/customers/credits/ledger_list_params.rb +8 -1
  58. data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +8 -1
  59. data/lib/orb/models/customers/credits/top_up_create_params.rb +8 -1
  60. data/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rb +7 -1
  61. data/lib/orb/models/customers/credits/top_up_delete_params.rb +7 -1
  62. data/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rb +8 -1
  63. data/lib/orb/models/customers/credits/top_up_list_params.rb +8 -1
  64. data/lib/orb/models/dimensional_price_group.rb +1 -1
  65. data/lib/orb/models/dimensional_price_group_retrieve_params.rb +7 -1
  66. data/lib/orb/models/dimensional_price_group_update_params.rb +8 -1
  67. data/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rb +7 -1
  68. data/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_update_params.rb +8 -1
  69. data/lib/orb/models/discount.rb +145 -1
  70. data/lib/orb/models/event_deprecate_params.rb +7 -1
  71. data/lib/orb/models/event_ingest_params.rb +5 -2
  72. data/lib/orb/models/event_update_params.rb +8 -1
  73. data/lib/orb/models/events/backfill_close_params.rb +7 -1
  74. data/lib/orb/models/events/backfill_fetch_params.rb +7 -1
  75. data/lib/orb/models/events/backfill_revert_params.rb +7 -1
  76. data/lib/orb/models/invoice.rb +198 -10
  77. data/lib/orb/models/invoice_create_params.rb +6 -5
  78. data/lib/orb/models/invoice_delete_line_item_params.rb +7 -1
  79. data/lib/orb/models/invoice_fetch_params.rb +7 -1
  80. data/lib/orb/models/invoice_fetch_upcoming_response.rb +200 -10
  81. data/lib/orb/models/invoice_issue_params.rb +8 -1
  82. data/lib/orb/models/invoice_issue_summary_params.rb +8 -1
  83. data/lib/orb/models/invoice_issue_summary_response.rb +9 -3
  84. data/lib/orb/models/invoice_level_discount.rb +145 -1
  85. data/lib/orb/models/invoice_line_item_create_response.rb +189 -5
  86. data/lib/orb/models/invoice_list_summary_response.rb +9 -3
  87. data/lib/orb/models/invoice_mark_paid_params.rb +8 -1
  88. data/lib/orb/models/invoice_pay_params.rb +16 -1
  89. data/lib/orb/models/invoice_update_params.rb +8 -1
  90. data/lib/orb/models/invoice_void_params.rb +7 -1
  91. data/lib/orb/models/item_archive_params.rb +7 -1
  92. data/lib/orb/models/item_fetch_params.rb +7 -1
  93. data/lib/orb/models/item_update_params.rb +8 -1
  94. data/lib/orb/models/license_deactivate_params.rb +8 -1
  95. data/lib/orb/models/license_retrieve_by_external_id_params.rb +8 -1
  96. data/lib/orb/models/license_retrieve_params.rb +7 -1
  97. data/lib/orb/models/license_type_retrieve_params.rb +7 -1
  98. data/lib/orb/models/licenses/external_license_get_usage_params.rb +11 -4
  99. data/lib/orb/models/licenses/usage_get_all_usage_params.rb +3 -3
  100. data/lib/orb/models/licenses/usage_get_usage_params.rb +11 -4
  101. data/lib/orb/models/metric_fetch_params.rb +7 -1
  102. data/lib/orb/models/metric_update_params.rb +8 -1
  103. data/lib/orb/models/mutated_subscription.rb +169 -4
  104. data/lib/orb/models/new_allocation_price.rb +11 -1
  105. data/lib/orb/models/new_floating_bulk_price.rb +1 -3
  106. data/lib/orb/models/new_floating_bulk_with_proration_price.rb +1 -3
  107. data/lib/orb/models/new_floating_cumulative_grouped_bulk_price.rb +1 -3
  108. data/lib/orb/models/new_floating_grouped_allocation_price.rb +1 -3
  109. data/lib/orb/models/new_floating_grouped_tiered_package_price.rb +1 -3
  110. data/lib/orb/models/new_floating_grouped_tiered_price.rb +1 -3
  111. data/lib/orb/models/new_floating_grouped_with_metered_minimum_price.rb +1 -3
  112. data/lib/orb/models/new_floating_grouped_with_prorated_minimum_price.rb +1 -3
  113. data/lib/orb/models/new_floating_matrix_price.rb +1 -3
  114. data/lib/orb/models/new_floating_matrix_with_allocation_price.rb +1 -3
  115. data/lib/orb/models/new_floating_matrix_with_display_name_price.rb +1 -3
  116. data/lib/orb/models/new_floating_max_group_tiered_package_price.rb +1 -3
  117. data/lib/orb/models/new_floating_minimum_composite_price.rb +1 -3
  118. data/lib/orb/models/new_floating_package_price.rb +1 -3
  119. data/lib/orb/models/new_floating_package_with_allocation_price.rb +1 -3
  120. data/lib/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rb +1 -3
  121. data/lib/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rb +1 -3
  122. data/lib/orb/models/new_floating_threshold_total_amount_price.rb +1 -3
  123. data/lib/orb/models/new_floating_tiered_package_price.rb +1 -3
  124. data/lib/orb/models/new_floating_tiered_package_with_minimum_price.rb +1 -3
  125. data/lib/orb/models/new_floating_tiered_price.rb +1 -3
  126. data/lib/orb/models/new_floating_tiered_with_minimum_price.rb +1 -3
  127. data/lib/orb/models/new_floating_tiered_with_proration_price.rb +1 -3
  128. data/lib/orb/models/new_floating_unit_price.rb +1 -3
  129. data/lib/orb/models/new_floating_unit_with_percent_price.rb +1 -3
  130. data/lib/orb/models/new_floating_unit_with_proration_price.rb +1 -3
  131. data/lib/orb/models/new_plan_bulk_price.rb +1 -1
  132. data/lib/orb/models/new_plan_bulk_with_proration_price.rb +1 -3
  133. data/lib/orb/models/new_plan_cumulative_grouped_bulk_price.rb +1 -3
  134. data/lib/orb/models/new_plan_grouped_allocation_price.rb +1 -3
  135. data/lib/orb/models/new_plan_grouped_tiered_package_price.rb +1 -3
  136. data/lib/orb/models/new_plan_grouped_tiered_price.rb +1 -3
  137. data/lib/orb/models/new_plan_grouped_with_metered_minimum_price.rb +1 -3
  138. data/lib/orb/models/new_plan_grouped_with_prorated_minimum_price.rb +1 -3
  139. data/lib/orb/models/new_plan_matrix_price.rb +1 -5
  140. data/lib/orb/models/new_plan_matrix_with_allocation_price.rb +1 -3
  141. data/lib/orb/models/new_plan_matrix_with_display_name_price.rb +1 -3
  142. data/lib/orb/models/new_plan_max_group_tiered_package_price.rb +1 -3
  143. data/lib/orb/models/new_plan_minimum_composite_price.rb +1 -3
  144. data/lib/orb/models/new_plan_package_price.rb +1 -5
  145. data/lib/orb/models/new_plan_package_with_allocation_price.rb +1 -3
  146. data/lib/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rb +1 -3
  147. data/lib/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rb +1 -3
  148. data/lib/orb/models/new_plan_threshold_total_amount_price.rb +1 -3
  149. data/lib/orb/models/new_plan_tiered_package_price.rb +1 -3
  150. data/lib/orb/models/new_plan_tiered_package_with_minimum_price.rb +1 -3
  151. data/lib/orb/models/new_plan_tiered_price.rb +1 -5
  152. data/lib/orb/models/new_plan_tiered_with_minimum_price.rb +1 -3
  153. data/lib/orb/models/new_plan_unit_price.rb +1 -1
  154. data/lib/orb/models/new_plan_unit_with_percent_price.rb +1 -3
  155. data/lib/orb/models/new_plan_unit_with_proration_price.rb +1 -3
  156. data/lib/orb/models/new_subscription_bulk_price.rb +1 -3
  157. data/lib/orb/models/new_subscription_bulk_with_proration_price.rb +1 -3
  158. data/lib/orb/models/new_subscription_cumulative_grouped_bulk_price.rb +1 -3
  159. data/lib/orb/models/new_subscription_grouped_allocation_price.rb +1 -3
  160. data/lib/orb/models/new_subscription_grouped_tiered_package_price.rb +1 -3
  161. data/lib/orb/models/new_subscription_grouped_tiered_price.rb +1 -3
  162. data/lib/orb/models/new_subscription_grouped_with_metered_minimum_price.rb +1 -3
  163. data/lib/orb/models/new_subscription_grouped_with_prorated_minimum_price.rb +1 -3
  164. data/lib/orb/models/new_subscription_matrix_price.rb +1 -3
  165. data/lib/orb/models/new_subscription_matrix_with_allocation_price.rb +1 -3
  166. data/lib/orb/models/new_subscription_matrix_with_display_name_price.rb +1 -3
  167. data/lib/orb/models/new_subscription_max_group_tiered_package_price.rb +1 -3
  168. data/lib/orb/models/new_subscription_minimum_composite_price.rb +1 -3
  169. data/lib/orb/models/new_subscription_package_price.rb +1 -3
  170. data/lib/orb/models/new_subscription_package_with_allocation_price.rb +1 -3
  171. data/lib/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rb +1 -3
  172. data/lib/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb +1 -3
  173. data/lib/orb/models/new_subscription_threshold_total_amount_price.rb +1 -3
  174. data/lib/orb/models/new_subscription_tiered_package_price.rb +1 -3
  175. data/lib/orb/models/new_subscription_tiered_package_with_minimum_price.rb +1 -3
  176. data/lib/orb/models/new_subscription_tiered_price.rb +1 -3
  177. data/lib/orb/models/new_subscription_tiered_with_minimum_price.rb +1 -3
  178. data/lib/orb/models/new_subscription_unit_price.rb +1 -3
  179. data/lib/orb/models/new_subscription_unit_with_percent_price.rb +1 -3
  180. data/lib/orb/models/new_subscription_unit_with_proration_price.rb +1 -3
  181. data/lib/orb/models/per_price_cost.rb +2 -2
  182. data/lib/orb/models/plan.rb +189 -9
  183. data/lib/orb/models/plan_create_params.rb +1478 -158
  184. data/lib/orb/models/plan_fetch_params.rb +7 -1
  185. data/lib/orb/models/plan_update_params.rb +16 -1
  186. data/lib/orb/models/plan_version.rb +186 -5
  187. data/lib/orb/models/plans/external_plan_id_fetch_params.rb +7 -1
  188. data/lib/orb/models/plans/external_plan_id_update_params.rb +16 -1
  189. data/lib/orb/models/plans/migration_cancel_params.rb +7 -1
  190. data/lib/orb/models/plans/migration_cancel_response.rb +22 -4
  191. data/lib/orb/models/plans/migration_list_params.rb +8 -1
  192. data/lib/orb/models/plans/migration_list_response.rb +22 -4
  193. data/lib/orb/models/plans/migration_retrieve_params.rb +7 -1
  194. data/lib/orb/models/plans/migration_retrieve_response.rb +22 -4
  195. data/lib/orb/models/price.rb +2807 -1244
  196. data/lib/orb/models/price_create_params.rb +1800 -1355
  197. data/lib/orb/models/price_evaluate_multiple_params.rb +889 -54
  198. data/lib/orb/models/price_evaluate_params.rb +8 -1
  199. data/lib/orb/models/price_evaluate_preview_events_params.rb +881 -46
  200. data/lib/orb/models/price_fetch_params.rb +7 -1
  201. data/lib/orb/models/price_interval.rb +2 -2
  202. data/lib/orb/models/price_update_params.rb +8 -1
  203. data/lib/orb/models/prices/external_price_id_fetch_params.rb +7 -1
  204. data/lib/orb/models/prices/external_price_id_update_params.rb +8 -1
  205. data/lib/orb/models/subscription.rb +168 -4
  206. data/lib/orb/models/subscription_cancel_params.rb +8 -1
  207. data/lib/orb/models/subscription_change_apply_params.rb +8 -1
  208. data/lib/orb/models/subscription_change_cancel_params.rb +7 -1
  209. data/lib/orb/models/subscription_change_retrieve_params.rb +7 -1
  210. data/lib/orb/models/subscription_create_params.rb +2818 -674
  211. data/lib/orb/models/subscription_fetch_costs_params.rb +8 -1
  212. data/lib/orb/models/subscription_fetch_params.rb +7 -1
  213. data/lib/orb/models/subscription_fetch_schedule_params.rb +8 -1
  214. data/lib/orb/models/subscription_fetch_usage_params.rb +8 -1
  215. data/lib/orb/models/subscription_price_intervals_params.rb +1103 -55
  216. data/lib/orb/models/subscription_redeem_coupon_params.rb +8 -1
  217. data/lib/orb/models/subscription_schedule_plan_change_params.rb +2839 -685
  218. data/lib/orb/models/subscription_trigger_phase_params.rb +8 -1
  219. data/lib/orb/models/subscription_unschedule_cancellation_params.rb +7 -1
  220. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rb +8 -1
  221. data/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rb +7 -1
  222. data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +8 -1
  223. data/lib/orb/models/subscription_update_params.rb +19 -1
  224. data/lib/orb/models/subscription_update_trial_params.rb +8 -1
  225. data/lib/orb/models.rb +2 -0
  226. data/lib/orb/resources/alerts.rb +20 -2
  227. data/lib/orb/resources/coupons.rb +1 -2
  228. data/lib/orb/resources/credit_blocks.rb +11 -8
  229. data/lib/orb/resources/customers/credits/ledger.rb +40 -81
  230. data/lib/orb/resources/customers.rb +12 -7
  231. data/lib/orb/resources/events/backfills.rb +3 -4
  232. data/lib/orb/resources/events.rb +7 -34
  233. data/lib/orb/resources/invoices.rb +18 -7
  234. data/lib/orb/resources/licenses/external_licenses.rb +1 -1
  235. data/lib/orb/resources/licenses/usage.rb +2 -2
  236. data/lib/orb/resources/metrics.rb +5 -5
  237. data/lib/orb/resources/plans/external_plan_id.rb +5 -3
  238. data/lib/orb/resources/plans.rb +9 -5
  239. data/lib/orb/resources/prices/external_price_id.rb +2 -2
  240. data/lib/orb/resources/prices.rb +13 -104
  241. data/lib/orb/resources/subscriptions.rb +24 -7
  242. data/lib/orb/version.rb +1 -1
  243. data/lib/orb.rb +1 -0
  244. data/rbi/orb/client.rbi +6 -0
  245. data/rbi/orb/internal/util.rbi +8 -0
  246. data/rbi/orb/models/accounting_provider_config.rbi +38 -5
  247. data/rbi/orb/models/adjustment_interval.rbi +336 -0
  248. data/rbi/orb/models/alert.rbi +182 -3
  249. data/rbi/orb/models/alert_create_for_customer_params.rbi +6 -0
  250. data/rbi/orb/models/alert_create_for_external_customer_params.rbi +6 -0
  251. data/rbi/orb/models/alert_create_for_subscription_params.rbi +285 -0
  252. data/rbi/orb/models/alert_disable_params.rbi +6 -0
  253. data/rbi/orb/models/alert_enable_params.rbi +6 -0
  254. data/rbi/orb/models/alert_retrieve_params.rbi +13 -5
  255. data/rbi/orb/models/alert_update_params.rbi +214 -0
  256. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +5873 -1161
  257. data/rbi/orb/models/beta/external_plan_id_fetch_plan_version_params.rbi +10 -2
  258. data/rbi/orb/models/beta/external_plan_id_set_default_plan_version_params.rbi +10 -1
  259. data/rbi/orb/models/beta_create_plan_version_params.rbi +5877 -1165
  260. data/rbi/orb/models/beta_fetch_plan_version_params.rbi +10 -2
  261. data/rbi/orb/models/beta_set_default_plan_version_params.rbi +10 -1
  262. data/rbi/orb/models/changed_subscription_resources.rbi +360 -5
  263. data/rbi/orb/models/conversion_rate_config.rbi +18 -0
  264. data/rbi/orb/models/coupon_archive_params.rbi +13 -5
  265. data/rbi/orb/models/coupon_fetch_params.rbi +13 -5
  266. data/rbi/orb/models/coupons/subscription_list_params.rbi +6 -0
  267. data/rbi/orb/models/credit_block_delete_params.rbi +13 -5
  268. data/rbi/orb/models/credit_block_list_invoices_params.rbi +13 -5
  269. data/rbi/orb/models/credit_block_list_invoices_response.rbi +346 -3
  270. data/rbi/orb/models/credit_block_retrieve_params.rbi +13 -5
  271. data/rbi/orb/models/credit_block_retrieve_response.rbi +344 -3
  272. data/rbi/orb/models/credit_note_fetch_params.rbi +13 -5
  273. data/rbi/orb/models/customer.rbi +202 -0
  274. data/rbi/orb/models/customer_create_params.rbi +27 -0
  275. data/rbi/orb/models/customer_delete_params.rbi +13 -5
  276. data/rbi/orb/models/customer_fetch_by_external_id_params.rbi +13 -5
  277. data/rbi/orb/models/customer_fetch_params.rbi +13 -5
  278. data/rbi/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbi +13 -5
  279. data/rbi/orb/models/customer_sync_payment_methods_from_gateway_params.rbi +13 -5
  280. data/rbi/orb/models/customer_tax_id.rbi +15 -1
  281. data/rbi/orb/models/customer_update_by_external_id_params.rbi +51 -4
  282. data/rbi/orb/models/customer_update_params.rbi +51 -4
  283. data/rbi/orb/models/customers/balance_transaction_create_params.rbi +6 -0
  284. data/rbi/orb/models/customers/balance_transaction_list_params.rbi +6 -0
  285. data/rbi/orb/models/customers/cost_list_by_external_id_params.rbi +6 -0
  286. data/rbi/orb/models/customers/cost_list_params.rbi +6 -0
  287. data/rbi/orb/models/customers/credit_list_by_external_id_params.rbi +6 -0
  288. data/rbi/orb/models/customers/credit_list_by_external_id_response.rbi +346 -3
  289. data/rbi/orb/models/customers/credit_list_params.rbi +6 -0
  290. data/rbi/orb/models/customers/credit_list_response.rbi +347 -3
  291. data/rbi/orb/models/customers/credits/decrement_ledger_entry.rbi +4 -0
  292. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +861 -478
  293. data/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi +861 -478
  294. data/rbi/orb/models/customers/credits/ledger_list_by_external_id_params.rbi +6 -0
  295. data/rbi/orb/models/customers/credits/ledger_list_params.rbi +6 -0
  296. data/rbi/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +6 -0
  297. data/rbi/orb/models/customers/credits/top_up_create_params.rbi +6 -0
  298. data/rbi/orb/models/customers/credits/top_up_delete_by_external_id_params.rbi +6 -1
  299. data/rbi/orb/models/customers/credits/top_up_delete_params.rbi +10 -2
  300. data/rbi/orb/models/customers/credits/top_up_list_by_external_id_params.rbi +6 -0
  301. data/rbi/orb/models/customers/credits/top_up_list_params.rbi +6 -0
  302. data/rbi/orb/models/dimensional_price_group.rbi +1 -1
  303. data/rbi/orb/models/dimensional_price_group_retrieve_params.rbi +16 -5
  304. data/rbi/orb/models/dimensional_price_group_update_params.rbi +6 -0
  305. data/rbi/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbi +16 -5
  306. data/rbi/orb/models/dimensional_price_groups/external_dimensional_price_group_id_update_params.rbi +6 -0
  307. data/rbi/orb/models/discount.rbi +269 -1
  308. data/rbi/orb/models/event_deprecate_params.rbi +13 -5
  309. data/rbi/orb/models/event_ingest_params.rbi +4 -2
  310. data/rbi/orb/models/event_update_params.rbi +6 -0
  311. data/rbi/orb/models/events/backfill_close_params.rbi +13 -5
  312. data/rbi/orb/models/events/backfill_fetch_params.rbi +13 -5
  313. data/rbi/orb/models/events/backfill_revert_params.rbi +13 -5
  314. data/rbi/orb/models/invoice.rbi +360 -5
  315. data/rbi/orb/models/invoice_create_params.rbi +12 -7
  316. data/rbi/orb/models/invoice_delete_line_item_params.rbi +10 -2
  317. data/rbi/orb/models/invoice_fetch_params.rbi +13 -5
  318. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +360 -5
  319. data/rbi/orb/models/invoice_issue_params.rbi +10 -1
  320. data/rbi/orb/models/invoice_issue_summary_params.rbi +10 -1
  321. data/rbi/orb/models/invoice_issue_summary_response.rbi +19 -4
  322. data/rbi/orb/models/invoice_level_discount.rbi +298 -1
  323. data/rbi/orb/models/invoice_line_item_create_response.rbi +339 -0
  324. data/rbi/orb/models/invoice_list_summary_response.rbi +19 -4
  325. data/rbi/orb/models/invoice_mark_paid_params.rbi +6 -0
  326. data/rbi/orb/models/invoice_pay_params.rbi +27 -5
  327. data/rbi/orb/models/invoice_update_params.rbi +6 -0
  328. data/rbi/orb/models/invoice_void_params.rbi +13 -5
  329. data/rbi/orb/models/item_archive_params.rbi +13 -5
  330. data/rbi/orb/models/item_fetch_params.rbi +13 -5
  331. data/rbi/orb/models/item_update_params.rbi +6 -0
  332. data/rbi/orb/models/license_deactivate_params.rbi +10 -1
  333. data/rbi/orb/models/license_retrieve_by_external_id_params.rbi +6 -0
  334. data/rbi/orb/models/license_retrieve_params.rbi +13 -5
  335. data/rbi/orb/models/license_type_retrieve_params.rbi +13 -5
  336. data/rbi/orb/models/licenses/external_license_get_usage_params.rbi +9 -3
  337. data/rbi/orb/models/licenses/usage_get_all_usage_params.rbi +3 -3
  338. data/rbi/orb/models/licenses/usage_get_usage_params.rbi +9 -3
  339. data/rbi/orb/models/metric_fetch_params.rbi +13 -5
  340. data/rbi/orb/models/metric_update_params.rbi +6 -0
  341. data/rbi/orb/models/mutated_subscription.rbi +324 -2
  342. data/rbi/orb/models/new_allocation_price.rbi +12 -0
  343. data/rbi/orb/models/per_price_cost.rbi +3 -0
  344. data/rbi/orb/models/plan.rbi +339 -2
  345. data/rbi/orb/models/plan_create_params.rbi +2566 -209
  346. data/rbi/orb/models/plan_fetch_params.rbi +13 -5
  347. data/rbi/orb/models/plan_update_params.rbi +14 -0
  348. data/rbi/orb/models/plan_version.rbi +339 -0
  349. data/rbi/orb/models/plans/external_plan_id_fetch_params.rbi +13 -5
  350. data/rbi/orb/models/plans/external_plan_id_update_params.rbi +14 -0
  351. data/rbi/orb/models/plans/migration_cancel_params.rbi +10 -2
  352. data/rbi/orb/models/plans/migration_cancel_response.rbi +22 -1
  353. data/rbi/orb/models/plans/migration_list_params.rbi +6 -0
  354. data/rbi/orb/models/plans/migration_list_response.rbi +22 -1
  355. data/rbi/orb/models/plans/migration_retrieve_params.rbi +10 -2
  356. data/rbi/orb/models/plans/migration_retrieve_response.rbi +22 -1
  357. data/rbi/orb/models/price.rbi +4733 -2280
  358. data/rbi/orb/models/price_create_params.rbi +3022 -2408
  359. data/rbi/orb/models/price_evaluate_multiple_params.rbi +1540 -114
  360. data/rbi/orb/models/price_evaluate_params.rbi +6 -0
  361. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +1540 -114
  362. data/rbi/orb/models/price_fetch_params.rbi +13 -5
  363. data/rbi/orb/models/price_interval.rbi +3 -0
  364. data/rbi/orb/models/price_update_params.rbi +6 -0
  365. data/rbi/orb/models/prices/external_price_id_fetch_params.rbi +13 -5
  366. data/rbi/orb/models/prices/external_price_id_update_params.rbi +6 -0
  367. data/rbi/orb/models/subscription.rbi +324 -2
  368. data/rbi/orb/models/subscription_cancel_params.rbi +6 -0
  369. data/rbi/orb/models/subscription_change_apply_params.rbi +6 -0
  370. data/rbi/orb/models/subscription_change_cancel_params.rbi +16 -5
  371. data/rbi/orb/models/subscription_change_retrieve_params.rbi +16 -5
  372. data/rbi/orb/models/subscription_create_params.rbi +4998 -1186
  373. data/rbi/orb/models/subscription_fetch_costs_params.rbi +6 -0
  374. data/rbi/orb/models/subscription_fetch_params.rbi +13 -5
  375. data/rbi/orb/models/subscription_fetch_schedule_params.rbi +6 -0
  376. data/rbi/orb/models/subscription_fetch_usage_params.rbi +6 -0
  377. data/rbi/orb/models/subscription_price_intervals_params.rbi +2133 -264
  378. data/rbi/orb/models/subscription_redeem_coupon_params.rbi +6 -0
  379. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +5001 -1183
  380. data/rbi/orb/models/subscription_trigger_phase_params.rbi +6 -0
  381. data/rbi/orb/models/subscription_unschedule_cancellation_params.rbi +13 -5
  382. data/rbi/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi +10 -1
  383. data/rbi/orb/models/subscription_unschedule_pending_plan_changes_params.rbi +13 -5
  384. data/rbi/orb/models/subscription_update_fixed_fee_quantity_params.rbi +6 -0
  385. data/rbi/orb/models/subscription_update_params.rbi +20 -0
  386. data/rbi/orb/models/subscription_update_trial_params.rbi +6 -0
  387. data/rbi/orb/models.rbi +2 -0
  388. data/rbi/orb/resources/alerts.rbi +43 -0
  389. data/rbi/orb/resources/coupons.rbi +1 -2
  390. data/rbi/orb/resources/credit_blocks.rbi +10 -7
  391. data/rbi/orb/resources/customers/credits/ledger.rbi +50 -146
  392. data/rbi/orb/resources/customers.rbi +35 -7
  393. data/rbi/orb/resources/events/backfills.rbi +3 -4
  394. data/rbi/orb/resources/events.rbi +8 -35
  395. data/rbi/orb/resources/invoices.rbi +20 -6
  396. data/rbi/orb/resources/licenses/external_licenses.rbi +1 -1
  397. data/rbi/orb/resources/licenses/usage.rbi +2 -2
  398. data/rbi/orb/resources/metrics.rbi +5 -5
  399. data/rbi/orb/resources/plans/external_plan_id.rbi +5 -2
  400. data/rbi/orb/resources/plans.rbi +9 -3
  401. data/rbi/orb/resources/prices.rbi +38 -184
  402. data/rbi/orb/resources/subscriptions.rbi +33 -4
  403. data/sig/orb/client.rbs +3 -0
  404. data/sig/orb/internal/util.rbs +4 -0
  405. data/sig/orb/models/accounting_provider_config.rbs +21 -4
  406. data/sig/orb/models/adjustment_interval.rbs +134 -0
  407. data/sig/orb/models/alert.rbs +90 -3
  408. data/sig/orb/models/alert_create_for_customer_params.rbs +5 -0
  409. data/sig/orb/models/alert_create_for_external_customer_params.rbs +5 -0
  410. data/sig/orb/models/alert_create_for_subscription_params.rbs +98 -1
  411. data/sig/orb/models/alert_disable_params.rbs +6 -1
  412. data/sig/orb/models/alert_enable_params.rbs +6 -1
  413. data/sig/orb/models/alert_retrieve_params.rbs +9 -3
  414. data/sig/orb/models/alert_update_params.rbs +90 -1
  415. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +2318 -397
  416. data/sig/orb/models/beta/external_plan_id_fetch_plan_version_params.rbs +6 -1
  417. data/sig/orb/models/beta/external_plan_id_set_default_plan_version_params.rbs +6 -1
  418. data/sig/orb/models/beta_create_plan_version_params.rbs +2300 -389
  419. data/sig/orb/models/beta_fetch_plan_version_params.rbs +10 -2
  420. data/sig/orb/models/beta_set_default_plan_version_params.rbs +10 -2
  421. data/sig/orb/models/changed_subscription_resources.rbs +140 -1
  422. data/sig/orb/models/conversion_rate_config.rbs +12 -0
  423. data/sig/orb/models/coupon_archive_params.rbs +12 -3
  424. data/sig/orb/models/coupon_fetch_params.rbs +12 -3
  425. data/sig/orb/models/coupons/subscription_list_params.rbs +5 -1
  426. data/sig/orb/models/credit_block_delete_params.rbs +8 -3
  427. data/sig/orb/models/credit_block_list_invoices_params.rbs +8 -3
  428. data/sig/orb/models/credit_block_list_invoices_response.rbs +124 -3
  429. data/sig/orb/models/credit_block_retrieve_params.rbs +8 -3
  430. data/sig/orb/models/credit_block_retrieve_response.rbs +124 -3
  431. data/sig/orb/models/credit_note_fetch_params.rbs +11 -3
  432. data/sig/orb/models/customer.rbs +79 -1
  433. data/sig/orb/models/customer_create_params.rbs +12 -1
  434. data/sig/orb/models/customer_delete_params.rbs +12 -3
  435. data/sig/orb/models/customer_fetch_by_external_id_params.rbs +11 -3
  436. data/sig/orb/models/customer_fetch_params.rbs +12 -3
  437. data/sig/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbs +11 -3
  438. data/sig/orb/models/customer_sync_payment_methods_from_gateway_params.rbs +11 -3
  439. data/sig/orb/models/customer_tax_id.rbs +20 -2
  440. data/sig/orb/models/customer_update_by_external_id_params.rbs +22 -1
  441. data/sig/orb/models/customer_update_params.rbs +22 -1
  442. data/sig/orb/models/customers/balance_transaction_create_params.rbs +5 -0
  443. data/sig/orb/models/customers/balance_transaction_list_params.rbs +5 -0
  444. data/sig/orb/models/customers/cost_list_by_external_id_params.rbs +5 -0
  445. data/sig/orb/models/customers/cost_list_params.rbs +5 -0
  446. data/sig/orb/models/customers/credit_list_by_external_id_params.rbs +5 -0
  447. data/sig/orb/models/customers/credit_list_by_external_id_response.rbs +124 -3
  448. data/sig/orb/models/customers/credit_list_params.rbs +5 -0
  449. data/sig/orb/models/customers/credit_list_response.rbs +124 -3
  450. data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs +345 -157
  451. data/sig/orb/models/customers/credits/ledger_create_entry_params.rbs +345 -157
  452. data/sig/orb/models/customers/credits/ledger_list_by_external_id_params.rbs +5 -0
  453. data/sig/orb/models/customers/credits/ledger_list_params.rbs +5 -0
  454. data/sig/orb/models/customers/credits/top_up_create_by_external_id_params.rbs +5 -0
  455. data/sig/orb/models/customers/credits/top_up_create_params.rbs +5 -0
  456. data/sig/orb/models/customers/credits/top_up_delete_by_external_id_params.rbs +5 -1
  457. data/sig/orb/models/customers/credits/top_up_delete_params.rbs +6 -1
  458. data/sig/orb/models/customers/credits/top_up_list_by_external_id_params.rbs +5 -1
  459. data/sig/orb/models/customers/credits/top_up_list_params.rbs +5 -1
  460. data/sig/orb/models/dimensional_price_group_retrieve_params.rbs +12 -3
  461. data/sig/orb/models/dimensional_price_group_update_params.rbs +5 -0
  462. data/sig/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbs +12 -3
  463. data/sig/orb/models/dimensional_price_groups/external_dimensional_price_group_id_update_params.rbs +5 -0
  464. data/sig/orb/models/discount.rbs +114 -0
  465. data/sig/orb/models/event_deprecate_params.rbs +9 -3
  466. data/sig/orb/models/event_update_params.rbs +5 -0
  467. data/sig/orb/models/events/backfill_close_params.rbs +11 -3
  468. data/sig/orb/models/events/backfill_fetch_params.rbs +11 -3
  469. data/sig/orb/models/events/backfill_revert_params.rbs +11 -3
  470. data/sig/orb/models/invoice.rbs +140 -1
  471. data/sig/orb/models/invoice_delete_line_item_params.rbs +6 -1
  472. data/sig/orb/models/invoice_fetch_params.rbs +12 -3
  473. data/sig/orb/models/invoice_fetch_upcoming_response.rbs +140 -1
  474. data/sig/orb/models/invoice_issue_params.rbs +6 -1
  475. data/sig/orb/models/invoice_issue_summary_params.rbs +6 -1
  476. data/sig/orb/models/invoice_issue_summary_response.rbs +2 -1
  477. data/sig/orb/models/invoice_level_discount.rbs +117 -1
  478. data/sig/orb/models/invoice_line_item_create_response.rbs +134 -0
  479. data/sig/orb/models/invoice_list_summary_response.rbs +2 -1
  480. data/sig/orb/models/invoice_mark_paid_params.rbs +10 -1
  481. data/sig/orb/models/invoice_pay_params.rbs +17 -3
  482. data/sig/orb/models/invoice_update_params.rbs +5 -0
  483. data/sig/orb/models/invoice_void_params.rbs +12 -3
  484. data/sig/orb/models/item_archive_params.rbs +9 -3
  485. data/sig/orb/models/item_fetch_params.rbs +9 -3
  486. data/sig/orb/models/item_update_params.rbs +5 -0
  487. data/sig/orb/models/license_deactivate_params.rbs +10 -2
  488. data/sig/orb/models/license_retrieve_by_external_id_params.rbs +9 -1
  489. data/sig/orb/models/license_retrieve_params.rbs +11 -3
  490. data/sig/orb/models/license_type_retrieve_params.rbs +11 -3
  491. data/sig/orb/models/licenses/external_license_get_usage_params.rbs +9 -4
  492. data/sig/orb/models/licenses/usage_get_all_usage_params.rbs +4 -4
  493. data/sig/orb/models/licenses/usage_get_usage_params.rbs +9 -4
  494. data/sig/orb/models/metric_fetch_params.rbs +12 -3
  495. data/sig/orb/models/metric_update_params.rbs +5 -1
  496. data/sig/orb/models/mutated_subscription.rbs +124 -0
  497. data/sig/orb/models/new_allocation_price.rbs +5 -0
  498. data/sig/orb/models/new_floating_bulk_price.rbs +4 -4
  499. data/sig/orb/models/new_floating_bulk_with_proration_price.rbs +4 -4
  500. data/sig/orb/models/new_floating_cumulative_grouped_bulk_price.rbs +4 -4
  501. data/sig/orb/models/new_floating_grouped_allocation_price.rbs +4 -4
  502. data/sig/orb/models/new_floating_grouped_tiered_package_price.rbs +4 -4
  503. data/sig/orb/models/new_floating_grouped_tiered_price.rbs +4 -4
  504. data/sig/orb/models/new_floating_grouped_with_metered_minimum_price.rbs +4 -4
  505. data/sig/orb/models/new_floating_grouped_with_prorated_minimum_price.rbs +4 -4
  506. data/sig/orb/models/new_floating_matrix_price.rbs +4 -4
  507. data/sig/orb/models/new_floating_matrix_with_allocation_price.rbs +4 -4
  508. data/sig/orb/models/new_floating_matrix_with_display_name_price.rbs +4 -4
  509. data/sig/orb/models/new_floating_max_group_tiered_package_price.rbs +4 -4
  510. data/sig/orb/models/new_floating_minimum_composite_price.rbs +4 -4
  511. data/sig/orb/models/new_floating_package_price.rbs +4 -4
  512. data/sig/orb/models/new_floating_package_with_allocation_price.rbs +4 -4
  513. data/sig/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rbs +4 -4
  514. data/sig/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbs +4 -4
  515. data/sig/orb/models/new_floating_threshold_total_amount_price.rbs +4 -4
  516. data/sig/orb/models/new_floating_tiered_package_price.rbs +4 -4
  517. data/sig/orb/models/new_floating_tiered_package_with_minimum_price.rbs +4 -4
  518. data/sig/orb/models/new_floating_tiered_price.rbs +4 -4
  519. data/sig/orb/models/new_floating_tiered_with_minimum_price.rbs +4 -4
  520. data/sig/orb/models/new_floating_tiered_with_proration_price.rbs +4 -4
  521. data/sig/orb/models/new_floating_unit_price.rbs +4 -4
  522. data/sig/orb/models/new_floating_unit_with_percent_price.rbs +4 -4
  523. data/sig/orb/models/new_floating_unit_with_proration_price.rbs +4 -4
  524. data/sig/orb/models/new_plan_bulk_price.rbs +4 -4
  525. data/sig/orb/models/new_plan_bulk_with_proration_price.rbs +4 -4
  526. data/sig/orb/models/new_plan_cumulative_grouped_bulk_price.rbs +4 -4
  527. data/sig/orb/models/new_plan_grouped_allocation_price.rbs +4 -4
  528. data/sig/orb/models/new_plan_grouped_tiered_package_price.rbs +4 -4
  529. data/sig/orb/models/new_plan_grouped_tiered_price.rbs +4 -4
  530. data/sig/orb/models/new_plan_grouped_with_metered_minimum_price.rbs +4 -4
  531. data/sig/orb/models/new_plan_grouped_with_prorated_minimum_price.rbs +4 -4
  532. data/sig/orb/models/new_plan_matrix_price.rbs +4 -4
  533. data/sig/orb/models/new_plan_matrix_with_allocation_price.rbs +4 -4
  534. data/sig/orb/models/new_plan_matrix_with_display_name_price.rbs +4 -4
  535. data/sig/orb/models/new_plan_max_group_tiered_package_price.rbs +4 -4
  536. data/sig/orb/models/new_plan_minimum_composite_price.rbs +4 -4
  537. data/sig/orb/models/new_plan_package_price.rbs +4 -4
  538. data/sig/orb/models/new_plan_package_with_allocation_price.rbs +4 -4
  539. data/sig/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rbs +4 -4
  540. data/sig/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbs +4 -4
  541. data/sig/orb/models/new_plan_threshold_total_amount_price.rbs +4 -4
  542. data/sig/orb/models/new_plan_tiered_package_price.rbs +4 -4
  543. data/sig/orb/models/new_plan_tiered_package_with_minimum_price.rbs +4 -4
  544. data/sig/orb/models/new_plan_tiered_price.rbs +4 -4
  545. data/sig/orb/models/new_plan_tiered_with_minimum_price.rbs +4 -4
  546. data/sig/orb/models/new_plan_unit_price.rbs +4 -4
  547. data/sig/orb/models/new_plan_unit_with_percent_price.rbs +4 -4
  548. data/sig/orb/models/new_plan_unit_with_proration_price.rbs +4 -4
  549. data/sig/orb/models/new_subscription_bulk_price.rbs +4 -4
  550. data/sig/orb/models/new_subscription_bulk_with_proration_price.rbs +4 -4
  551. data/sig/orb/models/new_subscription_cumulative_grouped_bulk_price.rbs +4 -4
  552. data/sig/orb/models/new_subscription_grouped_allocation_price.rbs +4 -4
  553. data/sig/orb/models/new_subscription_grouped_tiered_package_price.rbs +4 -4
  554. data/sig/orb/models/new_subscription_grouped_tiered_price.rbs +4 -4
  555. data/sig/orb/models/new_subscription_grouped_with_metered_minimum_price.rbs +4 -4
  556. data/sig/orb/models/new_subscription_grouped_with_prorated_minimum_price.rbs +4 -4
  557. data/sig/orb/models/new_subscription_matrix_price.rbs +4 -4
  558. data/sig/orb/models/new_subscription_matrix_with_allocation_price.rbs +4 -4
  559. data/sig/orb/models/new_subscription_matrix_with_display_name_price.rbs +4 -4
  560. data/sig/orb/models/new_subscription_max_group_tiered_package_price.rbs +4 -4
  561. data/sig/orb/models/new_subscription_minimum_composite_price.rbs +4 -4
  562. data/sig/orb/models/new_subscription_package_price.rbs +4 -4
  563. data/sig/orb/models/new_subscription_package_with_allocation_price.rbs +4 -4
  564. data/sig/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rbs +4 -4
  565. data/sig/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbs +4 -4
  566. data/sig/orb/models/new_subscription_threshold_total_amount_price.rbs +4 -4
  567. data/sig/orb/models/new_subscription_tiered_package_price.rbs +4 -4
  568. data/sig/orb/models/new_subscription_tiered_package_with_minimum_price.rbs +4 -4
  569. data/sig/orb/models/new_subscription_tiered_price.rbs +4 -4
  570. data/sig/orb/models/new_subscription_tiered_with_minimum_price.rbs +4 -4
  571. data/sig/orb/models/new_subscription_unit_price.rbs +4 -4
  572. data/sig/orb/models/new_subscription_unit_with_percent_price.rbs +4 -4
  573. data/sig/orb/models/new_subscription_unit_with_proration_price.rbs +4 -4
  574. data/sig/orb/models/plan.rbs +134 -0
  575. data/sig/orb/models/plan_create_params.rbs +1030 -72
  576. data/sig/orb/models/plan_fetch_params.rbs +9 -3
  577. data/sig/orb/models/plan_update_params.rbs +14 -1
  578. data/sig/orb/models/plan_version.rbs +134 -0
  579. data/sig/orb/models/plans/external_plan_id_fetch_params.rbs +11 -3
  580. data/sig/orb/models/plans/external_plan_id_update_params.rbs +14 -1
  581. data/sig/orb/models/plans/migration_cancel_params.rbs +6 -1
  582. data/sig/orb/models/plans/migration_list_params.rbs +5 -1
  583. data/sig/orb/models/plans/migration_retrieve_params.rbs +6 -1
  584. data/sig/orb/models/price.rbs +2361 -1156
  585. data/sig/orb/models/price_create_params.rbs +1124 -931
  586. data/sig/orb/models/price_evaluate_multiple_params.rbs +626 -23
  587. data/sig/orb/models/price_evaluate_params.rbs +5 -0
  588. data/sig/orb/models/price_evaluate_preview_events_params.rbs +626 -23
  589. data/sig/orb/models/price_fetch_params.rbs +9 -3
  590. data/sig/orb/models/price_update_params.rbs +5 -1
  591. data/sig/orb/models/prices/external_price_id_fetch_params.rbs +11 -3
  592. data/sig/orb/models/prices/external_price_id_update_params.rbs +5 -1
  593. data/sig/orb/models/subscription.rbs +124 -0
  594. data/sig/orb/models/subscription_cancel_params.rbs +5 -0
  595. data/sig/orb/models/subscription_change_apply_params.rbs +5 -0
  596. data/sig/orb/models/subscription_change_cancel_params.rbs +12 -3
  597. data/sig/orb/models/subscription_change_retrieve_params.rbs +12 -3
  598. data/sig/orb/models/subscription_create_params.rbs +2009 -430
  599. data/sig/orb/models/subscription_fetch_costs_params.rbs +5 -0
  600. data/sig/orb/models/subscription_fetch_params.rbs +11 -3
  601. data/sig/orb/models/subscription_fetch_schedule_params.rbs +5 -0
  602. data/sig/orb/models/subscription_fetch_usage_params.rbs +5 -0
  603. data/sig/orb/models/subscription_price_intervals_params.rbs +800 -23
  604. data/sig/orb/models/subscription_redeem_coupon_params.rbs +5 -0
  605. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +2014 -430
  606. data/sig/orb/models/subscription_trigger_phase_params.rbs +9 -1
  607. data/sig/orb/models/subscription_unschedule_cancellation_params.rbs +11 -3
  608. data/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbs +10 -2
  609. data/sig/orb/models/subscription_unschedule_pending_plan_changes_params.rbs +11 -3
  610. data/sig/orb/models/subscription_update_fixed_fee_quantity_params.rbs +5 -0
  611. data/sig/orb/models/subscription_update_params.rbs +10 -0
  612. data/sig/orb/models/subscription_update_trial_params.rbs +5 -0
  613. data/sig/orb/models.rbs +2 -0
  614. data/sig/orb/resources/alerts.rbs +6 -0
  615. data/sig/orb/resources/customers/credits/ledger.rbs +2 -26
  616. data/sig/orb/resources/customers.rbs +2 -0
  617. data/sig/orb/resources/invoices.rbs +1 -0
  618. data/sig/orb/resources/licenses/external_licenses.rbs +1 -1
  619. data/sig/orb/resources/licenses/usage.rbs +2 -2
  620. data/sig/orb/resources/plans/external_plan_id.rbs +1 -0
  621. data/sig/orb/resources/plans.rbs +2 -0
  622. data/sig/orb/resources/prices.rbs +1 -48
  623. data/sig/orb/resources/subscriptions.rbs +3 -0
  624. metadata +6 -7
@@ -11,6 +11,9 @@ module Orb
11
11
  T.any(Orb::SubscriptionPriceIntervalsParams, Orb::Internal::AnyHash)
12
12
  end
13
13
 
14
+ sig { returns(String) }
15
+ attr_accessor :subscription_id
16
+
14
17
  # A list of price intervals to add to the subscription.
15
18
  sig do
16
19
  returns(T.nilable(T::Array[Orb::SubscriptionPriceIntervalsParams::Add]))
@@ -92,6 +95,7 @@ module Orb
92
95
 
93
96
  sig do
94
97
  params(
98
+ subscription_id: String,
95
99
  add: T::Array[Orb::SubscriptionPriceIntervalsParams::Add::OrHash],
96
100
  add_adjustments:
97
101
  T::Array[
@@ -108,6 +112,7 @@ module Orb
108
112
  ).returns(T.attached_class)
109
113
  end
110
114
  def self.new(
115
+ subscription_id:,
111
116
  # A list of price intervals to add to the subscription.
112
117
  add: nil,
113
118
  # A list of adjustments to add to the subscription.
@@ -130,6 +135,7 @@ module Orb
130
135
  sig do
131
136
  override.returns(
132
137
  {
138
+ subscription_id: String,
133
139
  add: T::Array[Orb::SubscriptionPriceIntervalsParams::Add],
134
140
  add_adjustments:
135
141
  T::Array[Orb::SubscriptionPriceIntervalsParams::AddAdjustment],
@@ -258,6 +264,7 @@ module Orb
258
264
  Orb::NewFloatingPackageWithAllocationPrice,
259
265
  Orb::NewFloatingUnitWithPercentPrice,
260
266
  Orb::NewFloatingMatrixWithAllocationPrice,
267
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts,
261
268
  Orb::NewFloatingTieredWithProrationPrice,
262
269
  Orb::NewFloatingUnitWithProrationPrice,
263
270
  Orb::NewFloatingGroupedAllocationPrice,
@@ -272,6 +279,8 @@ module Orb
272
279
  Orb::NewFloatingScalableMatrixWithTieredPricingPrice,
273
280
  Orb::NewFloatingCumulativeGroupedBulkPrice,
274
281
  Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation,
282
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance,
283
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance,
275
284
  Orb::NewFloatingMinimumCompositePrice,
276
285
  Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent,
277
286
  Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput
@@ -339,6 +348,7 @@ module Orb
339
348
  Orb::NewFloatingPackageWithAllocationPrice::OrHash,
340
349
  Orb::NewFloatingUnitWithPercentPrice::OrHash,
341
350
  Orb::NewFloatingMatrixWithAllocationPrice::OrHash,
351
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::OrHash,
342
352
  Orb::NewFloatingTieredWithProrationPrice::OrHash,
343
353
  Orb::NewFloatingUnitWithProrationPrice::OrHash,
344
354
  Orb::NewFloatingGroupedAllocationPrice::OrHash,
@@ -353,6 +363,8 @@ module Orb
353
363
  Orb::NewFloatingScalableMatrixWithTieredPricingPrice::OrHash,
354
364
  Orb::NewFloatingCumulativeGroupedBulkPrice::OrHash,
355
365
  Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::OrHash,
366
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::OrHash,
367
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::OrHash,
356
368
  Orb::NewFloatingMinimumCompositePrice::OrHash,
357
369
  Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::OrHash,
358
370
  Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::OrHash
@@ -456,6 +468,7 @@ module Orb
456
468
  Orb::NewFloatingPackageWithAllocationPrice,
457
469
  Orb::NewFloatingUnitWithPercentPrice,
458
470
  Orb::NewFloatingMatrixWithAllocationPrice,
471
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts,
459
472
  Orb::NewFloatingTieredWithProrationPrice,
460
473
  Orb::NewFloatingUnitWithProrationPrice,
461
474
  Orb::NewFloatingGroupedAllocationPrice,
@@ -470,6 +483,8 @@ module Orb
470
483
  Orb::NewFloatingScalableMatrixWithTieredPricingPrice,
471
484
  Orb::NewFloatingCumulativeGroupedBulkPrice,
472
485
  Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation,
486
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance,
487
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance,
473
488
  Orb::NewFloatingMinimumCompositePrice,
474
489
  Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent,
475
490
  Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput
@@ -717,6 +732,7 @@ module Orb
717
732
  Orb::NewFloatingPackageWithAllocationPrice,
718
733
  Orb::NewFloatingUnitWithPercentPrice,
719
734
  Orb::NewFloatingMatrixWithAllocationPrice,
735
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts,
720
736
  Orb::NewFloatingTieredWithProrationPrice,
721
737
  Orb::NewFloatingUnitWithProrationPrice,
722
738
  Orb::NewFloatingGroupedAllocationPrice,
@@ -731,6 +747,8 @@ module Orb
731
747
  Orb::NewFloatingScalableMatrixWithTieredPricingPrice,
732
748
  Orb::NewFloatingCumulativeGroupedBulkPrice,
733
749
  Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation,
750
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance,
751
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance,
734
752
  Orb::NewFloatingMinimumCompositePrice,
735
753
  Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent,
736
754
  Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput
@@ -1197,11 +1215,11 @@ module Orb
1197
1215
  end
1198
1216
  end
1199
1217
 
1200
- class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel
1218
+ class MatrixWithThresholdDiscounts < Orb::Internal::Type::BaseModel
1201
1219
  OrHash =
1202
1220
  T.type_alias do
1203
1221
  T.any(
1204
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds,
1222
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts,
1205
1223
  Orb::Internal::AnyHash
1206
1224
  )
1207
1225
  end
@@ -1209,7 +1227,7 @@ module Orb
1209
1227
  # The cadence to bill for this price on.
1210
1228
  sig do
1211
1229
  returns(
1212
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol
1230
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::OrSymbol
1213
1231
  )
1214
1232
  end
1215
1233
  attr_accessor :cadence
@@ -1218,25 +1236,25 @@ module Orb
1218
1236
  sig { returns(String) }
1219
1237
  attr_accessor :currency
1220
1238
 
1221
- # Configuration for grouped_with_min_max_thresholds pricing
1239
+ # The id of the item the price will be associated with.
1240
+ sig { returns(String) }
1241
+ attr_accessor :item_id
1242
+
1243
+ # Configuration for matrix_with_threshold_discounts pricing
1222
1244
  sig do
1223
1245
  returns(
1224
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig
1246
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig
1225
1247
  )
1226
1248
  end
1227
- attr_reader :grouped_with_min_max_thresholds_config
1249
+ attr_reader :matrix_with_threshold_discounts_config
1228
1250
 
1229
1251
  sig do
1230
1252
  params(
1231
- grouped_with_min_max_thresholds_config:
1232
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash
1253
+ matrix_with_threshold_discounts_config:
1254
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::OrHash
1233
1255
  ).void
1234
1256
  end
1235
- attr_writer :grouped_with_min_max_thresholds_config
1236
-
1237
- # The id of the item the price will be associated with.
1238
- sig { returns(String) }
1239
- attr_accessor :item_id
1257
+ attr_writer :matrix_with_threshold_discounts_config
1240
1258
 
1241
1259
  # The pricing model type
1242
1260
  sig { returns(Symbol) }
@@ -1337,11 +1355,11 @@ module Orb
1337
1355
  sig do
1338
1356
  params(
1339
1357
  cadence:
1340
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol,
1358
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::OrSymbol,
1341
1359
  currency: String,
1342
- grouped_with_min_max_thresholds_config:
1343
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash,
1344
1360
  item_id: String,
1361
+ matrix_with_threshold_discounts_config:
1362
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::OrHash,
1345
1363
  name: String,
1346
1364
  billable_metric_id: T.nilable(String),
1347
1365
  billed_in_advance: T.nilable(T::Boolean),
@@ -1372,10 +1390,10 @@ module Orb
1372
1390
  cadence:,
1373
1391
  # An ISO 4217 currency string for which this price is billed in.
1374
1392
  currency:,
1375
- # Configuration for grouped_with_min_max_thresholds pricing
1376
- grouped_with_min_max_thresholds_config:,
1377
1393
  # The id of the item the price will be associated with.
1378
1394
  item_id:,
1395
+ # Configuration for matrix_with_threshold_discounts pricing
1396
+ matrix_with_threshold_discounts_config:,
1379
1397
  # The name of the price.
1380
1398
  name:,
1381
1399
  # The id of the billable metric for the price. Only needed if the price is
@@ -1410,7 +1428,7 @@ module Orb
1410
1428
  # by setting `metadata` to `null`.
1411
1429
  metadata: nil,
1412
1430
  # The pricing model type
1413
- model_type: :grouped_with_min_max_thresholds
1431
+ model_type: :matrix_with_threshold_discounts
1414
1432
  )
1415
1433
  end
1416
1434
 
@@ -1418,11 +1436,11 @@ module Orb
1418
1436
  override.returns(
1419
1437
  {
1420
1438
  cadence:
1421
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol,
1439
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::OrSymbol,
1422
1440
  currency: String,
1423
- grouped_with_min_max_thresholds_config:
1424
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig,
1425
1441
  item_id: String,
1442
+ matrix_with_threshold_discounts_config:
1443
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig,
1426
1444
  model_type: Symbol,
1427
1445
  name: String,
1428
1446
  billable_metric_id: T.nilable(String),
@@ -1460,7 +1478,7 @@ module Orb
1460
1478
  T.type_alias do
1461
1479
  T.all(
1462
1480
  Symbol,
1463
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence
1481
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence
1464
1482
  )
1465
1483
  end
1466
1484
  OrSymbol = T.type_alias { T.any(Symbol, String) }
@@ -1468,38 +1486,38 @@ module Orb
1468
1486
  ANNUAL =
1469
1487
  T.let(
1470
1488
  :annual,
1471
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1489
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1472
1490
  )
1473
1491
  SEMI_ANNUAL =
1474
1492
  T.let(
1475
1493
  :semi_annual,
1476
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1494
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1477
1495
  )
1478
1496
  MONTHLY =
1479
1497
  T.let(
1480
1498
  :monthly,
1481
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1499
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1482
1500
  )
1483
1501
  QUARTERLY =
1484
1502
  T.let(
1485
1503
  :quarterly,
1486
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1504
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1487
1505
  )
1488
1506
  ONE_TIME =
1489
1507
  T.let(
1490
1508
  :one_time,
1491
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1509
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1492
1510
  )
1493
1511
  CUSTOM =
1494
1512
  T.let(
1495
1513
  :custom,
1496
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1514
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1497
1515
  )
1498
1516
 
1499
1517
  sig do
1500
1518
  override.returns(
1501
1519
  T::Array[
1502
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1520
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1503
1521
  ]
1504
1522
  )
1505
1523
  end
@@ -1507,72 +1525,228 @@ module Orb
1507
1525
  end
1508
1526
  end
1509
1527
 
1510
- class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel
1528
+ class MatrixWithThresholdDiscountsConfig < Orb::Internal::Type::BaseModel
1511
1529
  OrHash =
1512
1530
  T.type_alias do
1513
1531
  T.any(
1514
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig,
1532
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig,
1515
1533
  Orb::Internal::AnyHash
1516
1534
  )
1517
1535
  end
1518
1536
 
1519
- # The event property used to group before applying thresholds
1537
+ # Unit price used for usage that does not match any defined matrix cell.
1520
1538
  sig { returns(String) }
1521
- attr_accessor :grouping_key
1539
+ attr_accessor :default_unit_amount
1522
1540
 
1523
- # The maximum amount to charge each group
1541
+ # First matrix dimension key.
1524
1542
  sig { returns(String) }
1525
- attr_accessor :maximum_charge
1543
+ attr_accessor :first_dimension
1526
1544
 
1527
- # The minimum amount to charge each group, regardless of usage
1528
- sig { returns(String) }
1529
- attr_accessor :minimum_charge
1545
+ # Per-cell unit prices.
1546
+ sig do
1547
+ returns(
1548
+ T::Array[
1549
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::MatrixValue
1550
+ ]
1551
+ )
1552
+ end
1553
+ attr_accessor :matrix_values
1530
1554
 
1531
- # The base price charged per group
1532
- sig { returns(String) }
1533
- attr_accessor :per_unit_rate
1555
+ # Optional second matrix dimension key.
1556
+ sig { returns(T.nilable(String)) }
1557
+ attr_accessor :second_dimension
1558
+
1559
+ sig do
1560
+ returns(
1561
+ T.nilable(
1562
+ T::Array[
1563
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::ThresholdDiscountGroup
1564
+ ]
1565
+ )
1566
+ )
1567
+ end
1568
+ attr_reader :threshold_discount_groups
1534
1569
 
1535
- # Configuration for grouped_with_min_max_thresholds pricing
1536
1570
  sig do
1537
1571
  params(
1538
- grouping_key: String,
1539
- maximum_charge: String,
1540
- minimum_charge: String,
1541
- per_unit_rate: String
1572
+ threshold_discount_groups:
1573
+ T::Array[
1574
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::ThresholdDiscountGroup::OrHash
1575
+ ]
1576
+ ).void
1577
+ end
1578
+ attr_writer :threshold_discount_groups
1579
+
1580
+ # Configuration for matrix_with_threshold_discounts pricing
1581
+ sig do
1582
+ params(
1583
+ default_unit_amount: String,
1584
+ first_dimension: String,
1585
+ matrix_values:
1586
+ T::Array[
1587
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::MatrixValue::OrHash
1588
+ ],
1589
+ second_dimension: T.nilable(String),
1590
+ threshold_discount_groups:
1591
+ T::Array[
1592
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::ThresholdDiscountGroup::OrHash
1593
+ ]
1542
1594
  ).returns(T.attached_class)
1543
1595
  end
1544
1596
  def self.new(
1545
- # The event property used to group before applying thresholds
1546
- grouping_key:,
1547
- # The maximum amount to charge each group
1548
- maximum_charge:,
1549
- # The minimum amount to charge each group, regardless of usage
1550
- minimum_charge:,
1551
- # The base price charged per group
1552
- per_unit_rate:
1597
+ # Unit price used for usage that does not match any defined matrix cell.
1598
+ default_unit_amount:,
1599
+ # First matrix dimension key.
1600
+ first_dimension:,
1601
+ # Per-cell unit prices.
1602
+ matrix_values:,
1603
+ # Optional second matrix dimension key.
1604
+ second_dimension: nil,
1605
+ threshold_discount_groups: nil
1553
1606
  )
1554
1607
  end
1555
1608
 
1556
1609
  sig do
1557
1610
  override.returns(
1558
1611
  {
1559
- grouping_key: String,
1560
- maximum_charge: String,
1561
- minimum_charge: String,
1562
- per_unit_rate: String
1612
+ default_unit_amount: String,
1613
+ first_dimension: String,
1614
+ matrix_values:
1615
+ T::Array[
1616
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::MatrixValue
1617
+ ],
1618
+ second_dimension: T.nilable(String),
1619
+ threshold_discount_groups:
1620
+ T::Array[
1621
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::ThresholdDiscountGroup
1622
+ ]
1563
1623
  }
1564
1624
  )
1565
1625
  end
1566
1626
  def to_hash
1567
1627
  end
1628
+
1629
+ class MatrixValue < Orb::Internal::Type::BaseModel
1630
+ OrHash =
1631
+ T.type_alias do
1632
+ T.any(
1633
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::MatrixValue,
1634
+ Orb::Internal::AnyHash
1635
+ )
1636
+ end
1637
+
1638
+ sig { returns(String) }
1639
+ attr_accessor :first_dimension_value
1640
+
1641
+ sig { returns(String) }
1642
+ attr_accessor :unit_amount
1643
+
1644
+ sig { returns(T.nilable(String)) }
1645
+ attr_accessor :second_dimension_value
1646
+
1647
+ sig do
1648
+ params(
1649
+ first_dimension_value: String,
1650
+ unit_amount: String,
1651
+ second_dimension_value: T.nilable(String)
1652
+ ).returns(T.attached_class)
1653
+ end
1654
+ def self.new(
1655
+ first_dimension_value:,
1656
+ unit_amount:,
1657
+ second_dimension_value: nil
1658
+ )
1659
+ end
1660
+
1661
+ sig do
1662
+ override.returns(
1663
+ {
1664
+ first_dimension_value: String,
1665
+ unit_amount: String,
1666
+ second_dimension_value: T.nilable(String)
1667
+ }
1668
+ )
1669
+ end
1670
+ def to_hash
1671
+ end
1672
+ end
1673
+
1674
+ class ThresholdDiscountGroup < Orb::Internal::Type::BaseModel
1675
+ OrHash =
1676
+ T.type_alias do
1677
+ T.any(
1678
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::ThresholdDiscountGroup,
1679
+ Orb::Internal::AnyHash
1680
+ )
1681
+ end
1682
+
1683
+ # Discount rate applied to spend above the threshold.
1684
+ sig { returns(String) }
1685
+ attr_accessor :above_threshold_discount_percentage
1686
+
1687
+ # Discount rate applied to spend at or below the threshold. Set to 0 for no
1688
+ # baseline discount.
1689
+ sig { returns(String) }
1690
+ attr_accessor :below_threshold_discount_percentage
1691
+
1692
+ # Semicolon-separated list of matrix cell coordinates targeted by this group. Each
1693
+ # coordinate is `first,second` when the matrix has two dimensions, or just `first`
1694
+ # for a single-dimension matrix. Example: `blue,circle;green,triangle`.
1695
+ sig { returns(String) }
1696
+ attr_accessor :cell_coordinates
1697
+
1698
+ sig { returns(String) }
1699
+ attr_accessor :threshold_amount
1700
+
1701
+ sig { returns(T.nilable(String)) }
1702
+ attr_accessor :description
1703
+
1704
+ sig do
1705
+ params(
1706
+ above_threshold_discount_percentage: String,
1707
+ below_threshold_discount_percentage: String,
1708
+ cell_coordinates: String,
1709
+ threshold_amount: String,
1710
+ description: T.nilable(String)
1711
+ ).returns(T.attached_class)
1712
+ end
1713
+ def self.new(
1714
+ # Discount rate applied to spend above the threshold.
1715
+ above_threshold_discount_percentage:,
1716
+ # Discount rate applied to spend at or below the threshold. Set to 0 for no
1717
+ # baseline discount.
1718
+ below_threshold_discount_percentage:,
1719
+ # Semicolon-separated list of matrix cell coordinates targeted by this group. Each
1720
+ # coordinate is `first,second` when the matrix has two dimensions, or just `first`
1721
+ # for a single-dimension matrix. Example: `blue,circle;green,triangle`.
1722
+ cell_coordinates:,
1723
+ threshold_amount:,
1724
+ description: nil
1725
+ )
1726
+ end
1727
+
1728
+ sig do
1729
+ override.returns(
1730
+ {
1731
+ above_threshold_discount_percentage: String,
1732
+ below_threshold_discount_percentage: String,
1733
+ cell_coordinates: String,
1734
+ threshold_amount: String,
1735
+ description: T.nilable(String)
1736
+ }
1737
+ )
1738
+ end
1739
+ def to_hash
1740
+ end
1741
+ end
1568
1742
  end
1569
1743
  end
1570
1744
 
1571
- class CumulativeGroupedAllocation < Orb::Internal::Type::BaseModel
1745
+ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel
1572
1746
  OrHash =
1573
1747
  T.type_alias do
1574
1748
  T.any(
1575
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation,
1749
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds,
1576
1750
  Orb::Internal::AnyHash
1577
1751
  )
1578
1752
  end
@@ -1580,30 +1754,30 @@ module Orb
1580
1754
  # The cadence to bill for this price on.
1581
1755
  sig do
1582
1756
  returns(
1583
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::OrSymbol
1757
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol
1584
1758
  )
1585
1759
  end
1586
1760
  attr_accessor :cadence
1587
1761
 
1588
- # Configuration for cumulative_grouped_allocation pricing
1762
+ # An ISO 4217 currency string for which this price is billed in.
1763
+ sig { returns(String) }
1764
+ attr_accessor :currency
1765
+
1766
+ # Configuration for grouped_with_min_max_thresholds pricing
1589
1767
  sig do
1590
1768
  returns(
1591
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig
1769
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig
1592
1770
  )
1593
1771
  end
1594
- attr_reader :cumulative_grouped_allocation_config
1772
+ attr_reader :grouped_with_min_max_thresholds_config
1595
1773
 
1596
1774
  sig do
1597
1775
  params(
1598
- cumulative_grouped_allocation_config:
1599
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig::OrHash
1776
+ grouped_with_min_max_thresholds_config:
1777
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash
1600
1778
  ).void
1601
1779
  end
1602
- attr_writer :cumulative_grouped_allocation_config
1603
-
1604
- # An ISO 4217 currency string for which this price is billed in.
1605
- sig { returns(String) }
1606
- attr_accessor :currency
1780
+ attr_writer :grouped_with_min_max_thresholds_config
1607
1781
 
1608
1782
  # The id of the item the price will be associated with.
1609
1783
  sig { returns(String) }
@@ -1708,10 +1882,10 @@ module Orb
1708
1882
  sig do
1709
1883
  params(
1710
1884
  cadence:
1711
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::OrSymbol,
1712
- cumulative_grouped_allocation_config:
1713
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig::OrHash,
1885
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol,
1714
1886
  currency: String,
1887
+ grouped_with_min_max_thresholds_config:
1888
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash,
1715
1889
  item_id: String,
1716
1890
  name: String,
1717
1891
  billable_metric_id: T.nilable(String),
@@ -1741,10 +1915,10 @@ module Orb
1741
1915
  def self.new(
1742
1916
  # The cadence to bill for this price on.
1743
1917
  cadence:,
1744
- # Configuration for cumulative_grouped_allocation pricing
1745
- cumulative_grouped_allocation_config:,
1746
1918
  # An ISO 4217 currency string for which this price is billed in.
1747
1919
  currency:,
1920
+ # Configuration for grouped_with_min_max_thresholds pricing
1921
+ grouped_with_min_max_thresholds_config:,
1748
1922
  # The id of the item the price will be associated with.
1749
1923
  item_id:,
1750
1924
  # The name of the price.
@@ -1781,7 +1955,7 @@ module Orb
1781
1955
  # by setting `metadata` to `null`.
1782
1956
  metadata: nil,
1783
1957
  # The pricing model type
1784
- model_type: :cumulative_grouped_allocation
1958
+ model_type: :grouped_with_min_max_thresholds
1785
1959
  )
1786
1960
  end
1787
1961
 
@@ -1789,10 +1963,10 @@ module Orb
1789
1963
  override.returns(
1790
1964
  {
1791
1965
  cadence:
1792
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::OrSymbol,
1793
- cumulative_grouped_allocation_config:
1794
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig,
1966
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol,
1795
1967
  currency: String,
1968
+ grouped_with_min_max_thresholds_config:
1969
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig,
1796
1970
  item_id: String,
1797
1971
  model_type: Symbol,
1798
1972
  name: String,
@@ -1831,7 +2005,7 @@ module Orb
1831
2005
  T.type_alias do
1832
2006
  T.all(
1833
2007
  Symbol,
1834
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence
2008
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence
1835
2009
  )
1836
2010
  end
1837
2011
  OrSymbol = T.type_alias { T.any(Symbol, String) }
@@ -1839,38 +2013,38 @@ module Orb
1839
2013
  ANNUAL =
1840
2014
  T.let(
1841
2015
  :annual,
1842
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2016
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1843
2017
  )
1844
2018
  SEMI_ANNUAL =
1845
2019
  T.let(
1846
2020
  :semi_annual,
1847
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2021
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1848
2022
  )
1849
2023
  MONTHLY =
1850
2024
  T.let(
1851
2025
  :monthly,
1852
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2026
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1853
2027
  )
1854
2028
  QUARTERLY =
1855
2029
  T.let(
1856
2030
  :quarterly,
1857
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2031
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1858
2032
  )
1859
2033
  ONE_TIME =
1860
2034
  T.let(
1861
2035
  :one_time,
1862
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2036
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1863
2037
  )
1864
2038
  CUSTOM =
1865
2039
  T.let(
1866
2040
  :custom,
1867
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2041
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1868
2042
  )
1869
2043
 
1870
2044
  sig do
1871
2045
  override.returns(
1872
2046
  T::Array[
1873
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2047
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1874
2048
  ]
1875
2049
  )
1876
2050
  end
@@ -1878,59 +2052,59 @@ module Orb
1878
2052
  end
1879
2053
  end
1880
2054
 
1881
- class CumulativeGroupedAllocationConfig < Orb::Internal::Type::BaseModel
2055
+ class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel
1882
2056
  OrHash =
1883
2057
  T.type_alias do
1884
2058
  T.any(
1885
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig,
2059
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig,
1886
2060
  Orb::Internal::AnyHash
1887
2061
  )
1888
2062
  end
1889
2063
 
1890
- # The overall allocation across all groups
2064
+ # The event property used to group before applying thresholds
1891
2065
  sig { returns(String) }
1892
- attr_accessor :cumulative_allocation
2066
+ attr_accessor :grouping_key
1893
2067
 
1894
- # The allocation per individual group
2068
+ # The maximum amount to charge each group
1895
2069
  sig { returns(String) }
1896
- attr_accessor :group_allocation
2070
+ attr_accessor :maximum_charge
1897
2071
 
1898
- # The event property used to group usage before applying allocations
2072
+ # The minimum amount to charge each group, regardless of usage
1899
2073
  sig { returns(String) }
1900
- attr_accessor :grouping_key
2074
+ attr_accessor :minimum_charge
1901
2075
 
1902
- # The amount to charge for each unit outside of the allocation
2076
+ # The base price charged per group
1903
2077
  sig { returns(String) }
1904
- attr_accessor :unit_amount
2078
+ attr_accessor :per_unit_rate
1905
2079
 
1906
- # Configuration for cumulative_grouped_allocation pricing
2080
+ # Configuration for grouped_with_min_max_thresholds pricing
1907
2081
  sig do
1908
2082
  params(
1909
- cumulative_allocation: String,
1910
- group_allocation: String,
1911
2083
  grouping_key: String,
1912
- unit_amount: String
2084
+ maximum_charge: String,
2085
+ minimum_charge: String,
2086
+ per_unit_rate: String
1913
2087
  ).returns(T.attached_class)
1914
2088
  end
1915
2089
  def self.new(
1916
- # The overall allocation across all groups
1917
- cumulative_allocation:,
1918
- # The allocation per individual group
1919
- group_allocation:,
1920
- # The event property used to group usage before applying allocations
2090
+ # The event property used to group before applying thresholds
1921
2091
  grouping_key:,
1922
- # The amount to charge for each unit outside of the allocation
1923
- unit_amount:
1924
- )
2092
+ # The maximum amount to charge each group
2093
+ maximum_charge:,
2094
+ # The minimum amount to charge each group, regardless of usage
2095
+ minimum_charge:,
2096
+ # The base price charged per group
2097
+ per_unit_rate:
2098
+ )
1925
2099
  end
1926
2100
 
1927
2101
  sig do
1928
2102
  override.returns(
1929
2103
  {
1930
- cumulative_allocation: String,
1931
- group_allocation: String,
1932
2104
  grouping_key: String,
1933
- unit_amount: String
2105
+ maximum_charge: String,
2106
+ minimum_charge: String,
2107
+ per_unit_rate: String
1934
2108
  }
1935
2109
  )
1936
2110
  end
@@ -1939,11 +2113,11 @@ module Orb
1939
2113
  end
1940
2114
  end
1941
2115
 
1942
- class Percent < Orb::Internal::Type::BaseModel
2116
+ class CumulativeGroupedAllocation < Orb::Internal::Type::BaseModel
1943
2117
  OrHash =
1944
2118
  T.type_alias do
1945
2119
  T.any(
1946
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent,
2120
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation,
1947
2121
  Orb::Internal::AnyHash
1948
2122
  )
1949
2123
  end
@@ -1951,11 +2125,27 @@ module Orb
1951
2125
  # The cadence to bill for this price on.
1952
2126
  sig do
1953
2127
  returns(
1954
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::OrSymbol
2128
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::OrSymbol
1955
2129
  )
1956
2130
  end
1957
2131
  attr_accessor :cadence
1958
2132
 
2133
+ # Configuration for cumulative_grouped_allocation pricing
2134
+ sig do
2135
+ returns(
2136
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig
2137
+ )
2138
+ end
2139
+ attr_reader :cumulative_grouped_allocation_config
2140
+
2141
+ sig do
2142
+ params(
2143
+ cumulative_grouped_allocation_config:
2144
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig::OrHash
2145
+ ).void
2146
+ end
2147
+ attr_writer :cumulative_grouped_allocation_config
2148
+
1959
2149
  # An ISO 4217 currency string for which this price is billed in.
1960
2150
  sig { returns(String) }
1961
2151
  attr_accessor :currency
@@ -1972,22 +2162,6 @@ module Orb
1972
2162
  sig { returns(String) }
1973
2163
  attr_accessor :name
1974
2164
 
1975
- # Configuration for percent pricing
1976
- sig do
1977
- returns(
1978
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig
1979
- )
1980
- end
1981
- attr_reader :percent_config
1982
-
1983
- sig do
1984
- params(
1985
- percent_config:
1986
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig::OrHash
1987
- ).void
1988
- end
1989
- attr_writer :percent_config
1990
-
1991
2165
  # The id of the billable metric for the price. Only needed if the price is
1992
2166
  # usage-based.
1993
2167
  sig { returns(T.nilable(String)) }
@@ -2079,12 +2253,12 @@ module Orb
2079
2253
  sig do
2080
2254
  params(
2081
2255
  cadence:
2082
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::OrSymbol,
2256
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::OrSymbol,
2257
+ cumulative_grouped_allocation_config:
2258
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig::OrHash,
2083
2259
  currency: String,
2084
2260
  item_id: String,
2085
2261
  name: String,
2086
- percent_config:
2087
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig::OrHash,
2088
2262
  billable_metric_id: T.nilable(String),
2089
2263
  billed_in_advance: T.nilable(T::Boolean),
2090
2264
  billing_cycle_configuration:
@@ -2112,14 +2286,14 @@ module Orb
2112
2286
  def self.new(
2113
2287
  # The cadence to bill for this price on.
2114
2288
  cadence:,
2289
+ # Configuration for cumulative_grouped_allocation pricing
2290
+ cumulative_grouped_allocation_config:,
2115
2291
  # An ISO 4217 currency string for which this price is billed in.
2116
2292
  currency:,
2117
2293
  # The id of the item the price will be associated with.
2118
2294
  item_id:,
2119
2295
  # The name of the price.
2120
2296
  name:,
2121
- # Configuration for percent pricing
2122
- percent_config:,
2123
2297
  # The id of the billable metric for the price. Only needed if the price is
2124
2298
  # usage-based.
2125
2299
  billable_metric_id: nil,
@@ -2152,7 +2326,7 @@ module Orb
2152
2326
  # by setting `metadata` to `null`.
2153
2327
  metadata: nil,
2154
2328
  # The pricing model type
2155
- model_type: :percent
2329
+ model_type: :cumulative_grouped_allocation
2156
2330
  )
2157
2331
  end
2158
2332
 
@@ -2160,13 +2334,13 @@ module Orb
2160
2334
  override.returns(
2161
2335
  {
2162
2336
  cadence:
2163
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::OrSymbol,
2337
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::OrSymbol,
2338
+ cumulative_grouped_allocation_config:
2339
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig,
2164
2340
  currency: String,
2165
2341
  item_id: String,
2166
2342
  model_type: Symbol,
2167
2343
  name: String,
2168
- percent_config:
2169
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig,
2170
2344
  billable_metric_id: T.nilable(String),
2171
2345
  billed_in_advance: T.nilable(T::Boolean),
2172
2346
  billing_cycle_configuration:
@@ -2202,7 +2376,7 @@ module Orb
2202
2376
  T.type_alias do
2203
2377
  T.all(
2204
2378
  Symbol,
2205
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence
2379
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence
2206
2380
  )
2207
2381
  end
2208
2382
  OrSymbol = T.type_alias { T.any(Symbol, String) }
@@ -2210,38 +2384,38 @@ module Orb
2210
2384
  ANNUAL =
2211
2385
  T.let(
2212
2386
  :annual,
2213
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2387
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2214
2388
  )
2215
2389
  SEMI_ANNUAL =
2216
2390
  T.let(
2217
2391
  :semi_annual,
2218
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2392
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2219
2393
  )
2220
2394
  MONTHLY =
2221
2395
  T.let(
2222
2396
  :monthly,
2223
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2397
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2224
2398
  )
2225
2399
  QUARTERLY =
2226
2400
  T.let(
2227
2401
  :quarterly,
2228
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2402
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2229
2403
  )
2230
2404
  ONE_TIME =
2231
2405
  T.let(
2232
2406
  :one_time,
2233
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2407
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2234
2408
  )
2235
2409
  CUSTOM =
2236
2410
  T.let(
2237
2411
  :custom,
2238
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2412
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2239
2413
  )
2240
2414
 
2241
2415
  sig do
2242
2416
  override.returns(
2243
2417
  T::Array[
2244
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2418
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2245
2419
  ]
2246
2420
  )
2247
2421
  end
@@ -2249,38 +2423,72 @@ module Orb
2249
2423
  end
2250
2424
  end
2251
2425
 
2252
- class PercentConfig < Orb::Internal::Type::BaseModel
2426
+ class CumulativeGroupedAllocationConfig < Orb::Internal::Type::BaseModel
2253
2427
  OrHash =
2254
2428
  T.type_alias do
2255
2429
  T.any(
2256
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig,
2430
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig,
2257
2431
  Orb::Internal::AnyHash
2258
2432
  )
2259
2433
  end
2260
2434
 
2261
- # What percent of the component subtotals to charge
2262
- sig { returns(Float) }
2263
- attr_accessor :percent
2435
+ # The overall allocation across all groups
2436
+ sig { returns(String) }
2437
+ attr_accessor :cumulative_allocation
2264
2438
 
2265
- # Configuration for percent pricing
2266
- sig { params(percent: Float).returns(T.attached_class) }
2439
+ # The allocation per individual group
2440
+ sig { returns(String) }
2441
+ attr_accessor :group_allocation
2442
+
2443
+ # The event property used to group usage before applying allocations
2444
+ sig { returns(String) }
2445
+ attr_accessor :grouping_key
2446
+
2447
+ # The amount to charge for each unit outside of the allocation
2448
+ sig { returns(String) }
2449
+ attr_accessor :unit_amount
2450
+
2451
+ # Configuration for cumulative_grouped_allocation pricing
2452
+ sig do
2453
+ params(
2454
+ cumulative_allocation: String,
2455
+ group_allocation: String,
2456
+ grouping_key: String,
2457
+ unit_amount: String
2458
+ ).returns(T.attached_class)
2459
+ end
2267
2460
  def self.new(
2268
- # What percent of the component subtotals to charge
2269
- percent:
2461
+ # The overall allocation across all groups
2462
+ cumulative_allocation:,
2463
+ # The allocation per individual group
2464
+ group_allocation:,
2465
+ # The event property used to group usage before applying allocations
2466
+ grouping_key:,
2467
+ # The amount to charge for each unit outside of the allocation
2468
+ unit_amount:
2270
2469
  )
2271
2470
  end
2272
2471
 
2273
- sig { override.returns({ percent: Float }) }
2472
+ sig do
2473
+ override.returns(
2474
+ {
2475
+ cumulative_allocation: String,
2476
+ group_allocation: String,
2477
+ grouping_key: String,
2478
+ unit_amount: String
2479
+ }
2480
+ )
2481
+ end
2274
2482
  def to_hash
2275
2483
  end
2276
2484
  end
2277
2485
  end
2278
2486
 
2279
- class EventOutput < Orb::Internal::Type::BaseModel
2487
+ class DailyCreditAllowance < Orb::Internal::Type::BaseModel
2280
2488
  OrHash =
2281
2489
  T.type_alias do
2282
2490
  T.any(
2283
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput,
2491
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance,
2284
2492
  Orb::Internal::AnyHash
2285
2493
  )
2286
2494
  end
@@ -2288,7 +2496,7 @@ module Orb
2288
2496
  # The cadence to bill for this price on.
2289
2497
  sig do
2290
2498
  returns(
2291
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::OrSymbol
2499
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::OrSymbol
2292
2500
  )
2293
2501
  end
2294
2502
  attr_accessor :cadence
@@ -2297,21 +2505,21 @@ module Orb
2297
2505
  sig { returns(String) }
2298
2506
  attr_accessor :currency
2299
2507
 
2300
- # Configuration for event_output pricing
2508
+ # Configuration for daily_credit_allowance pricing
2301
2509
  sig do
2302
2510
  returns(
2303
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig
2511
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig
2304
2512
  )
2305
2513
  end
2306
- attr_reader :event_output_config
2514
+ attr_reader :daily_credit_allowance_config
2307
2515
 
2308
2516
  sig do
2309
2517
  params(
2310
- event_output_config:
2311
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig::OrHash
2518
+ daily_credit_allowance_config:
2519
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig::OrHash
2312
2520
  ).void
2313
2521
  end
2314
- attr_writer :event_output_config
2522
+ attr_writer :daily_credit_allowance_config
2315
2523
 
2316
2524
  # The id of the item the price will be associated with.
2317
2525
  sig { returns(String) }
@@ -2416,10 +2624,10 @@ module Orb
2416
2624
  sig do
2417
2625
  params(
2418
2626
  cadence:
2419
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::OrSymbol,
2627
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::OrSymbol,
2420
2628
  currency: String,
2421
- event_output_config:
2422
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig::OrHash,
2629
+ daily_credit_allowance_config:
2630
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig::OrHash,
2423
2631
  item_id: String,
2424
2632
  name: String,
2425
2633
  billable_metric_id: T.nilable(String),
@@ -2451,8 +2659,8 @@ module Orb
2451
2659
  cadence:,
2452
2660
  # An ISO 4217 currency string for which this price is billed in.
2453
2661
  currency:,
2454
- # Configuration for event_output pricing
2455
- event_output_config:,
2662
+ # Configuration for daily_credit_allowance pricing
2663
+ daily_credit_allowance_config:,
2456
2664
  # The id of the item the price will be associated with.
2457
2665
  item_id:,
2458
2666
  # The name of the price.
@@ -2489,7 +2697,7 @@ module Orb
2489
2697
  # by setting `metadata` to `null`.
2490
2698
  metadata: nil,
2491
2699
  # The pricing model type
2492
- model_type: :event_output
2700
+ model_type: :daily_credit_allowance
2493
2701
  )
2494
2702
  end
2495
2703
 
@@ -2497,10 +2705,10 @@ module Orb
2497
2705
  override.returns(
2498
2706
  {
2499
2707
  cadence:
2500
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::OrSymbol,
2708
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::OrSymbol,
2501
2709
  currency: String,
2502
- event_output_config:
2503
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig,
2710
+ daily_credit_allowance_config:
2711
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig,
2504
2712
  item_id: String,
2505
2713
  model_type: Symbol,
2506
2714
  name: String,
@@ -2539,7 +2747,7 @@ module Orb
2539
2747
  T.type_alias do
2540
2748
  T.all(
2541
2749
  Symbol,
2542
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence
2750
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence
2543
2751
  )
2544
2752
  end
2545
2753
  OrSymbol = T.type_alias { T.any(Symbol, String) }
@@ -2547,38 +2755,38 @@ module Orb
2547
2755
  ANNUAL =
2548
2756
  T.let(
2549
2757
  :annual,
2550
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2758
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2551
2759
  )
2552
2760
  SEMI_ANNUAL =
2553
2761
  T.let(
2554
2762
  :semi_annual,
2555
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2763
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2556
2764
  )
2557
2765
  MONTHLY =
2558
2766
  T.let(
2559
2767
  :monthly,
2560
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2768
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2561
2769
  )
2562
2770
  QUARTERLY =
2563
2771
  T.let(
2564
2772
  :quarterly,
2565
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2773
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2566
2774
  )
2567
2775
  ONE_TIME =
2568
2776
  T.let(
2569
2777
  :one_time,
2570
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2778
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2571
2779
  )
2572
2780
  CUSTOM =
2573
2781
  T.let(
2574
2782
  :custom,
2575
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2783
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2576
2784
  )
2577
2785
 
2578
2786
  sig do
2579
2787
  override.returns(
2580
2788
  T::Array[
2581
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2789
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2582
2790
  ]
2583
2791
  )
2584
2792
  end
@@ -2586,112 +2794,1337 @@ module Orb
2586
2794
  end
2587
2795
  end
2588
2796
 
2589
- class EventOutputConfig < Orb::Internal::Type::BaseModel
2797
+ class DailyCreditAllowanceConfig < Orb::Internal::Type::BaseModel
2590
2798
  OrHash =
2591
2799
  T.type_alias do
2592
2800
  T.any(
2593
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig,
2801
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig,
2594
2802
  Orb::Internal::AnyHash
2595
2803
  )
2596
2804
  end
2597
2805
 
2598
- # The key in the event data to extract the unit rate from.
2806
+ # Credits granted per day. Lose-it-or-use-it; does not roll over.
2599
2807
  sig { returns(String) }
2600
- attr_accessor :unit_rating_key
2808
+ attr_accessor :daily_allowance
2601
2809
 
2602
- # If provided, this amount will be used as the unit rate when an event does not
2603
- # have a value for the `unit_rating_key`. If not provided, events missing a unit
2604
- # rate will be ignored.
2605
- sig { returns(T.nilable(String)) }
2606
- attr_accessor :default_unit_rate
2810
+ # Default per-unit credit rate for any usage not bucketed into a specified
2811
+ # matrix_value
2812
+ sig { returns(String) }
2813
+ attr_accessor :default_unit_amount
2607
2814
 
2608
- # An optional key in the event data to group by (e.g., event ID). All events will
2609
- # also be grouped by their unit rate.
2610
- sig { returns(T.nilable(String)) }
2611
- attr_accessor :grouping_key
2815
+ # One or two event property values to evaluate matrix groups by
2816
+ sig { returns(T::Array[T.nilable(String)]) }
2817
+ attr_accessor :dimensions
2612
2818
 
2613
- # Configuration for event_output pricing
2819
+ # Event property whose value identifies the day bucket the event belongs to (e.g.
2820
+ # 'event_day' set to an ISO date string in the customer's timezone). The allowance
2821
+ # resets per distinct value of this property.
2822
+ sig { returns(String) }
2823
+ attr_accessor :event_day_property
2824
+
2825
+ # Per-dimension credit rates
2826
+ sig do
2827
+ returns(
2828
+ T::Array[
2829
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig::MatrixValue
2830
+ ]
2831
+ )
2832
+ end
2833
+ attr_accessor :matrix_values
2834
+
2835
+ # Configuration for daily_credit_allowance pricing
2614
2836
  sig do
2615
2837
  params(
2616
- unit_rating_key: String,
2617
- default_unit_rate: T.nilable(String),
2618
- grouping_key: T.nilable(String)
2838
+ daily_allowance: String,
2839
+ default_unit_amount: String,
2840
+ dimensions: T::Array[T.nilable(String)],
2841
+ event_day_property: String,
2842
+ matrix_values:
2843
+ T::Array[
2844
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig::MatrixValue::OrHash
2845
+ ]
2619
2846
  ).returns(T.attached_class)
2620
2847
  end
2621
2848
  def self.new(
2622
- # The key in the event data to extract the unit rate from.
2623
- unit_rating_key:,
2624
- # If provided, this amount will be used as the unit rate when an event does not
2625
- # have a value for the `unit_rating_key`. If not provided, events missing a unit
2626
- # rate will be ignored.
2627
- default_unit_rate: nil,
2628
- # An optional key in the event data to group by (e.g., event ID). All events will
2629
- # also be grouped by their unit rate.
2630
- grouping_key: nil
2849
+ # Credits granted per day. Lose-it-or-use-it; does not roll over.
2850
+ daily_allowance:,
2851
+ # Default per-unit credit rate for any usage not bucketed into a specified
2852
+ # matrix_value
2853
+ default_unit_amount:,
2854
+ # One or two event property values to evaluate matrix groups by
2855
+ dimensions:,
2856
+ # Event property whose value identifies the day bucket the event belongs to (e.g.
2857
+ # 'event_day' set to an ISO date string in the customer's timezone). The allowance
2858
+ # resets per distinct value of this property.
2859
+ event_day_property:,
2860
+ # Per-dimension credit rates
2861
+ matrix_values:
2631
2862
  )
2632
2863
  end
2633
2864
 
2634
2865
  sig do
2635
2866
  override.returns(
2636
2867
  {
2637
- unit_rating_key: String,
2638
- default_unit_rate: T.nilable(String),
2639
- grouping_key: T.nilable(String)
2868
+ daily_allowance: String,
2869
+ default_unit_amount: String,
2870
+ dimensions: T::Array[T.nilable(String)],
2871
+ event_day_property: String,
2872
+ matrix_values:
2873
+ T::Array[
2874
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig::MatrixValue
2875
+ ]
2640
2876
  }
2641
2877
  )
2642
2878
  end
2643
2879
  def to_hash
2644
2880
  end
2645
- end
2646
- end
2647
-
2648
- sig do
2649
- override.returns(
2650
- T::Array[
2651
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Variants
2652
- ]
2653
- )
2654
- end
2655
- def self.variants
2656
- end
2657
- end
2658
- end
2659
2881
 
2660
- class AddAdjustment < Orb::Internal::Type::BaseModel
2661
- OrHash =
2662
- T.type_alias do
2663
- T.any(
2664
- Orb::SubscriptionPriceIntervalsParams::AddAdjustment,
2665
- Orb::Internal::AnyHash
2666
- )
2667
- end
2882
+ class MatrixValue < Orb::Internal::Type::BaseModel
2883
+ OrHash =
2884
+ T.type_alias do
2885
+ T.any(
2886
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig::MatrixValue,
2887
+ Orb::Internal::AnyHash
2888
+ )
2889
+ end
2668
2890
 
2669
- # The start date of the adjustment interval. This is the date that the adjustment
2670
- # will start affecting prices on the subscription. The adjustment will apply to
2671
- # invoice dates that overlap with this `start_date`. This `start_date` is treated
2672
- # as inclusive for in-advance prices, and exclusive for in-arrears prices.
2673
- sig { returns(T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol)) }
2674
- attr_accessor :start_date
2891
+ # One or two matrix keys to filter usage to this value by. For example, ["model"]
2892
+ # could be used to apply a different credit rate to each AI model.
2893
+ sig { returns(T::Array[T.nilable(String)]) }
2894
+ attr_accessor :dimension_values
2675
2895
 
2676
- # The definition of a new adjustment to create and add to the subscription.
2677
- sig do
2678
- returns(
2679
- T.nilable(
2680
- T.any(
2681
- Orb::NewPercentageDiscount,
2682
- Orb::NewUsageDiscount,
2683
- Orb::NewAmountDiscount,
2684
- Orb::NewMinimum,
2685
- Orb::NewMaximum
2686
- )
2687
- )
2688
- )
2689
- end
2690
- attr_accessor :adjustment
2896
+ # Credits charged per unit of usage matching the specified dimension_values
2897
+ sig { returns(String) }
2898
+ attr_accessor :unit_amount
2691
2899
 
2692
- # The ID of the adjustment to add to the subscription. Adjustment IDs can be
2693
- # re-used from existing subscriptions or plans, but adjustments associated with
2694
- # coupon redemptions cannot be re-used.
2900
+ # Per-dimension credit price for the daily credit allowance model.
2901
+ sig do
2902
+ params(
2903
+ dimension_values: T::Array[T.nilable(String)],
2904
+ unit_amount: String
2905
+ ).returns(T.attached_class)
2906
+ end
2907
+ def self.new(
2908
+ # One or two matrix keys to filter usage to this value by. For example, ["model"]
2909
+ # could be used to apply a different credit rate to each AI model.
2910
+ dimension_values:,
2911
+ # Credits charged per unit of usage matching the specified dimension_values
2912
+ unit_amount:
2913
+ )
2914
+ end
2915
+
2916
+ sig do
2917
+ override.returns(
2918
+ {
2919
+ dimension_values: T::Array[T.nilable(String)],
2920
+ unit_amount: String
2921
+ }
2922
+ )
2923
+ end
2924
+ def to_hash
2925
+ end
2926
+ end
2927
+ end
2928
+ end
2929
+
2930
+ class MeteredAllowance < Orb::Internal::Type::BaseModel
2931
+ OrHash =
2932
+ T.type_alias do
2933
+ T.any(
2934
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance,
2935
+ Orb::Internal::AnyHash
2936
+ )
2937
+ end
2938
+
2939
+ # The cadence to bill for this price on.
2940
+ sig do
2941
+ returns(
2942
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::Cadence::OrSymbol
2943
+ )
2944
+ end
2945
+ attr_accessor :cadence
2946
+
2947
+ # An ISO 4217 currency string for which this price is billed in.
2948
+ sig { returns(String) }
2949
+ attr_accessor :currency
2950
+
2951
+ # The id of the item the price will be associated with.
2952
+ sig { returns(String) }
2953
+ attr_accessor :item_id
2954
+
2955
+ # Configuration for metered_allowance pricing
2956
+ sig do
2957
+ returns(
2958
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::MeteredAllowanceConfig
2959
+ )
2960
+ end
2961
+ attr_reader :metered_allowance_config
2962
+
2963
+ sig do
2964
+ params(
2965
+ metered_allowance_config:
2966
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::MeteredAllowanceConfig::OrHash
2967
+ ).void
2968
+ end
2969
+ attr_writer :metered_allowance_config
2970
+
2971
+ # The pricing model type
2972
+ sig { returns(Symbol) }
2973
+ attr_accessor :model_type
2974
+
2975
+ # The name of the price.
2976
+ sig { returns(String) }
2977
+ attr_accessor :name
2978
+
2979
+ # The id of the billable metric for the price. Only needed if the price is
2980
+ # usage-based.
2981
+ sig { returns(T.nilable(String)) }
2982
+ attr_accessor :billable_metric_id
2983
+
2984
+ # If the Price represents a fixed cost, the price will be billed in-advance if
2985
+ # this is true, and in-arrears if this is false.
2986
+ sig { returns(T.nilable(T::Boolean)) }
2987
+ attr_accessor :billed_in_advance
2988
+
2989
+ # For custom cadence: specifies the duration of the billing period in days or
2990
+ # months.
2991
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
2992
+ attr_reader :billing_cycle_configuration
2993
+
2994
+ sig do
2995
+ params(
2996
+ billing_cycle_configuration:
2997
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
2998
+ ).void
2999
+ end
3000
+ attr_writer :billing_cycle_configuration
3001
+
3002
+ # The per unit conversion rate of the price currency to the invoicing currency.
3003
+ sig { returns(T.nilable(Float)) }
3004
+ attr_accessor :conversion_rate
3005
+
3006
+ # The configuration for the rate of the price currency to the invoicing currency.
3007
+ sig do
3008
+ returns(
3009
+ T.nilable(
3010
+ T.any(
3011
+ Orb::UnitConversionRateConfig,
3012
+ Orb::TieredConversionRateConfig
3013
+ )
3014
+ )
3015
+ )
3016
+ end
3017
+ attr_accessor :conversion_rate_config
3018
+
3019
+ # For dimensional price: specifies a price group and dimension values
3020
+ sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) }
3021
+ attr_reader :dimensional_price_configuration
3022
+
3023
+ sig do
3024
+ params(
3025
+ dimensional_price_configuration:
3026
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash)
3027
+ ).void
3028
+ end
3029
+ attr_writer :dimensional_price_configuration
3030
+
3031
+ # An alias for the price.
3032
+ sig { returns(T.nilable(String)) }
3033
+ attr_accessor :external_price_id
3034
+
3035
+ # If the Price represents a fixed cost, this represents the quantity of units
3036
+ # applied.
3037
+ sig { returns(T.nilable(Float)) }
3038
+ attr_accessor :fixed_price_quantity
3039
+
3040
+ # The property used to group this price on an invoice
3041
+ sig { returns(T.nilable(String)) }
3042
+ attr_accessor :invoice_grouping_key
3043
+
3044
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
3045
+ # If unspecified, a single invoice is produced per billing cycle.
3046
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
3047
+ attr_reader :invoicing_cycle_configuration
3048
+
3049
+ sig do
3050
+ params(
3051
+ invoicing_cycle_configuration:
3052
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
3053
+ ).void
3054
+ end
3055
+ attr_writer :invoicing_cycle_configuration
3056
+
3057
+ # The ID of the license type to associate with this price.
3058
+ sig { returns(T.nilable(String)) }
3059
+ attr_accessor :license_type_id
3060
+
3061
+ # User-specified key/value pairs for the resource. Individual keys can be removed
3062
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
3063
+ # by setting `metadata` to `null`.
3064
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
3065
+ attr_accessor :metadata
3066
+
3067
+ sig do
3068
+ params(
3069
+ cadence:
3070
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::Cadence::OrSymbol,
3071
+ currency: String,
3072
+ item_id: String,
3073
+ metered_allowance_config:
3074
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::MeteredAllowanceConfig::OrHash,
3075
+ name: String,
3076
+ billable_metric_id: T.nilable(String),
3077
+ billed_in_advance: T.nilable(T::Boolean),
3078
+ billing_cycle_configuration:
3079
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
3080
+ conversion_rate: T.nilable(Float),
3081
+ conversion_rate_config:
3082
+ T.nilable(
3083
+ T.any(
3084
+ Orb::UnitConversionRateConfig::OrHash,
3085
+ Orb::TieredConversionRateConfig::OrHash
3086
+ )
3087
+ ),
3088
+ dimensional_price_configuration:
3089
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash),
3090
+ external_price_id: T.nilable(String),
3091
+ fixed_price_quantity: T.nilable(Float),
3092
+ invoice_grouping_key: T.nilable(String),
3093
+ invoicing_cycle_configuration:
3094
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
3095
+ license_type_id: T.nilable(String),
3096
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
3097
+ model_type: Symbol
3098
+ ).returns(T.attached_class)
3099
+ end
3100
+ def self.new(
3101
+ # The cadence to bill for this price on.
3102
+ cadence:,
3103
+ # An ISO 4217 currency string for which this price is billed in.
3104
+ currency:,
3105
+ # The id of the item the price will be associated with.
3106
+ item_id:,
3107
+ # Configuration for metered_allowance pricing
3108
+ metered_allowance_config:,
3109
+ # The name of the price.
3110
+ name:,
3111
+ # The id of the billable metric for the price. Only needed if the price is
3112
+ # usage-based.
3113
+ billable_metric_id: nil,
3114
+ # If the Price represents a fixed cost, the price will be billed in-advance if
3115
+ # this is true, and in-arrears if this is false.
3116
+ billed_in_advance: nil,
3117
+ # For custom cadence: specifies the duration of the billing period in days or
3118
+ # months.
3119
+ billing_cycle_configuration: nil,
3120
+ # The per unit conversion rate of the price currency to the invoicing currency.
3121
+ conversion_rate: nil,
3122
+ # The configuration for the rate of the price currency to the invoicing currency.
3123
+ conversion_rate_config: nil,
3124
+ # For dimensional price: specifies a price group and dimension values
3125
+ dimensional_price_configuration: nil,
3126
+ # An alias for the price.
3127
+ external_price_id: nil,
3128
+ # If the Price represents a fixed cost, this represents the quantity of units
3129
+ # applied.
3130
+ fixed_price_quantity: nil,
3131
+ # The property used to group this price on an invoice
3132
+ invoice_grouping_key: nil,
3133
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
3134
+ # If unspecified, a single invoice is produced per billing cycle.
3135
+ invoicing_cycle_configuration: nil,
3136
+ # The ID of the license type to associate with this price.
3137
+ license_type_id: nil,
3138
+ # User-specified key/value pairs for the resource. Individual keys can be removed
3139
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
3140
+ # by setting `metadata` to `null`.
3141
+ metadata: nil,
3142
+ # The pricing model type
3143
+ model_type: :metered_allowance
3144
+ )
3145
+ end
3146
+
3147
+ sig do
3148
+ override.returns(
3149
+ {
3150
+ cadence:
3151
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::Cadence::OrSymbol,
3152
+ currency: String,
3153
+ item_id: String,
3154
+ metered_allowance_config:
3155
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::MeteredAllowanceConfig,
3156
+ model_type: Symbol,
3157
+ name: String,
3158
+ billable_metric_id: T.nilable(String),
3159
+ billed_in_advance: T.nilable(T::Boolean),
3160
+ billing_cycle_configuration:
3161
+ T.nilable(Orb::NewBillingCycleConfiguration),
3162
+ conversion_rate: T.nilable(Float),
3163
+ conversion_rate_config:
3164
+ T.nilable(
3165
+ T.any(
3166
+ Orb::UnitConversionRateConfig,
3167
+ Orb::TieredConversionRateConfig
3168
+ )
3169
+ ),
3170
+ dimensional_price_configuration:
3171
+ T.nilable(Orb::NewDimensionalPriceConfiguration),
3172
+ external_price_id: T.nilable(String),
3173
+ fixed_price_quantity: T.nilable(Float),
3174
+ invoice_grouping_key: T.nilable(String),
3175
+ invoicing_cycle_configuration:
3176
+ T.nilable(Orb::NewBillingCycleConfiguration),
3177
+ license_type_id: T.nilable(String),
3178
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])
3179
+ }
3180
+ )
3181
+ end
3182
+ def to_hash
3183
+ end
3184
+
3185
+ # The cadence to bill for this price on.
3186
+ module Cadence
3187
+ extend Orb::Internal::Type::Enum
3188
+
3189
+ TaggedSymbol =
3190
+ T.type_alias do
3191
+ T.all(
3192
+ Symbol,
3193
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::Cadence
3194
+ )
3195
+ end
3196
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
3197
+
3198
+ ANNUAL =
3199
+ T.let(
3200
+ :annual,
3201
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::Cadence::TaggedSymbol
3202
+ )
3203
+ SEMI_ANNUAL =
3204
+ T.let(
3205
+ :semi_annual,
3206
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::Cadence::TaggedSymbol
3207
+ )
3208
+ MONTHLY =
3209
+ T.let(
3210
+ :monthly,
3211
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::Cadence::TaggedSymbol
3212
+ )
3213
+ QUARTERLY =
3214
+ T.let(
3215
+ :quarterly,
3216
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::Cadence::TaggedSymbol
3217
+ )
3218
+ ONE_TIME =
3219
+ T.let(
3220
+ :one_time,
3221
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::Cadence::TaggedSymbol
3222
+ )
3223
+ CUSTOM =
3224
+ T.let(
3225
+ :custom,
3226
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::Cadence::TaggedSymbol
3227
+ )
3228
+
3229
+ sig do
3230
+ override.returns(
3231
+ T::Array[
3232
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::Cadence::TaggedSymbol
3233
+ ]
3234
+ )
3235
+ end
3236
+ def self.values
3237
+ end
3238
+ end
3239
+
3240
+ class MeteredAllowanceConfig < Orb::Internal::Type::BaseModel
3241
+ OrHash =
3242
+ T.type_alias do
3243
+ T.any(
3244
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::MeteredAllowanceConfig,
3245
+ Orb::Internal::AnyHash
3246
+ )
3247
+ end
3248
+
3249
+ # The grouping_key value whose summed quantity represents the allowance for this
3250
+ # period (e.g. 'storage_snapshot' emitting 3 × avg storage). Capped at consumption
3251
+ # — credit can never exceed actual usage.
3252
+ sig { returns(String) }
3253
+ attr_accessor :allowance_grouping_value
3254
+
3255
+ # The grouping_key value whose summed quantity represents consumption (e.g.
3256
+ # 'download'). Charged at unit_amount.
3257
+ sig { returns(String) }
3258
+ attr_accessor :consumption_grouping_value
3259
+
3260
+ # Event property used to partition the metric into consumption and allowance
3261
+ # quantities (e.g. 'event_name'). The metric is queried with this key and the two
3262
+ # values below select which partition is which.
3263
+ sig { returns(String) }
3264
+ attr_accessor :grouping_key
3265
+
3266
+ # Per-unit price applied to gross consumption and to the allowance credit.
3267
+ sig { returns(String) }
3268
+ attr_accessor :unit_amount
3269
+
3270
+ # Sub-line label for the credit row (e.g. 'Up to 3x free egress').
3271
+ sig { returns(T.nilable(String)) }
3272
+ attr_reader :allowance_display_name
3273
+
3274
+ sig { params(allowance_display_name: String).void }
3275
+ attr_writer :allowance_display_name
3276
+
3277
+ # Sub-line label for the gross consumption row (e.g. 'bytes gotten').
3278
+ sig { returns(T.nilable(String)) }
3279
+ attr_reader :consumption_display_name
3280
+
3281
+ sig { params(consumption_display_name: String).void }
3282
+ attr_writer :consumption_display_name
3283
+
3284
+ # Configuration for metered_allowance pricing
3285
+ sig do
3286
+ params(
3287
+ allowance_grouping_value: String,
3288
+ consumption_grouping_value: String,
3289
+ grouping_key: String,
3290
+ unit_amount: String,
3291
+ allowance_display_name: String,
3292
+ consumption_display_name: String
3293
+ ).returns(T.attached_class)
3294
+ end
3295
+ def self.new(
3296
+ # The grouping_key value whose summed quantity represents the allowance for this
3297
+ # period (e.g. 'storage_snapshot' emitting 3 × avg storage). Capped at consumption
3298
+ # — credit can never exceed actual usage.
3299
+ allowance_grouping_value:,
3300
+ # The grouping_key value whose summed quantity represents consumption (e.g.
3301
+ # 'download'). Charged at unit_amount.
3302
+ consumption_grouping_value:,
3303
+ # Event property used to partition the metric into consumption and allowance
3304
+ # quantities (e.g. 'event_name'). The metric is queried with this key and the two
3305
+ # values below select which partition is which.
3306
+ grouping_key:,
3307
+ # Per-unit price applied to gross consumption and to the allowance credit.
3308
+ unit_amount:,
3309
+ # Sub-line label for the credit row (e.g. 'Up to 3x free egress').
3310
+ allowance_display_name: nil,
3311
+ # Sub-line label for the gross consumption row (e.g. 'bytes gotten').
3312
+ consumption_display_name: nil
3313
+ )
3314
+ end
3315
+
3316
+ sig do
3317
+ override.returns(
3318
+ {
3319
+ allowance_grouping_value: String,
3320
+ consumption_grouping_value: String,
3321
+ grouping_key: String,
3322
+ unit_amount: String,
3323
+ allowance_display_name: String,
3324
+ consumption_display_name: String
3325
+ }
3326
+ )
3327
+ end
3328
+ def to_hash
3329
+ end
3330
+ end
3331
+ end
3332
+
3333
+ class Percent < Orb::Internal::Type::BaseModel
3334
+ OrHash =
3335
+ T.type_alias do
3336
+ T.any(
3337
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent,
3338
+ Orb::Internal::AnyHash
3339
+ )
3340
+ end
3341
+
3342
+ # The cadence to bill for this price on.
3343
+ sig do
3344
+ returns(
3345
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::OrSymbol
3346
+ )
3347
+ end
3348
+ attr_accessor :cadence
3349
+
3350
+ # An ISO 4217 currency string for which this price is billed in.
3351
+ sig { returns(String) }
3352
+ attr_accessor :currency
3353
+
3354
+ # The id of the item the price will be associated with.
3355
+ sig { returns(String) }
3356
+ attr_accessor :item_id
3357
+
3358
+ # The pricing model type
3359
+ sig { returns(Symbol) }
3360
+ attr_accessor :model_type
3361
+
3362
+ # The name of the price.
3363
+ sig { returns(String) }
3364
+ attr_accessor :name
3365
+
3366
+ # Configuration for percent pricing
3367
+ sig do
3368
+ returns(
3369
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig
3370
+ )
3371
+ end
3372
+ attr_reader :percent_config
3373
+
3374
+ sig do
3375
+ params(
3376
+ percent_config:
3377
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig::OrHash
3378
+ ).void
3379
+ end
3380
+ attr_writer :percent_config
3381
+
3382
+ # The id of the billable metric for the price. Only needed if the price is
3383
+ # usage-based.
3384
+ sig { returns(T.nilable(String)) }
3385
+ attr_accessor :billable_metric_id
3386
+
3387
+ # If the Price represents a fixed cost, the price will be billed in-advance if
3388
+ # this is true, and in-arrears if this is false.
3389
+ sig { returns(T.nilable(T::Boolean)) }
3390
+ attr_accessor :billed_in_advance
3391
+
3392
+ # For custom cadence: specifies the duration of the billing period in days or
3393
+ # months.
3394
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
3395
+ attr_reader :billing_cycle_configuration
3396
+
3397
+ sig do
3398
+ params(
3399
+ billing_cycle_configuration:
3400
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
3401
+ ).void
3402
+ end
3403
+ attr_writer :billing_cycle_configuration
3404
+
3405
+ # The per unit conversion rate of the price currency to the invoicing currency.
3406
+ sig { returns(T.nilable(Float)) }
3407
+ attr_accessor :conversion_rate
3408
+
3409
+ # The configuration for the rate of the price currency to the invoicing currency.
3410
+ sig do
3411
+ returns(
3412
+ T.nilable(
3413
+ T.any(
3414
+ Orb::UnitConversionRateConfig,
3415
+ Orb::TieredConversionRateConfig
3416
+ )
3417
+ )
3418
+ )
3419
+ end
3420
+ attr_accessor :conversion_rate_config
3421
+
3422
+ # For dimensional price: specifies a price group and dimension values
3423
+ sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) }
3424
+ attr_reader :dimensional_price_configuration
3425
+
3426
+ sig do
3427
+ params(
3428
+ dimensional_price_configuration:
3429
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash)
3430
+ ).void
3431
+ end
3432
+ attr_writer :dimensional_price_configuration
3433
+
3434
+ # An alias for the price.
3435
+ sig { returns(T.nilable(String)) }
3436
+ attr_accessor :external_price_id
3437
+
3438
+ # If the Price represents a fixed cost, this represents the quantity of units
3439
+ # applied.
3440
+ sig { returns(T.nilable(Float)) }
3441
+ attr_accessor :fixed_price_quantity
3442
+
3443
+ # The property used to group this price on an invoice
3444
+ sig { returns(T.nilable(String)) }
3445
+ attr_accessor :invoice_grouping_key
3446
+
3447
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
3448
+ # If unspecified, a single invoice is produced per billing cycle.
3449
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
3450
+ attr_reader :invoicing_cycle_configuration
3451
+
3452
+ sig do
3453
+ params(
3454
+ invoicing_cycle_configuration:
3455
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
3456
+ ).void
3457
+ end
3458
+ attr_writer :invoicing_cycle_configuration
3459
+
3460
+ # The ID of the license type to associate with this price.
3461
+ sig { returns(T.nilable(String)) }
3462
+ attr_accessor :license_type_id
3463
+
3464
+ # User-specified key/value pairs for the resource. Individual keys can be removed
3465
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
3466
+ # by setting `metadata` to `null`.
3467
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
3468
+ attr_accessor :metadata
3469
+
3470
+ sig do
3471
+ params(
3472
+ cadence:
3473
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::OrSymbol,
3474
+ currency: String,
3475
+ item_id: String,
3476
+ name: String,
3477
+ percent_config:
3478
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig::OrHash,
3479
+ billable_metric_id: T.nilable(String),
3480
+ billed_in_advance: T.nilable(T::Boolean),
3481
+ billing_cycle_configuration:
3482
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
3483
+ conversion_rate: T.nilable(Float),
3484
+ conversion_rate_config:
3485
+ T.nilable(
3486
+ T.any(
3487
+ Orb::UnitConversionRateConfig::OrHash,
3488
+ Orb::TieredConversionRateConfig::OrHash
3489
+ )
3490
+ ),
3491
+ dimensional_price_configuration:
3492
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash),
3493
+ external_price_id: T.nilable(String),
3494
+ fixed_price_quantity: T.nilable(Float),
3495
+ invoice_grouping_key: T.nilable(String),
3496
+ invoicing_cycle_configuration:
3497
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
3498
+ license_type_id: T.nilable(String),
3499
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
3500
+ model_type: Symbol
3501
+ ).returns(T.attached_class)
3502
+ end
3503
+ def self.new(
3504
+ # The cadence to bill for this price on.
3505
+ cadence:,
3506
+ # An ISO 4217 currency string for which this price is billed in.
3507
+ currency:,
3508
+ # The id of the item the price will be associated with.
3509
+ item_id:,
3510
+ # The name of the price.
3511
+ name:,
3512
+ # Configuration for percent pricing
3513
+ percent_config:,
3514
+ # The id of the billable metric for the price. Only needed if the price is
3515
+ # usage-based.
3516
+ billable_metric_id: nil,
3517
+ # If the Price represents a fixed cost, the price will be billed in-advance if
3518
+ # this is true, and in-arrears if this is false.
3519
+ billed_in_advance: nil,
3520
+ # For custom cadence: specifies the duration of the billing period in days or
3521
+ # months.
3522
+ billing_cycle_configuration: nil,
3523
+ # The per unit conversion rate of the price currency to the invoicing currency.
3524
+ conversion_rate: nil,
3525
+ # The configuration for the rate of the price currency to the invoicing currency.
3526
+ conversion_rate_config: nil,
3527
+ # For dimensional price: specifies a price group and dimension values
3528
+ dimensional_price_configuration: nil,
3529
+ # An alias for the price.
3530
+ external_price_id: nil,
3531
+ # If the Price represents a fixed cost, this represents the quantity of units
3532
+ # applied.
3533
+ fixed_price_quantity: nil,
3534
+ # The property used to group this price on an invoice
3535
+ invoice_grouping_key: nil,
3536
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
3537
+ # If unspecified, a single invoice is produced per billing cycle.
3538
+ invoicing_cycle_configuration: nil,
3539
+ # The ID of the license type to associate with this price.
3540
+ license_type_id: nil,
3541
+ # User-specified key/value pairs for the resource. Individual keys can be removed
3542
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
3543
+ # by setting `metadata` to `null`.
3544
+ metadata: nil,
3545
+ # The pricing model type
3546
+ model_type: :percent
3547
+ )
3548
+ end
3549
+
3550
+ sig do
3551
+ override.returns(
3552
+ {
3553
+ cadence:
3554
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::OrSymbol,
3555
+ currency: String,
3556
+ item_id: String,
3557
+ model_type: Symbol,
3558
+ name: String,
3559
+ percent_config:
3560
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig,
3561
+ billable_metric_id: T.nilable(String),
3562
+ billed_in_advance: T.nilable(T::Boolean),
3563
+ billing_cycle_configuration:
3564
+ T.nilable(Orb::NewBillingCycleConfiguration),
3565
+ conversion_rate: T.nilable(Float),
3566
+ conversion_rate_config:
3567
+ T.nilable(
3568
+ T.any(
3569
+ Orb::UnitConversionRateConfig,
3570
+ Orb::TieredConversionRateConfig
3571
+ )
3572
+ ),
3573
+ dimensional_price_configuration:
3574
+ T.nilable(Orb::NewDimensionalPriceConfiguration),
3575
+ external_price_id: T.nilable(String),
3576
+ fixed_price_quantity: T.nilable(Float),
3577
+ invoice_grouping_key: T.nilable(String),
3578
+ invoicing_cycle_configuration:
3579
+ T.nilable(Orb::NewBillingCycleConfiguration),
3580
+ license_type_id: T.nilable(String),
3581
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])
3582
+ }
3583
+ )
3584
+ end
3585
+ def to_hash
3586
+ end
3587
+
3588
+ # The cadence to bill for this price on.
3589
+ module Cadence
3590
+ extend Orb::Internal::Type::Enum
3591
+
3592
+ TaggedSymbol =
3593
+ T.type_alias do
3594
+ T.all(
3595
+ Symbol,
3596
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence
3597
+ )
3598
+ end
3599
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
3600
+
3601
+ ANNUAL =
3602
+ T.let(
3603
+ :annual,
3604
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
3605
+ )
3606
+ SEMI_ANNUAL =
3607
+ T.let(
3608
+ :semi_annual,
3609
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
3610
+ )
3611
+ MONTHLY =
3612
+ T.let(
3613
+ :monthly,
3614
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
3615
+ )
3616
+ QUARTERLY =
3617
+ T.let(
3618
+ :quarterly,
3619
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
3620
+ )
3621
+ ONE_TIME =
3622
+ T.let(
3623
+ :one_time,
3624
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
3625
+ )
3626
+ CUSTOM =
3627
+ T.let(
3628
+ :custom,
3629
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
3630
+ )
3631
+
3632
+ sig do
3633
+ override.returns(
3634
+ T::Array[
3635
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
3636
+ ]
3637
+ )
3638
+ end
3639
+ def self.values
3640
+ end
3641
+ end
3642
+
3643
+ class PercentConfig < Orb::Internal::Type::BaseModel
3644
+ OrHash =
3645
+ T.type_alias do
3646
+ T.any(
3647
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig,
3648
+ Orb::Internal::AnyHash
3649
+ )
3650
+ end
3651
+
3652
+ # Fraction of the component subtotals to charge (0 < percent <= 1).
3653
+ sig { returns(Float) }
3654
+ attr_accessor :percent
3655
+
3656
+ # Maximum amount to charge. If unset, the fee has no upper bound.
3657
+ sig { returns(T.nilable(String)) }
3658
+ attr_accessor :maximum_amount
3659
+
3660
+ # Minimum amount to charge. If unset, the fee is bounded below by 0.
3661
+ sig { returns(T.nilable(String)) }
3662
+ attr_accessor :minimum_amount
3663
+
3664
+ # If true, the minimum_amount is prorated based on the service period. The
3665
+ # maximum_amount is an absolute cap (never prorated), and the percent applied to
3666
+ # upstream subtotals is never prorated either.
3667
+ sig { returns(T.nilable(T::Boolean)) }
3668
+ attr_reader :prorated
3669
+
3670
+ sig { params(prorated: T::Boolean).void }
3671
+ attr_writer :prorated
3672
+
3673
+ # Configuration for percent pricing
3674
+ sig do
3675
+ params(
3676
+ percent: Float,
3677
+ maximum_amount: T.nilable(String),
3678
+ minimum_amount: T.nilable(String),
3679
+ prorated: T::Boolean
3680
+ ).returns(T.attached_class)
3681
+ end
3682
+ def self.new(
3683
+ # Fraction of the component subtotals to charge (0 < percent <= 1).
3684
+ percent:,
3685
+ # Maximum amount to charge. If unset, the fee has no upper bound.
3686
+ maximum_amount: nil,
3687
+ # Minimum amount to charge. If unset, the fee is bounded below by 0.
3688
+ minimum_amount: nil,
3689
+ # If true, the minimum_amount is prorated based on the service period. The
3690
+ # maximum_amount is an absolute cap (never prorated), and the percent applied to
3691
+ # upstream subtotals is never prorated either.
3692
+ prorated: nil
3693
+ )
3694
+ end
3695
+
3696
+ sig do
3697
+ override.returns(
3698
+ {
3699
+ percent: Float,
3700
+ maximum_amount: T.nilable(String),
3701
+ minimum_amount: T.nilable(String),
3702
+ prorated: T::Boolean
3703
+ }
3704
+ )
3705
+ end
3706
+ def to_hash
3707
+ end
3708
+ end
3709
+ end
3710
+
3711
+ class EventOutput < Orb::Internal::Type::BaseModel
3712
+ OrHash =
3713
+ T.type_alias do
3714
+ T.any(
3715
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput,
3716
+ Orb::Internal::AnyHash
3717
+ )
3718
+ end
3719
+
3720
+ # The cadence to bill for this price on.
3721
+ sig do
3722
+ returns(
3723
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::OrSymbol
3724
+ )
3725
+ end
3726
+ attr_accessor :cadence
3727
+
3728
+ # An ISO 4217 currency string for which this price is billed in.
3729
+ sig { returns(String) }
3730
+ attr_accessor :currency
3731
+
3732
+ # Configuration for event_output pricing
3733
+ sig do
3734
+ returns(
3735
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig
3736
+ )
3737
+ end
3738
+ attr_reader :event_output_config
3739
+
3740
+ sig do
3741
+ params(
3742
+ event_output_config:
3743
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig::OrHash
3744
+ ).void
3745
+ end
3746
+ attr_writer :event_output_config
3747
+
3748
+ # The id of the item the price will be associated with.
3749
+ sig { returns(String) }
3750
+ attr_accessor :item_id
3751
+
3752
+ # The pricing model type
3753
+ sig { returns(Symbol) }
3754
+ attr_accessor :model_type
3755
+
3756
+ # The name of the price.
3757
+ sig { returns(String) }
3758
+ attr_accessor :name
3759
+
3760
+ # The id of the billable metric for the price. Only needed if the price is
3761
+ # usage-based.
3762
+ sig { returns(T.nilable(String)) }
3763
+ attr_accessor :billable_metric_id
3764
+
3765
+ # If the Price represents a fixed cost, the price will be billed in-advance if
3766
+ # this is true, and in-arrears if this is false.
3767
+ sig { returns(T.nilable(T::Boolean)) }
3768
+ attr_accessor :billed_in_advance
3769
+
3770
+ # For custom cadence: specifies the duration of the billing period in days or
3771
+ # months.
3772
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
3773
+ attr_reader :billing_cycle_configuration
3774
+
3775
+ sig do
3776
+ params(
3777
+ billing_cycle_configuration:
3778
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
3779
+ ).void
3780
+ end
3781
+ attr_writer :billing_cycle_configuration
3782
+
3783
+ # The per unit conversion rate of the price currency to the invoicing currency.
3784
+ sig { returns(T.nilable(Float)) }
3785
+ attr_accessor :conversion_rate
3786
+
3787
+ # The configuration for the rate of the price currency to the invoicing currency.
3788
+ sig do
3789
+ returns(
3790
+ T.nilable(
3791
+ T.any(
3792
+ Orb::UnitConversionRateConfig,
3793
+ Orb::TieredConversionRateConfig
3794
+ )
3795
+ )
3796
+ )
3797
+ end
3798
+ attr_accessor :conversion_rate_config
3799
+
3800
+ # For dimensional price: specifies a price group and dimension values
3801
+ sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) }
3802
+ attr_reader :dimensional_price_configuration
3803
+
3804
+ sig do
3805
+ params(
3806
+ dimensional_price_configuration:
3807
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash)
3808
+ ).void
3809
+ end
3810
+ attr_writer :dimensional_price_configuration
3811
+
3812
+ # An alias for the price.
3813
+ sig { returns(T.nilable(String)) }
3814
+ attr_accessor :external_price_id
3815
+
3816
+ # If the Price represents a fixed cost, this represents the quantity of units
3817
+ # applied.
3818
+ sig { returns(T.nilable(Float)) }
3819
+ attr_accessor :fixed_price_quantity
3820
+
3821
+ # The property used to group this price on an invoice
3822
+ sig { returns(T.nilable(String)) }
3823
+ attr_accessor :invoice_grouping_key
3824
+
3825
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
3826
+ # If unspecified, a single invoice is produced per billing cycle.
3827
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
3828
+ attr_reader :invoicing_cycle_configuration
3829
+
3830
+ sig do
3831
+ params(
3832
+ invoicing_cycle_configuration:
3833
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
3834
+ ).void
3835
+ end
3836
+ attr_writer :invoicing_cycle_configuration
3837
+
3838
+ # The ID of the license type to associate with this price.
3839
+ sig { returns(T.nilable(String)) }
3840
+ attr_accessor :license_type_id
3841
+
3842
+ # User-specified key/value pairs for the resource. Individual keys can be removed
3843
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
3844
+ # by setting `metadata` to `null`.
3845
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
3846
+ attr_accessor :metadata
3847
+
3848
+ sig do
3849
+ params(
3850
+ cadence:
3851
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::OrSymbol,
3852
+ currency: String,
3853
+ event_output_config:
3854
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig::OrHash,
3855
+ item_id: String,
3856
+ name: String,
3857
+ billable_metric_id: T.nilable(String),
3858
+ billed_in_advance: T.nilable(T::Boolean),
3859
+ billing_cycle_configuration:
3860
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
3861
+ conversion_rate: T.nilable(Float),
3862
+ conversion_rate_config:
3863
+ T.nilable(
3864
+ T.any(
3865
+ Orb::UnitConversionRateConfig::OrHash,
3866
+ Orb::TieredConversionRateConfig::OrHash
3867
+ )
3868
+ ),
3869
+ dimensional_price_configuration:
3870
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash),
3871
+ external_price_id: T.nilable(String),
3872
+ fixed_price_quantity: T.nilable(Float),
3873
+ invoice_grouping_key: T.nilable(String),
3874
+ invoicing_cycle_configuration:
3875
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
3876
+ license_type_id: T.nilable(String),
3877
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
3878
+ model_type: Symbol
3879
+ ).returns(T.attached_class)
3880
+ end
3881
+ def self.new(
3882
+ # The cadence to bill for this price on.
3883
+ cadence:,
3884
+ # An ISO 4217 currency string for which this price is billed in.
3885
+ currency:,
3886
+ # Configuration for event_output pricing
3887
+ event_output_config:,
3888
+ # The id of the item the price will be associated with.
3889
+ item_id:,
3890
+ # The name of the price.
3891
+ name:,
3892
+ # The id of the billable metric for the price. Only needed if the price is
3893
+ # usage-based.
3894
+ billable_metric_id: nil,
3895
+ # If the Price represents a fixed cost, the price will be billed in-advance if
3896
+ # this is true, and in-arrears if this is false.
3897
+ billed_in_advance: nil,
3898
+ # For custom cadence: specifies the duration of the billing period in days or
3899
+ # months.
3900
+ billing_cycle_configuration: nil,
3901
+ # The per unit conversion rate of the price currency to the invoicing currency.
3902
+ conversion_rate: nil,
3903
+ # The configuration for the rate of the price currency to the invoicing currency.
3904
+ conversion_rate_config: nil,
3905
+ # For dimensional price: specifies a price group and dimension values
3906
+ dimensional_price_configuration: nil,
3907
+ # An alias for the price.
3908
+ external_price_id: nil,
3909
+ # If the Price represents a fixed cost, this represents the quantity of units
3910
+ # applied.
3911
+ fixed_price_quantity: nil,
3912
+ # The property used to group this price on an invoice
3913
+ invoice_grouping_key: nil,
3914
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
3915
+ # If unspecified, a single invoice is produced per billing cycle.
3916
+ invoicing_cycle_configuration: nil,
3917
+ # The ID of the license type to associate with this price.
3918
+ license_type_id: nil,
3919
+ # User-specified key/value pairs for the resource. Individual keys can be removed
3920
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
3921
+ # by setting `metadata` to `null`.
3922
+ metadata: nil,
3923
+ # The pricing model type
3924
+ model_type: :event_output
3925
+ )
3926
+ end
3927
+
3928
+ sig do
3929
+ override.returns(
3930
+ {
3931
+ cadence:
3932
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::OrSymbol,
3933
+ currency: String,
3934
+ event_output_config:
3935
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig,
3936
+ item_id: String,
3937
+ model_type: Symbol,
3938
+ name: String,
3939
+ billable_metric_id: T.nilable(String),
3940
+ billed_in_advance: T.nilable(T::Boolean),
3941
+ billing_cycle_configuration:
3942
+ T.nilable(Orb::NewBillingCycleConfiguration),
3943
+ conversion_rate: T.nilable(Float),
3944
+ conversion_rate_config:
3945
+ T.nilable(
3946
+ T.any(
3947
+ Orb::UnitConversionRateConfig,
3948
+ Orb::TieredConversionRateConfig
3949
+ )
3950
+ ),
3951
+ dimensional_price_configuration:
3952
+ T.nilable(Orb::NewDimensionalPriceConfiguration),
3953
+ external_price_id: T.nilable(String),
3954
+ fixed_price_quantity: T.nilable(Float),
3955
+ invoice_grouping_key: T.nilable(String),
3956
+ invoicing_cycle_configuration:
3957
+ T.nilable(Orb::NewBillingCycleConfiguration),
3958
+ license_type_id: T.nilable(String),
3959
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])
3960
+ }
3961
+ )
3962
+ end
3963
+ def to_hash
3964
+ end
3965
+
3966
+ # The cadence to bill for this price on.
3967
+ module Cadence
3968
+ extend Orb::Internal::Type::Enum
3969
+
3970
+ TaggedSymbol =
3971
+ T.type_alias do
3972
+ T.all(
3973
+ Symbol,
3974
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence
3975
+ )
3976
+ end
3977
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
3978
+
3979
+ ANNUAL =
3980
+ T.let(
3981
+ :annual,
3982
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
3983
+ )
3984
+ SEMI_ANNUAL =
3985
+ T.let(
3986
+ :semi_annual,
3987
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
3988
+ )
3989
+ MONTHLY =
3990
+ T.let(
3991
+ :monthly,
3992
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
3993
+ )
3994
+ QUARTERLY =
3995
+ T.let(
3996
+ :quarterly,
3997
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
3998
+ )
3999
+ ONE_TIME =
4000
+ T.let(
4001
+ :one_time,
4002
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
4003
+ )
4004
+ CUSTOM =
4005
+ T.let(
4006
+ :custom,
4007
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
4008
+ )
4009
+
4010
+ sig do
4011
+ override.returns(
4012
+ T::Array[
4013
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
4014
+ ]
4015
+ )
4016
+ end
4017
+ def self.values
4018
+ end
4019
+ end
4020
+
4021
+ class EventOutputConfig < Orb::Internal::Type::BaseModel
4022
+ OrHash =
4023
+ T.type_alias do
4024
+ T.any(
4025
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig,
4026
+ Orb::Internal::AnyHash
4027
+ )
4028
+ end
4029
+
4030
+ # The key in the event data to extract the unit rate from.
4031
+ sig { returns(String) }
4032
+ attr_accessor :unit_rating_key
4033
+
4034
+ # If provided, this amount will be used as the unit rate when an event does not
4035
+ # have a value for the `unit_rating_key`. If not provided, events missing a unit
4036
+ # rate will be ignored.
4037
+ sig { returns(T.nilable(String)) }
4038
+ attr_accessor :default_unit_rate
4039
+
4040
+ # An optional key in the event data to group by (e.g., event ID). All events will
4041
+ # also be grouped by their unit rate.
4042
+ sig { returns(T.nilable(String)) }
4043
+ attr_accessor :grouping_key
4044
+
4045
+ # Configuration for event_output pricing
4046
+ sig do
4047
+ params(
4048
+ unit_rating_key: String,
4049
+ default_unit_rate: T.nilable(String),
4050
+ grouping_key: T.nilable(String)
4051
+ ).returns(T.attached_class)
4052
+ end
4053
+ def self.new(
4054
+ # The key in the event data to extract the unit rate from.
4055
+ unit_rating_key:,
4056
+ # If provided, this amount will be used as the unit rate when an event does not
4057
+ # have a value for the `unit_rating_key`. If not provided, events missing a unit
4058
+ # rate will be ignored.
4059
+ default_unit_rate: nil,
4060
+ # An optional key in the event data to group by (e.g., event ID). All events will
4061
+ # also be grouped by their unit rate.
4062
+ grouping_key: nil
4063
+ )
4064
+ end
4065
+
4066
+ sig do
4067
+ override.returns(
4068
+ {
4069
+ unit_rating_key: String,
4070
+ default_unit_rate: T.nilable(String),
4071
+ grouping_key: T.nilable(String)
4072
+ }
4073
+ )
4074
+ end
4075
+ def to_hash
4076
+ end
4077
+ end
4078
+ end
4079
+
4080
+ sig do
4081
+ override.returns(
4082
+ T::Array[
4083
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::Variants
4084
+ ]
4085
+ )
4086
+ end
4087
+ def self.variants
4088
+ end
4089
+ end
4090
+ end
4091
+
4092
+ class AddAdjustment < Orb::Internal::Type::BaseModel
4093
+ OrHash =
4094
+ T.type_alias do
4095
+ T.any(
4096
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment,
4097
+ Orb::Internal::AnyHash
4098
+ )
4099
+ end
4100
+
4101
+ # The start date of the adjustment interval. This is the date that the adjustment
4102
+ # will start affecting prices on the subscription. The adjustment will apply to
4103
+ # invoice dates that overlap with this `start_date`. This `start_date` is treated
4104
+ # as inclusive for in-advance prices, and exclusive for in-arrears prices.
4105
+ sig { returns(T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol)) }
4106
+ attr_accessor :start_date
4107
+
4108
+ # The definition of a new adjustment to create and add to the subscription.
4109
+ sig do
4110
+ returns(
4111
+ T.nilable(
4112
+ T.any(
4113
+ Orb::NewPercentageDiscount,
4114
+ Orb::NewUsageDiscount,
4115
+ Orb::NewAmountDiscount,
4116
+ Orb::NewMinimum,
4117
+ Orb::NewMaximum,
4118
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount
4119
+ )
4120
+ )
4121
+ )
4122
+ end
4123
+ attr_accessor :adjustment
4124
+
4125
+ # The ID of the adjustment to add to the subscription. Adjustment IDs can be
4126
+ # re-used from existing subscriptions or plans, but adjustments associated with
4127
+ # coupon redemptions cannot be re-used.
2695
4128
  sig { returns(T.nilable(String)) }
2696
4129
  attr_accessor :adjustment_id
2697
4130
 
@@ -2716,7 +4149,8 @@ module Orb
2716
4149
  Orb::NewUsageDiscount::OrHash,
2717
4150
  Orb::NewAmountDiscount::OrHash,
2718
4151
  Orb::NewMinimum::OrHash,
2719
- Orb::NewMaximum::OrHash
4152
+ Orb::NewMaximum::OrHash,
4153
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::OrHash
2720
4154
  )
2721
4155
  ),
2722
4156
  adjustment_id: T.nilable(String),
@@ -2755,7 +4189,8 @@ module Orb
2755
4189
  Orb::NewUsageDiscount,
2756
4190
  Orb::NewAmountDiscount,
2757
4191
  Orb::NewMinimum,
2758
- Orb::NewMaximum
4192
+ Orb::NewMaximum,
4193
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount
2759
4194
  )
2760
4195
  ),
2761
4196
  adjustment_id: T.nilable(String),
@@ -2801,10 +4236,444 @@ module Orb
2801
4236
  Orb::NewUsageDiscount,
2802
4237
  Orb::NewAmountDiscount,
2803
4238
  Orb::NewMinimum,
2804
- Orb::NewMaximum
4239
+ Orb::NewMaximum,
4240
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount
4241
+ )
4242
+ end
4243
+
4244
+ class TieredPercentageDiscount < Orb::Internal::Type::BaseModel
4245
+ OrHash =
4246
+ T.type_alias do
4247
+ T.any(
4248
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount,
4249
+ Orb::Internal::AnyHash
4250
+ )
4251
+ end
4252
+
4253
+ sig { returns(Symbol) }
4254
+ attr_accessor :adjustment_type
4255
+
4256
+ sig do
4257
+ returns(
4258
+ T::Array[
4259
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Tier
4260
+ ]
4261
+ )
4262
+ end
4263
+ attr_accessor :tiers
4264
+
4265
+ # If set, the adjustment will apply to every price on the subscription.
4266
+ sig do
4267
+ returns(
4268
+ T.nilable(
4269
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::AppliesToAll::OrBoolean
4270
+ )
4271
+ )
4272
+ end
4273
+ attr_accessor :applies_to_all
4274
+
4275
+ # The set of item IDs to which this adjustment applies.
4276
+ sig { returns(T.nilable(T::Array[String])) }
4277
+ attr_accessor :applies_to_item_ids
4278
+
4279
+ # The set of price IDs to which this adjustment applies.
4280
+ sig { returns(T.nilable(T::Array[String])) }
4281
+ attr_accessor :applies_to_price_ids
4282
+
4283
+ # If set, only prices in the specified currency will have the adjustment applied.
4284
+ sig { returns(T.nilable(String)) }
4285
+ attr_accessor :currency
4286
+
4287
+ # A list of filters that determine which prices this adjustment will apply to.
4288
+ sig do
4289
+ returns(
4290
+ T.nilable(
4291
+ T::Array[
4292
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter
4293
+ ]
4294
+ )
4295
+ )
4296
+ end
4297
+ attr_accessor :filters
4298
+
4299
+ # When false, this adjustment will be applied to a single price. Otherwise, it
4300
+ # will be applied at the invoice level, possibly to multiple prices.
4301
+ sig { returns(T.nilable(T::Boolean)) }
4302
+ attr_reader :is_invoice_level
4303
+
4304
+ sig { params(is_invoice_level: T::Boolean).void }
4305
+ attr_writer :is_invoice_level
4306
+
4307
+ # If set, only prices of the specified type will have the adjustment applied.
4308
+ sig do
4309
+ returns(
4310
+ T.nilable(
4311
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::PriceType::OrSymbol
4312
+ )
4313
+ )
4314
+ end
4315
+ attr_accessor :price_type
4316
+
4317
+ sig do
4318
+ params(
4319
+ tiers:
4320
+ T::Array[
4321
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Tier::OrHash
4322
+ ],
4323
+ applies_to_all:
4324
+ T.nilable(
4325
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::AppliesToAll::OrBoolean
4326
+ ),
4327
+ applies_to_item_ids: T.nilable(T::Array[String]),
4328
+ applies_to_price_ids: T.nilable(T::Array[String]),
4329
+ currency: T.nilable(String),
4330
+ filters:
4331
+ T.nilable(
4332
+ T::Array[
4333
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::OrHash
4334
+ ]
4335
+ ),
4336
+ is_invoice_level: T::Boolean,
4337
+ price_type:
4338
+ T.nilable(
4339
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::PriceType::OrSymbol
4340
+ ),
4341
+ adjustment_type: Symbol
4342
+ ).returns(T.attached_class)
4343
+ end
4344
+ def self.new(
4345
+ tiers:,
4346
+ # If set, the adjustment will apply to every price on the subscription.
4347
+ applies_to_all: nil,
4348
+ # The set of item IDs to which this adjustment applies.
4349
+ applies_to_item_ids: nil,
4350
+ # The set of price IDs to which this adjustment applies.
4351
+ applies_to_price_ids: nil,
4352
+ # If set, only prices in the specified currency will have the adjustment applied.
4353
+ currency: nil,
4354
+ # A list of filters that determine which prices this adjustment will apply to.
4355
+ filters: nil,
4356
+ # When false, this adjustment will be applied to a single price. Otherwise, it
4357
+ # will be applied at the invoice level, possibly to multiple prices.
4358
+ is_invoice_level: nil,
4359
+ # If set, only prices of the specified type will have the adjustment applied.
4360
+ price_type: nil,
4361
+ adjustment_type: :tiered_percentage_discount
4362
+ )
4363
+ end
4364
+
4365
+ sig do
4366
+ override.returns(
4367
+ {
4368
+ adjustment_type: Symbol,
4369
+ tiers:
4370
+ T::Array[
4371
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Tier
4372
+ ],
4373
+ applies_to_all:
4374
+ T.nilable(
4375
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::AppliesToAll::OrBoolean
4376
+ ),
4377
+ applies_to_item_ids: T.nilable(T::Array[String]),
4378
+ applies_to_price_ids: T.nilable(T::Array[String]),
4379
+ currency: T.nilable(String),
4380
+ filters:
4381
+ T.nilable(
4382
+ T::Array[
4383
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter
4384
+ ]
4385
+ ),
4386
+ is_invoice_level: T::Boolean,
4387
+ price_type:
4388
+ T.nilable(
4389
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::PriceType::OrSymbol
4390
+ )
4391
+ }
4392
+ )
4393
+ end
4394
+ def to_hash
4395
+ end
4396
+
4397
+ class Tier < Orb::Internal::Type::BaseModel
4398
+ OrHash =
4399
+ T.type_alias do
4400
+ T.any(
4401
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Tier,
4402
+ Orb::Internal::AnyHash
4403
+ )
4404
+ end
4405
+
4406
+ # Exclusive lower bound of cumulative spend for this tier.
4407
+ sig { returns(Float) }
4408
+ attr_accessor :lower_bound
4409
+
4410
+ # The percentage (0-1) discounted from spend in this tier.
4411
+ sig { returns(Float) }
4412
+ attr_accessor :percentage
4413
+
4414
+ # Inclusive upper bound of cumulative spend; null for the final open-ended tier.
4415
+ sig { returns(T.nilable(Float)) }
4416
+ attr_accessor :upper_bound
4417
+
4418
+ sig do
4419
+ params(
4420
+ lower_bound: Float,
4421
+ percentage: Float,
4422
+ upper_bound: T.nilable(Float)
4423
+ ).returns(T.attached_class)
4424
+ end
4425
+ def self.new(
4426
+ # Exclusive lower bound of cumulative spend for this tier.
4427
+ lower_bound:,
4428
+ # The percentage (0-1) discounted from spend in this tier.
4429
+ percentage:,
4430
+ # Inclusive upper bound of cumulative spend; null for the final open-ended tier.
4431
+ upper_bound: nil
4432
+ )
4433
+ end
4434
+
4435
+ sig do
4436
+ override.returns(
4437
+ {
4438
+ lower_bound: Float,
4439
+ percentage: Float,
4440
+ upper_bound: T.nilable(Float)
4441
+ }
4442
+ )
4443
+ end
4444
+ def to_hash
4445
+ end
4446
+ end
4447
+
4448
+ # If set, the adjustment will apply to every price on the subscription.
4449
+ module AppliesToAll
4450
+ extend Orb::Internal::Type::Enum
4451
+
4452
+ TaggedBoolean =
4453
+ T.type_alias do
4454
+ T.all(
4455
+ T::Boolean,
4456
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::AppliesToAll
4457
+ )
4458
+ end
4459
+ OrBoolean = T.type_alias { T::Boolean }
4460
+
4461
+ TRUE =
4462
+ T.let(
4463
+ true,
4464
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::AppliesToAll::TaggedBoolean
4465
+ )
4466
+
4467
+ sig do
4468
+ override.returns(
4469
+ T::Array[
4470
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::AppliesToAll::TaggedBoolean
4471
+ ]
4472
+ )
4473
+ end
4474
+ def self.values
4475
+ end
4476
+ end
4477
+
4478
+ class Filter < Orb::Internal::Type::BaseModel
4479
+ OrHash =
4480
+ T.type_alias do
4481
+ T.any(
4482
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter,
4483
+ Orb::Internal::AnyHash
4484
+ )
4485
+ end
4486
+
4487
+ # The property of the price to filter on.
4488
+ sig do
4489
+ returns(
4490
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Field::OrSymbol
4491
+ )
4492
+ end
4493
+ attr_accessor :field
4494
+
4495
+ # Should prices that match the filter be included or excluded.
4496
+ sig do
4497
+ returns(
4498
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Operator::OrSymbol
4499
+ )
4500
+ end
4501
+ attr_accessor :operator
4502
+
4503
+ # The IDs or values that match this filter.
4504
+ sig { returns(T::Array[String]) }
4505
+ attr_accessor :values
4506
+
4507
+ sig do
4508
+ params(
4509
+ field:
4510
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Field::OrSymbol,
4511
+ operator:
4512
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Operator::OrSymbol,
4513
+ values: T::Array[String]
4514
+ ).returns(T.attached_class)
4515
+ end
4516
+ def self.new(
4517
+ # The property of the price to filter on.
4518
+ field:,
4519
+ # Should prices that match the filter be included or excluded.
4520
+ operator:,
4521
+ # The IDs or values that match this filter.
4522
+ values:
2805
4523
  )
4524
+ end
4525
+
4526
+ sig do
4527
+ override.returns(
4528
+ {
4529
+ field:
4530
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Field::OrSymbol,
4531
+ operator:
4532
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Operator::OrSymbol,
4533
+ values: T::Array[String]
4534
+ }
4535
+ )
4536
+ end
4537
+ def to_hash
4538
+ end
4539
+
4540
+ # The property of the price to filter on.
4541
+ module Field
4542
+ extend Orb::Internal::Type::Enum
4543
+
4544
+ TaggedSymbol =
4545
+ T.type_alias do
4546
+ T.all(
4547
+ Symbol,
4548
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Field
4549
+ )
4550
+ end
4551
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4552
+
4553
+ PRICE_ID =
4554
+ T.let(
4555
+ :price_id,
4556
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
4557
+ )
4558
+ ITEM_ID =
4559
+ T.let(
4560
+ :item_id,
4561
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
4562
+ )
4563
+ PRICE_TYPE =
4564
+ T.let(
4565
+ :price_type,
4566
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
4567
+ )
4568
+ CURRENCY =
4569
+ T.let(
4570
+ :currency,
4571
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
4572
+ )
4573
+ PRICING_UNIT_ID =
4574
+ T.let(
4575
+ :pricing_unit_id,
4576
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
4577
+ )
4578
+
4579
+ sig do
4580
+ override.returns(
4581
+ T::Array[
4582
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
4583
+ ]
4584
+ )
4585
+ end
4586
+ def self.values
4587
+ end
4588
+ end
4589
+
4590
+ # Should prices that match the filter be included or excluded.
4591
+ module Operator
4592
+ extend Orb::Internal::Type::Enum
4593
+
4594
+ TaggedSymbol =
4595
+ T.type_alias do
4596
+ T.all(
4597
+ Symbol,
4598
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Operator
4599
+ )
4600
+ end
4601
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4602
+
4603
+ INCLUDES =
4604
+ T.let(
4605
+ :includes,
4606
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Operator::TaggedSymbol
4607
+ )
4608
+ EXCLUDES =
4609
+ T.let(
4610
+ :excludes,
4611
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Operator::TaggedSymbol
4612
+ )
4613
+
4614
+ sig do
4615
+ override.returns(
4616
+ T::Array[
4617
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::Filter::Operator::TaggedSymbol
4618
+ ]
4619
+ )
4620
+ end
4621
+ def self.values
4622
+ end
4623
+ end
2806
4624
  end
2807
4625
 
4626
+ # If set, only prices of the specified type will have the adjustment applied.
4627
+ module PriceType
4628
+ extend Orb::Internal::Type::Enum
4629
+
4630
+ TaggedSymbol =
4631
+ T.type_alias do
4632
+ T.all(
4633
+ Symbol,
4634
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::PriceType
4635
+ )
4636
+ end
4637
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4638
+
4639
+ USAGE =
4640
+ T.let(
4641
+ :usage,
4642
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::PriceType::TaggedSymbol
4643
+ )
4644
+ FIXED_IN_ADVANCE =
4645
+ T.let(
4646
+ :fixed_in_advance,
4647
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::PriceType::TaggedSymbol
4648
+ )
4649
+ FIXED_IN_ARREARS =
4650
+ T.let(
4651
+ :fixed_in_arrears,
4652
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::PriceType::TaggedSymbol
4653
+ )
4654
+ FIXED =
4655
+ T.let(
4656
+ :fixed,
4657
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::PriceType::TaggedSymbol
4658
+ )
4659
+ IN_ARREARS =
4660
+ T.let(
4661
+ :in_arrears,
4662
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::PriceType::TaggedSymbol
4663
+ )
4664
+
4665
+ sig do
4666
+ override.returns(
4667
+ T::Array[
4668
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::PriceType::TaggedSymbol
4669
+ ]
4670
+ )
4671
+ end
4672
+ def self.values
4673
+ end
4674
+ end
4675
+ end
4676
+
2808
4677
  sig do
2809
4678
  override.returns(
2810
4679
  T::Array[