orb-billing 1.14.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 (347) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/lib/orb/client.rb +14 -0
  4. data/lib/orb/internal/transport/base_client.rb +5 -0
  5. data/lib/orb/internal/type/union.rb +13 -27
  6. data/lib/orb/models/accounting_provider_config.rb +14 -3
  7. data/lib/orb/models/adjustment_interval.rb +185 -3
  8. data/lib/orb/models/alert.rb +105 -1
  9. data/lib/orb/models/alert_create_for_subscription_params.rb +120 -7
  10. data/lib/orb/models/alert_update_params.rb +113 -1
  11. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +2419 -17109
  12. data/lib/orb/models/beta_create_plan_version_params.rb +2361 -16947
  13. data/lib/orb/models/changed_subscription_resources.rb +200 -10
  14. data/lib/orb/models/conversion_rate_config.rb +18 -0
  15. data/lib/orb/models/credit_block_list_invoices_response.rb +155 -1
  16. data/lib/orb/models/credit_block_retrieve_response.rb +150 -1
  17. data/lib/orb/models/customer.rb +111 -4
  18. data/lib/orb/models/customer_create_params.rb +6 -1
  19. data/lib/orb/models/customer_tax_id.rb +15 -1
  20. data/lib/orb/models/customer_update_by_external_id_params.rb +16 -2
  21. data/lib/orb/models/customer_update_params.rb +16 -2
  22. data/lib/orb/models/customers/credit_list_by_external_id_response.rb +155 -1
  23. data/lib/orb/models/customers/credit_list_response.rb +152 -1
  24. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +4 -4
  25. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +4 -4
  26. data/lib/orb/models/dimensional_price_group.rb +1 -1
  27. data/lib/orb/models/discount.rb +145 -1
  28. data/lib/orb/models/event_ingest_params.rb +5 -2
  29. data/lib/orb/models/invoice.rb +198 -10
  30. data/lib/orb/models/invoice_create_params.rb +6 -5
  31. data/lib/orb/models/invoice_fetch_upcoming_response.rb +200 -10
  32. data/lib/orb/models/invoice_issue_summary_response.rb +9 -3
  33. data/lib/orb/models/invoice_level_discount.rb +145 -1
  34. data/lib/orb/models/invoice_line_item_create_response.rb +189 -5
  35. data/lib/orb/models/invoice_list_summary_response.rb +9 -3
  36. data/lib/orb/models/licenses/external_license_get_usage_params.rb +3 -3
  37. data/lib/orb/models/licenses/usage_get_all_usage_params.rb +3 -3
  38. data/lib/orb/models/licenses/usage_get_usage_params.rb +3 -3
  39. data/lib/orb/models/mutated_subscription.rb +169 -4
  40. data/lib/orb/models/new_allocation_price.rb +11 -1
  41. data/lib/orb/models/new_floating_bulk_price.rb +1 -3
  42. data/lib/orb/models/new_floating_bulk_with_proration_price.rb +1 -3
  43. data/lib/orb/models/new_floating_cumulative_grouped_bulk_price.rb +1 -3
  44. data/lib/orb/models/new_floating_grouped_allocation_price.rb +1 -3
  45. data/lib/orb/models/new_floating_grouped_tiered_package_price.rb +1 -3
  46. data/lib/orb/models/new_floating_grouped_tiered_price.rb +1 -3
  47. data/lib/orb/models/new_floating_grouped_with_metered_minimum_price.rb +1 -3
  48. data/lib/orb/models/new_floating_grouped_with_prorated_minimum_price.rb +1 -3
  49. data/lib/orb/models/new_floating_matrix_price.rb +1 -3
  50. data/lib/orb/models/new_floating_matrix_with_allocation_price.rb +1 -3
  51. data/lib/orb/models/new_floating_matrix_with_display_name_price.rb +1 -3
  52. data/lib/orb/models/new_floating_max_group_tiered_package_price.rb +1 -3
  53. data/lib/orb/models/new_floating_minimum_composite_price.rb +1 -3
  54. data/lib/orb/models/new_floating_package_price.rb +1 -3
  55. data/lib/orb/models/new_floating_package_with_allocation_price.rb +1 -3
  56. data/lib/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rb +1 -3
  57. data/lib/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rb +1 -3
  58. data/lib/orb/models/new_floating_threshold_total_amount_price.rb +1 -3
  59. data/lib/orb/models/new_floating_tiered_package_price.rb +1 -3
  60. data/lib/orb/models/new_floating_tiered_package_with_minimum_price.rb +1 -3
  61. data/lib/orb/models/new_floating_tiered_price.rb +1 -3
  62. data/lib/orb/models/new_floating_tiered_with_minimum_price.rb +1 -3
  63. data/lib/orb/models/new_floating_tiered_with_proration_price.rb +1 -3
  64. data/lib/orb/models/new_floating_unit_price.rb +1 -3
  65. data/lib/orb/models/new_floating_unit_with_percent_price.rb +1 -3
  66. data/lib/orb/models/new_floating_unit_with_proration_price.rb +1 -3
  67. data/lib/orb/models/new_plan_bulk_price.rb +1 -1
  68. data/lib/orb/models/new_plan_bulk_with_proration_price.rb +1 -3
  69. data/lib/orb/models/new_plan_cumulative_grouped_bulk_price.rb +1 -3
  70. data/lib/orb/models/new_plan_grouped_allocation_price.rb +1 -3
  71. data/lib/orb/models/new_plan_grouped_tiered_package_price.rb +1 -3
  72. data/lib/orb/models/new_plan_grouped_tiered_price.rb +1 -3
  73. data/lib/orb/models/new_plan_grouped_with_metered_minimum_price.rb +1 -3
  74. data/lib/orb/models/new_plan_grouped_with_prorated_minimum_price.rb +1 -3
  75. data/lib/orb/models/new_plan_matrix_price.rb +1 -5
  76. data/lib/orb/models/new_plan_matrix_with_allocation_price.rb +1 -3
  77. data/lib/orb/models/new_plan_matrix_with_display_name_price.rb +1 -3
  78. data/lib/orb/models/new_plan_max_group_tiered_package_price.rb +1 -3
  79. data/lib/orb/models/new_plan_minimum_composite_price.rb +1 -3
  80. data/lib/orb/models/new_plan_package_price.rb +1 -5
  81. data/lib/orb/models/new_plan_package_with_allocation_price.rb +1 -3
  82. data/lib/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rb +1 -3
  83. data/lib/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rb +1 -3
  84. data/lib/orb/models/new_plan_threshold_total_amount_price.rb +1 -3
  85. data/lib/orb/models/new_plan_tiered_package_price.rb +1 -3
  86. data/lib/orb/models/new_plan_tiered_package_with_minimum_price.rb +1 -3
  87. data/lib/orb/models/new_plan_tiered_price.rb +1 -5
  88. data/lib/orb/models/new_plan_tiered_with_minimum_price.rb +1 -3
  89. data/lib/orb/models/new_plan_unit_price.rb +1 -1
  90. data/lib/orb/models/new_plan_unit_with_percent_price.rb +1 -3
  91. data/lib/orb/models/new_plan_unit_with_proration_price.rb +1 -3
  92. data/lib/orb/models/new_subscription_bulk_price.rb +1 -3
  93. data/lib/orb/models/new_subscription_bulk_with_proration_price.rb +1 -3
  94. data/lib/orb/models/new_subscription_cumulative_grouped_bulk_price.rb +1 -3
  95. data/lib/orb/models/new_subscription_grouped_allocation_price.rb +1 -3
  96. data/lib/orb/models/new_subscription_grouped_tiered_package_price.rb +1 -3
  97. data/lib/orb/models/new_subscription_grouped_tiered_price.rb +1 -3
  98. data/lib/orb/models/new_subscription_grouped_with_metered_minimum_price.rb +1 -3
  99. data/lib/orb/models/new_subscription_grouped_with_prorated_minimum_price.rb +1 -3
  100. data/lib/orb/models/new_subscription_matrix_price.rb +1 -3
  101. data/lib/orb/models/new_subscription_matrix_with_allocation_price.rb +1 -3
  102. data/lib/orb/models/new_subscription_matrix_with_display_name_price.rb +1 -3
  103. data/lib/orb/models/new_subscription_max_group_tiered_package_price.rb +1 -3
  104. data/lib/orb/models/new_subscription_minimum_composite_price.rb +1 -3
  105. data/lib/orb/models/new_subscription_package_price.rb +1 -3
  106. data/lib/orb/models/new_subscription_package_with_allocation_price.rb +1 -3
  107. data/lib/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rb +1 -3
  108. data/lib/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb +1 -3
  109. data/lib/orb/models/new_subscription_threshold_total_amount_price.rb +1 -3
  110. data/lib/orb/models/new_subscription_tiered_package_price.rb +1 -3
  111. data/lib/orb/models/new_subscription_tiered_package_with_minimum_price.rb +1 -3
  112. data/lib/orb/models/new_subscription_tiered_price.rb +1 -3
  113. data/lib/orb/models/new_subscription_tiered_with_minimum_price.rb +1 -3
  114. data/lib/orb/models/new_subscription_unit_price.rb +1 -3
  115. data/lib/orb/models/new_subscription_unit_with_percent_price.rb +1 -3
  116. data/lib/orb/models/new_subscription_unit_with_proration_price.rb +1 -3
  117. data/lib/orb/models/per_price_cost.rb +2 -2
  118. data/lib/orb/models/plan.rb +189 -9
  119. data/lib/orb/models/plan_create_params.rb +1047 -8228
  120. data/lib/orb/models/plan_update_params.rb +9 -1
  121. data/lib/orb/models/plan_version.rb +186 -5
  122. data/lib/orb/models/plans/external_plan_id_update_params.rb +9 -1
  123. data/lib/orb/models/plans/migration_cancel_response.rb +22 -4
  124. data/lib/orb/models/plans/migration_list_response.rb +22 -4
  125. data/lib/orb/models/plans/migration_retrieve_response.rb +22 -4
  126. data/lib/orb/models/price.rb +2614 -1268
  127. data/lib/orb/models/price_create_params.rb +866 -49
  128. data/lib/orb/models/price_evaluate_multiple_params.rb +889 -54
  129. data/lib/orb/models/price_evaluate_preview_events_params.rb +881 -46
  130. data/lib/orb/models/price_interval.rb +2 -2
  131. data/lib/orb/models/subscription.rb +168 -4
  132. data/lib/orb/models/subscription_create_params.rb +2818 -674
  133. data/lib/orb/models/subscription_price_intervals_params.rb +1098 -57
  134. data/lib/orb/models/subscription_schedule_plan_change_params.rb +2834 -687
  135. data/lib/orb/models/subscription_update_params.rb +12 -1
  136. data/lib/orb/models.rb +2 -0
  137. data/lib/orb/resources/alerts.rb +14 -3
  138. data/lib/orb/resources/customers/credits/ledger.rb +28 -14
  139. data/lib/orb/resources/customers.rb +6 -2
  140. data/lib/orb/resources/events.rb +7 -34
  141. data/lib/orb/resources/invoices.rb +6 -2
  142. data/lib/orb/resources/licenses/external_licenses.rb +1 -1
  143. data/lib/orb/resources/licenses/usage.rb +2 -2
  144. data/lib/orb/resources/metrics.rb +5 -5
  145. data/lib/orb/resources/plans/external_plan_id.rb +5 -3
  146. data/lib/orb/resources/plans.rb +9 -5
  147. data/lib/orb/resources/prices/external_price_id.rb +2 -2
  148. data/lib/orb/resources/prices.rb +5 -5
  149. data/lib/orb/resources/subscriptions.rb +20 -3
  150. data/lib/orb/version.rb +1 -1
  151. data/lib/orb.rb +1 -0
  152. data/rbi/orb/models/accounting_provider_config.rbi +38 -5
  153. data/rbi/orb/models/adjustment_interval.rbi +336 -0
  154. data/rbi/orb/models/alert.rbi +172 -3
  155. data/rbi/orb/models/alert_create_for_subscription_params.rbi +268 -9
  156. data/rbi/orb/models/alert_update_params.rbi +208 -0
  157. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +3833 -28395
  158. data/rbi/orb/models/beta_create_plan_version_params.rbi +3833 -28363
  159. data/rbi/orb/models/changed_subscription_resources.rbi +360 -5
  160. data/rbi/orb/models/conversion_rate_config.rbi +18 -0
  161. data/rbi/orb/models/credit_block_list_invoices_response.rbi +346 -3
  162. data/rbi/orb/models/credit_block_retrieve_response.rbi +344 -3
  163. data/rbi/orb/models/customer.rbi +190 -10
  164. data/rbi/orb/models/customer_create_params.rbi +12 -2
  165. data/rbi/orb/models/customer_tax_id.rbi +15 -1
  166. data/rbi/orb/models/customer_update_by_external_id_params.rbi +22 -2
  167. data/rbi/orb/models/customer_update_params.rbi +22 -2
  168. data/rbi/orb/models/customers/credit_list_by_external_id_response.rbi +346 -3
  169. data/rbi/orb/models/customers/credit_list_response.rbi +347 -3
  170. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +6 -6
  171. data/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi +6 -6
  172. data/rbi/orb/models/dimensional_price_group.rbi +1 -1
  173. data/rbi/orb/models/discount.rbi +269 -1
  174. data/rbi/orb/models/event_ingest_params.rbi +4 -2
  175. data/rbi/orb/models/invoice.rbi +360 -5
  176. data/rbi/orb/models/invoice_create_params.rbi +12 -7
  177. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +360 -5
  178. data/rbi/orb/models/invoice_issue_summary_response.rbi +19 -4
  179. data/rbi/orb/models/invoice_level_discount.rbi +298 -1
  180. data/rbi/orb/models/invoice_line_item_create_response.rbi +339 -0
  181. data/rbi/orb/models/invoice_list_summary_response.rbi +19 -4
  182. data/rbi/orb/models/licenses/external_license_get_usage_params.rbi +3 -3
  183. data/rbi/orb/models/licenses/usage_get_all_usage_params.rbi +3 -3
  184. data/rbi/orb/models/licenses/usage_get_usage_params.rbi +3 -3
  185. data/rbi/orb/models/mutated_subscription.rbi +324 -2
  186. data/rbi/orb/models/new_allocation_price.rbi +12 -0
  187. data/rbi/orb/models/per_price_cost.rbi +3 -0
  188. data/rbi/orb/models/plan.rbi +339 -2
  189. data/rbi/orb/models/plan_create_params.rbi +1877 -14138
  190. data/rbi/orb/models/plan_update_params.rbi +8 -0
  191. data/rbi/orb/models/plan_version.rbi +339 -0
  192. data/rbi/orb/models/plans/external_plan_id_update_params.rbi +8 -0
  193. data/rbi/orb/models/plans/migration_cancel_response.rbi +22 -1
  194. data/rbi/orb/models/plans/migration_list_response.rbi +22 -1
  195. data/rbi/orb/models/plans/migration_retrieve_response.rbi +22 -1
  196. data/rbi/orb/models/price.rbi +4552 -2285
  197. data/rbi/orb/models/price_create_params.rbi +1540 -114
  198. data/rbi/orb/models/price_evaluate_multiple_params.rbi +1540 -114
  199. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +1540 -114
  200. data/rbi/orb/models/price_interval.rbi +3 -0
  201. data/rbi/orb/models/subscription.rbi +324 -2
  202. data/rbi/orb/models/subscription_create_params.rbi +4998 -1186
  203. data/rbi/orb/models/subscription_price_intervals_params.rbi +2127 -264
  204. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +4997 -1185
  205. data/rbi/orb/models/subscription_update_params.rbi +14 -0
  206. data/rbi/orb/models.rbi +2 -0
  207. data/rbi/orb/resources/alerts.rbi +39 -4
  208. data/rbi/orb/resources/customers/credits/ledger.rbi +28 -14
  209. data/rbi/orb/resources/customers.rbi +23 -0
  210. data/rbi/orb/resources/events.rbi +8 -35
  211. data/rbi/orb/resources/invoices.rbi +9 -3
  212. data/rbi/orb/resources/licenses/external_licenses.rbi +1 -1
  213. data/rbi/orb/resources/licenses/usage.rbi +2 -2
  214. data/rbi/orb/resources/metrics.rbi +5 -5
  215. data/rbi/orb/resources/plans/external_plan_id.rbi +5 -2
  216. data/rbi/orb/resources/plans.rbi +9 -3
  217. data/rbi/orb/resources/prices.rbi +3 -0
  218. data/rbi/orb/resources/subscriptions.rbi +29 -0
  219. data/sig/orb/models/accounting_provider_config.rbs +21 -4
  220. data/sig/orb/models/adjustment_interval.rbs +134 -0
  221. data/sig/orb/models/alert.rbs +85 -3
  222. data/sig/orb/models/alert_create_for_subscription_params.rbs +86 -4
  223. data/sig/orb/models/alert_update_params.rbs +86 -1
  224. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +1803 -11601
  225. data/sig/orb/models/beta_create_plan_version_params.rbs +1747 -11541
  226. data/sig/orb/models/changed_subscription_resources.rbs +140 -1
  227. data/sig/orb/models/conversion_rate_config.rbs +12 -0
  228. data/sig/orb/models/credit_block_list_invoices_response.rbs +124 -3
  229. data/sig/orb/models/credit_block_retrieve_response.rbs +124 -3
  230. data/sig/orb/models/customer.rbs +70 -4
  231. data/sig/orb/models/customer_create_params.rbs +2 -2
  232. data/sig/orb/models/customer_tax_id.rbs +20 -2
  233. data/sig/orb/models/customer_update_by_external_id_params.rbs +7 -2
  234. data/sig/orb/models/customer_update_params.rbs +7 -2
  235. data/sig/orb/models/customers/credit_list_by_external_id_response.rbs +124 -3
  236. data/sig/orb/models/customers/credit_list_response.rbs +124 -3
  237. data/sig/orb/models/discount.rbs +114 -0
  238. data/sig/orb/models/invoice.rbs +140 -1
  239. data/sig/orb/models/invoice_fetch_upcoming_response.rbs +140 -1
  240. data/sig/orb/models/invoice_issue_summary_response.rbs +2 -1
  241. data/sig/orb/models/invoice_level_discount.rbs +117 -1
  242. data/sig/orb/models/invoice_line_item_create_response.rbs +134 -0
  243. data/sig/orb/models/invoice_list_summary_response.rbs +2 -1
  244. data/sig/orb/models/licenses/external_license_get_usage_params.rbs +4 -4
  245. data/sig/orb/models/licenses/usage_get_all_usage_params.rbs +4 -4
  246. data/sig/orb/models/licenses/usage_get_usage_params.rbs +4 -4
  247. data/sig/orb/models/mutated_subscription.rbs +124 -0
  248. data/sig/orb/models/new_allocation_price.rbs +5 -0
  249. data/sig/orb/models/new_floating_bulk_price.rbs +4 -4
  250. data/sig/orb/models/new_floating_bulk_with_proration_price.rbs +4 -4
  251. data/sig/orb/models/new_floating_cumulative_grouped_bulk_price.rbs +4 -4
  252. data/sig/orb/models/new_floating_grouped_allocation_price.rbs +4 -4
  253. data/sig/orb/models/new_floating_grouped_tiered_package_price.rbs +4 -4
  254. data/sig/orb/models/new_floating_grouped_tiered_price.rbs +4 -4
  255. data/sig/orb/models/new_floating_grouped_with_metered_minimum_price.rbs +4 -4
  256. data/sig/orb/models/new_floating_grouped_with_prorated_minimum_price.rbs +4 -4
  257. data/sig/orb/models/new_floating_matrix_price.rbs +4 -4
  258. data/sig/orb/models/new_floating_matrix_with_allocation_price.rbs +4 -4
  259. data/sig/orb/models/new_floating_matrix_with_display_name_price.rbs +4 -4
  260. data/sig/orb/models/new_floating_max_group_tiered_package_price.rbs +4 -4
  261. data/sig/orb/models/new_floating_minimum_composite_price.rbs +4 -4
  262. data/sig/orb/models/new_floating_package_price.rbs +4 -4
  263. data/sig/orb/models/new_floating_package_with_allocation_price.rbs +4 -4
  264. data/sig/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rbs +4 -4
  265. data/sig/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbs +4 -4
  266. data/sig/orb/models/new_floating_threshold_total_amount_price.rbs +4 -4
  267. data/sig/orb/models/new_floating_tiered_package_price.rbs +4 -4
  268. data/sig/orb/models/new_floating_tiered_package_with_minimum_price.rbs +4 -4
  269. data/sig/orb/models/new_floating_tiered_price.rbs +4 -4
  270. data/sig/orb/models/new_floating_tiered_with_minimum_price.rbs +4 -4
  271. data/sig/orb/models/new_floating_tiered_with_proration_price.rbs +4 -4
  272. data/sig/orb/models/new_floating_unit_price.rbs +4 -4
  273. data/sig/orb/models/new_floating_unit_with_percent_price.rbs +4 -4
  274. data/sig/orb/models/new_floating_unit_with_proration_price.rbs +4 -4
  275. data/sig/orb/models/new_plan_bulk_price.rbs +4 -4
  276. data/sig/orb/models/new_plan_bulk_with_proration_price.rbs +4 -4
  277. data/sig/orb/models/new_plan_cumulative_grouped_bulk_price.rbs +4 -4
  278. data/sig/orb/models/new_plan_grouped_allocation_price.rbs +4 -4
  279. data/sig/orb/models/new_plan_grouped_tiered_package_price.rbs +4 -4
  280. data/sig/orb/models/new_plan_grouped_tiered_price.rbs +4 -4
  281. data/sig/orb/models/new_plan_grouped_with_metered_minimum_price.rbs +4 -4
  282. data/sig/orb/models/new_plan_grouped_with_prorated_minimum_price.rbs +4 -4
  283. data/sig/orb/models/new_plan_matrix_price.rbs +4 -4
  284. data/sig/orb/models/new_plan_matrix_with_allocation_price.rbs +4 -4
  285. data/sig/orb/models/new_plan_matrix_with_display_name_price.rbs +4 -4
  286. data/sig/orb/models/new_plan_max_group_tiered_package_price.rbs +4 -4
  287. data/sig/orb/models/new_plan_minimum_composite_price.rbs +4 -4
  288. data/sig/orb/models/new_plan_package_price.rbs +4 -4
  289. data/sig/orb/models/new_plan_package_with_allocation_price.rbs +4 -4
  290. data/sig/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rbs +4 -4
  291. data/sig/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbs +4 -4
  292. data/sig/orb/models/new_plan_threshold_total_amount_price.rbs +4 -4
  293. data/sig/orb/models/new_plan_tiered_package_price.rbs +4 -4
  294. data/sig/orb/models/new_plan_tiered_package_with_minimum_price.rbs +4 -4
  295. data/sig/orb/models/new_plan_tiered_price.rbs +4 -4
  296. data/sig/orb/models/new_plan_tiered_with_minimum_price.rbs +4 -4
  297. data/sig/orb/models/new_plan_unit_price.rbs +4 -4
  298. data/sig/orb/models/new_plan_unit_with_percent_price.rbs +4 -4
  299. data/sig/orb/models/new_plan_unit_with_proration_price.rbs +4 -4
  300. data/sig/orb/models/new_subscription_bulk_price.rbs +4 -4
  301. data/sig/orb/models/new_subscription_bulk_with_proration_price.rbs +4 -4
  302. data/sig/orb/models/new_subscription_cumulative_grouped_bulk_price.rbs +4 -4
  303. data/sig/orb/models/new_subscription_grouped_allocation_price.rbs +4 -4
  304. data/sig/orb/models/new_subscription_grouped_tiered_package_price.rbs +4 -4
  305. data/sig/orb/models/new_subscription_grouped_tiered_price.rbs +4 -4
  306. data/sig/orb/models/new_subscription_grouped_with_metered_minimum_price.rbs +4 -4
  307. data/sig/orb/models/new_subscription_grouped_with_prorated_minimum_price.rbs +4 -4
  308. data/sig/orb/models/new_subscription_matrix_price.rbs +4 -4
  309. data/sig/orb/models/new_subscription_matrix_with_allocation_price.rbs +4 -4
  310. data/sig/orb/models/new_subscription_matrix_with_display_name_price.rbs +4 -4
  311. data/sig/orb/models/new_subscription_max_group_tiered_package_price.rbs +4 -4
  312. data/sig/orb/models/new_subscription_minimum_composite_price.rbs +4 -4
  313. data/sig/orb/models/new_subscription_package_price.rbs +4 -4
  314. data/sig/orb/models/new_subscription_package_with_allocation_price.rbs +4 -4
  315. data/sig/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rbs +4 -4
  316. data/sig/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbs +4 -4
  317. data/sig/orb/models/new_subscription_threshold_total_amount_price.rbs +4 -4
  318. data/sig/orb/models/new_subscription_tiered_package_price.rbs +4 -4
  319. data/sig/orb/models/new_subscription_tiered_package_with_minimum_price.rbs +4 -4
  320. data/sig/orb/models/new_subscription_tiered_price.rbs +4 -4
  321. data/sig/orb/models/new_subscription_tiered_with_minimum_price.rbs +4 -4
  322. data/sig/orb/models/new_subscription_unit_price.rbs +4 -4
  323. data/sig/orb/models/new_subscription_unit_with_percent_price.rbs +4 -4
  324. data/sig/orb/models/new_subscription_unit_with_proration_price.rbs +4 -4
  325. data/sig/orb/models/plan.rbs +134 -0
  326. data/sig/orb/models/plan_create_params.rbs +836 -5728
  327. data/sig/orb/models/plan_update_params.rbs +5 -0
  328. data/sig/orb/models/plan_version.rbs +134 -0
  329. data/sig/orb/models/plans/external_plan_id_update_params.rbs +5 -0
  330. data/sig/orb/models/price.rbs +2200 -1150
  331. data/sig/orb/models/price_create_params.rbs +611 -23
  332. data/sig/orb/models/price_evaluate_multiple_params.rbs +626 -23
  333. data/sig/orb/models/price_evaluate_preview_events_params.rbs +626 -23
  334. data/sig/orb/models/subscription.rbs +124 -0
  335. data/sig/orb/models/subscription_create_params.rbs +2009 -430
  336. data/sig/orb/models/subscription_price_intervals_params.rbs +795 -23
  337. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +2009 -430
  338. data/sig/orb/models/subscription_update_params.rbs +5 -0
  339. data/sig/orb/models.rbs +2 -0
  340. data/sig/orb/resources/alerts.rbs +5 -1
  341. data/sig/orb/resources/customers.rbs +2 -0
  342. data/sig/orb/resources/licenses/external_licenses.rbs +1 -1
  343. data/sig/orb/resources/licenses/usage.rbs +2 -2
  344. data/sig/orb/resources/plans/external_plan_id.rbs +1 -0
  345. data/sig/orb/resources/plans.rbs +2 -0
  346. data/sig/orb/resources/subscriptions.rbs +3 -0
  347. metadata +6 -7
@@ -264,6 +264,7 @@ module Orb
264
264
  Orb::NewFloatingPackageWithAllocationPrice,
265
265
  Orb::NewFloatingUnitWithPercentPrice,
266
266
  Orb::NewFloatingMatrixWithAllocationPrice,
267
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts,
267
268
  Orb::NewFloatingTieredWithProrationPrice,
268
269
  Orb::NewFloatingUnitWithProrationPrice,
269
270
  Orb::NewFloatingGroupedAllocationPrice,
@@ -278,6 +279,8 @@ module Orb
278
279
  Orb::NewFloatingScalableMatrixWithTieredPricingPrice,
279
280
  Orb::NewFloatingCumulativeGroupedBulkPrice,
280
281
  Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation,
282
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance,
283
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance,
281
284
  Orb::NewFloatingMinimumCompositePrice,
282
285
  Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent,
283
286
  Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput
@@ -345,6 +348,7 @@ module Orb
345
348
  Orb::NewFloatingPackageWithAllocationPrice::OrHash,
346
349
  Orb::NewFloatingUnitWithPercentPrice::OrHash,
347
350
  Orb::NewFloatingMatrixWithAllocationPrice::OrHash,
351
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::OrHash,
348
352
  Orb::NewFloatingTieredWithProrationPrice::OrHash,
349
353
  Orb::NewFloatingUnitWithProrationPrice::OrHash,
350
354
  Orb::NewFloatingGroupedAllocationPrice::OrHash,
@@ -359,6 +363,8 @@ module Orb
359
363
  Orb::NewFloatingScalableMatrixWithTieredPricingPrice::OrHash,
360
364
  Orb::NewFloatingCumulativeGroupedBulkPrice::OrHash,
361
365
  Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::OrHash,
366
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::OrHash,
367
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::OrHash,
362
368
  Orb::NewFloatingMinimumCompositePrice::OrHash,
363
369
  Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::OrHash,
364
370
  Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::OrHash
@@ -462,6 +468,7 @@ module Orb
462
468
  Orb::NewFloatingPackageWithAllocationPrice,
463
469
  Orb::NewFloatingUnitWithPercentPrice,
464
470
  Orb::NewFloatingMatrixWithAllocationPrice,
471
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts,
465
472
  Orb::NewFloatingTieredWithProrationPrice,
466
473
  Orb::NewFloatingUnitWithProrationPrice,
467
474
  Orb::NewFloatingGroupedAllocationPrice,
@@ -476,6 +483,8 @@ module Orb
476
483
  Orb::NewFloatingScalableMatrixWithTieredPricingPrice,
477
484
  Orb::NewFloatingCumulativeGroupedBulkPrice,
478
485
  Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation,
486
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance,
487
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance,
479
488
  Orb::NewFloatingMinimumCompositePrice,
480
489
  Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent,
481
490
  Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput
@@ -723,6 +732,7 @@ module Orb
723
732
  Orb::NewFloatingPackageWithAllocationPrice,
724
733
  Orb::NewFloatingUnitWithPercentPrice,
725
734
  Orb::NewFloatingMatrixWithAllocationPrice,
735
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts,
726
736
  Orb::NewFloatingTieredWithProrationPrice,
727
737
  Orb::NewFloatingUnitWithProrationPrice,
728
738
  Orb::NewFloatingGroupedAllocationPrice,
@@ -737,6 +747,8 @@ module Orb
737
747
  Orb::NewFloatingScalableMatrixWithTieredPricingPrice,
738
748
  Orb::NewFloatingCumulativeGroupedBulkPrice,
739
749
  Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation,
750
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance,
751
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance,
740
752
  Orb::NewFloatingMinimumCompositePrice,
741
753
  Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent,
742
754
  Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput
@@ -1203,11 +1215,11 @@ module Orb
1203
1215
  end
1204
1216
  end
1205
1217
 
1206
- class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel
1218
+ class MatrixWithThresholdDiscounts < Orb::Internal::Type::BaseModel
1207
1219
  OrHash =
1208
1220
  T.type_alias do
1209
1221
  T.any(
1210
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds,
1222
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts,
1211
1223
  Orb::Internal::AnyHash
1212
1224
  )
1213
1225
  end
@@ -1215,7 +1227,7 @@ module Orb
1215
1227
  # The cadence to bill for this price on.
1216
1228
  sig do
1217
1229
  returns(
1218
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol
1230
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::OrSymbol
1219
1231
  )
1220
1232
  end
1221
1233
  attr_accessor :cadence
@@ -1224,25 +1236,25 @@ module Orb
1224
1236
  sig { returns(String) }
1225
1237
  attr_accessor :currency
1226
1238
 
1227
- # 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
1228
1244
  sig do
1229
1245
  returns(
1230
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig
1246
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig
1231
1247
  )
1232
1248
  end
1233
- attr_reader :grouped_with_min_max_thresholds_config
1249
+ attr_reader :matrix_with_threshold_discounts_config
1234
1250
 
1235
1251
  sig do
1236
1252
  params(
1237
- grouped_with_min_max_thresholds_config:
1238
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash
1253
+ matrix_with_threshold_discounts_config:
1254
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::OrHash
1239
1255
  ).void
1240
1256
  end
1241
- attr_writer :grouped_with_min_max_thresholds_config
1242
-
1243
- # The id of the item the price will be associated with.
1244
- sig { returns(String) }
1245
- attr_accessor :item_id
1257
+ attr_writer :matrix_with_threshold_discounts_config
1246
1258
 
1247
1259
  # The pricing model type
1248
1260
  sig { returns(Symbol) }
@@ -1343,11 +1355,11 @@ module Orb
1343
1355
  sig do
1344
1356
  params(
1345
1357
  cadence:
1346
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol,
1358
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::OrSymbol,
1347
1359
  currency: String,
1348
- grouped_with_min_max_thresholds_config:
1349
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash,
1350
1360
  item_id: String,
1361
+ matrix_with_threshold_discounts_config:
1362
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::OrHash,
1351
1363
  name: String,
1352
1364
  billable_metric_id: T.nilable(String),
1353
1365
  billed_in_advance: T.nilable(T::Boolean),
@@ -1378,10 +1390,10 @@ module Orb
1378
1390
  cadence:,
1379
1391
  # An ISO 4217 currency string for which this price is billed in.
1380
1392
  currency:,
1381
- # Configuration for grouped_with_min_max_thresholds pricing
1382
- grouped_with_min_max_thresholds_config:,
1383
1393
  # The id of the item the price will be associated with.
1384
1394
  item_id:,
1395
+ # Configuration for matrix_with_threshold_discounts pricing
1396
+ matrix_with_threshold_discounts_config:,
1385
1397
  # The name of the price.
1386
1398
  name:,
1387
1399
  # The id of the billable metric for the price. Only needed if the price is
@@ -1416,7 +1428,7 @@ module Orb
1416
1428
  # by setting `metadata` to `null`.
1417
1429
  metadata: nil,
1418
1430
  # The pricing model type
1419
- model_type: :grouped_with_min_max_thresholds
1431
+ model_type: :matrix_with_threshold_discounts
1420
1432
  )
1421
1433
  end
1422
1434
 
@@ -1424,11 +1436,11 @@ module Orb
1424
1436
  override.returns(
1425
1437
  {
1426
1438
  cadence:
1427
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol,
1439
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::OrSymbol,
1428
1440
  currency: String,
1429
- grouped_with_min_max_thresholds_config:
1430
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig,
1431
1441
  item_id: String,
1442
+ matrix_with_threshold_discounts_config:
1443
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig,
1432
1444
  model_type: Symbol,
1433
1445
  name: String,
1434
1446
  billable_metric_id: T.nilable(String),
@@ -1466,7 +1478,7 @@ module Orb
1466
1478
  T.type_alias do
1467
1479
  T.all(
1468
1480
  Symbol,
1469
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence
1481
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence
1470
1482
  )
1471
1483
  end
1472
1484
  OrSymbol = T.type_alias { T.any(Symbol, String) }
@@ -1474,38 +1486,38 @@ module Orb
1474
1486
  ANNUAL =
1475
1487
  T.let(
1476
1488
  :annual,
1477
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1489
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1478
1490
  )
1479
1491
  SEMI_ANNUAL =
1480
1492
  T.let(
1481
1493
  :semi_annual,
1482
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1494
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1483
1495
  )
1484
1496
  MONTHLY =
1485
1497
  T.let(
1486
1498
  :monthly,
1487
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1499
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1488
1500
  )
1489
1501
  QUARTERLY =
1490
1502
  T.let(
1491
1503
  :quarterly,
1492
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1504
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1493
1505
  )
1494
1506
  ONE_TIME =
1495
1507
  T.let(
1496
1508
  :one_time,
1497
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1509
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1498
1510
  )
1499
1511
  CUSTOM =
1500
1512
  T.let(
1501
1513
  :custom,
1502
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1514
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1503
1515
  )
1504
1516
 
1505
1517
  sig do
1506
1518
  override.returns(
1507
1519
  T::Array[
1508
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1520
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
1509
1521
  ]
1510
1522
  )
1511
1523
  end
@@ -1513,72 +1525,228 @@ module Orb
1513
1525
  end
1514
1526
  end
1515
1527
 
1516
- class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel
1528
+ class MatrixWithThresholdDiscountsConfig < Orb::Internal::Type::BaseModel
1517
1529
  OrHash =
1518
1530
  T.type_alias do
1519
1531
  T.any(
1520
- Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig,
1532
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig,
1521
1533
  Orb::Internal::AnyHash
1522
1534
  )
1523
1535
  end
1524
1536
 
1525
- # The event property used to group before applying thresholds
1537
+ # Unit price used for usage that does not match any defined matrix cell.
1526
1538
  sig { returns(String) }
1527
- attr_accessor :grouping_key
1539
+ attr_accessor :default_unit_amount
1528
1540
 
1529
- # The maximum amount to charge each group
1541
+ # First matrix dimension key.
1530
1542
  sig { returns(String) }
1531
- attr_accessor :maximum_charge
1543
+ attr_accessor :first_dimension
1532
1544
 
1533
- # The minimum amount to charge each group, regardless of usage
1534
- sig { returns(String) }
1535
- 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
1536
1554
 
1537
- # The base price charged per group
1538
- sig { returns(String) }
1539
- 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
1540
1569
 
1541
- # Configuration for grouped_with_min_max_thresholds pricing
1542
1570
  sig do
1543
1571
  params(
1544
- grouping_key: String,
1545
- maximum_charge: String,
1546
- minimum_charge: String,
1547
- 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
+ ]
1548
1594
  ).returns(T.attached_class)
1549
1595
  end
1550
1596
  def self.new(
1551
- # The event property used to group before applying thresholds
1552
- grouping_key:,
1553
- # The maximum amount to charge each group
1554
- maximum_charge:,
1555
- # The minimum amount to charge each group, regardless of usage
1556
- minimum_charge:,
1557
- # The base price charged per group
1558
- 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
1559
1606
  )
1560
1607
  end
1561
1608
 
1562
1609
  sig do
1563
1610
  override.returns(
1564
1611
  {
1565
- grouping_key: String,
1566
- maximum_charge: String,
1567
- minimum_charge: String,
1568
- 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
+ ]
1569
1623
  }
1570
1624
  )
1571
1625
  end
1572
1626
  def to_hash
1573
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
1574
1742
  end
1575
1743
  end
1576
1744
 
1577
- class CumulativeGroupedAllocation < Orb::Internal::Type::BaseModel
1745
+ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel
1578
1746
  OrHash =
1579
1747
  T.type_alias do
1580
1748
  T.any(
1581
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation,
1749
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds,
1582
1750
  Orb::Internal::AnyHash
1583
1751
  )
1584
1752
  end
@@ -1586,30 +1754,30 @@ module Orb
1586
1754
  # The cadence to bill for this price on.
1587
1755
  sig do
1588
1756
  returns(
1589
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::OrSymbol
1757
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol
1590
1758
  )
1591
1759
  end
1592
1760
  attr_accessor :cadence
1593
1761
 
1594
- # 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
1595
1767
  sig do
1596
1768
  returns(
1597
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig
1769
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig
1598
1770
  )
1599
1771
  end
1600
- attr_reader :cumulative_grouped_allocation_config
1772
+ attr_reader :grouped_with_min_max_thresholds_config
1601
1773
 
1602
1774
  sig do
1603
1775
  params(
1604
- cumulative_grouped_allocation_config:
1605
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig::OrHash
1776
+ grouped_with_min_max_thresholds_config:
1777
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash
1606
1778
  ).void
1607
1779
  end
1608
- attr_writer :cumulative_grouped_allocation_config
1609
-
1610
- # An ISO 4217 currency string for which this price is billed in.
1611
- sig { returns(String) }
1612
- attr_accessor :currency
1780
+ attr_writer :grouped_with_min_max_thresholds_config
1613
1781
 
1614
1782
  # The id of the item the price will be associated with.
1615
1783
  sig { returns(String) }
@@ -1714,10 +1882,10 @@ module Orb
1714
1882
  sig do
1715
1883
  params(
1716
1884
  cadence:
1717
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::OrSymbol,
1718
- cumulative_grouped_allocation_config:
1719
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig::OrHash,
1885
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol,
1720
1886
  currency: String,
1887
+ grouped_with_min_max_thresholds_config:
1888
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash,
1721
1889
  item_id: String,
1722
1890
  name: String,
1723
1891
  billable_metric_id: T.nilable(String),
@@ -1747,10 +1915,10 @@ module Orb
1747
1915
  def self.new(
1748
1916
  # The cadence to bill for this price on.
1749
1917
  cadence:,
1750
- # Configuration for cumulative_grouped_allocation pricing
1751
- cumulative_grouped_allocation_config:,
1752
1918
  # An ISO 4217 currency string for which this price is billed in.
1753
1919
  currency:,
1920
+ # Configuration for grouped_with_min_max_thresholds pricing
1921
+ grouped_with_min_max_thresholds_config:,
1754
1922
  # The id of the item the price will be associated with.
1755
1923
  item_id:,
1756
1924
  # The name of the price.
@@ -1787,7 +1955,7 @@ module Orb
1787
1955
  # by setting `metadata` to `null`.
1788
1956
  metadata: nil,
1789
1957
  # The pricing model type
1790
- model_type: :cumulative_grouped_allocation
1958
+ model_type: :grouped_with_min_max_thresholds
1791
1959
  )
1792
1960
  end
1793
1961
 
@@ -1795,10 +1963,10 @@ module Orb
1795
1963
  override.returns(
1796
1964
  {
1797
1965
  cadence:
1798
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::OrSymbol,
1799
- cumulative_grouped_allocation_config:
1800
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig,
1966
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol,
1801
1967
  currency: String,
1968
+ grouped_with_min_max_thresholds_config:
1969
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig,
1802
1970
  item_id: String,
1803
1971
  model_type: Symbol,
1804
1972
  name: String,
@@ -1837,7 +2005,7 @@ module Orb
1837
2005
  T.type_alias do
1838
2006
  T.all(
1839
2007
  Symbol,
1840
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence
2008
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence
1841
2009
  )
1842
2010
  end
1843
2011
  OrSymbol = T.type_alias { T.any(Symbol, String) }
@@ -1845,38 +2013,38 @@ module Orb
1845
2013
  ANNUAL =
1846
2014
  T.let(
1847
2015
  :annual,
1848
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2016
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1849
2017
  )
1850
2018
  SEMI_ANNUAL =
1851
2019
  T.let(
1852
2020
  :semi_annual,
1853
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2021
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1854
2022
  )
1855
2023
  MONTHLY =
1856
2024
  T.let(
1857
2025
  :monthly,
1858
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2026
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1859
2027
  )
1860
2028
  QUARTERLY =
1861
2029
  T.let(
1862
2030
  :quarterly,
1863
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2031
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1864
2032
  )
1865
2033
  ONE_TIME =
1866
2034
  T.let(
1867
2035
  :one_time,
1868
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2036
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1869
2037
  )
1870
2038
  CUSTOM =
1871
2039
  T.let(
1872
2040
  :custom,
1873
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2041
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1874
2042
  )
1875
2043
 
1876
2044
  sig do
1877
2045
  override.returns(
1878
2046
  T::Array[
1879
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2047
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1880
2048
  ]
1881
2049
  )
1882
2050
  end
@@ -1884,59 +2052,59 @@ module Orb
1884
2052
  end
1885
2053
  end
1886
2054
 
1887
- class CumulativeGroupedAllocationConfig < Orb::Internal::Type::BaseModel
2055
+ class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel
1888
2056
  OrHash =
1889
2057
  T.type_alias do
1890
2058
  T.any(
1891
- Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig,
2059
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig,
1892
2060
  Orb::Internal::AnyHash
1893
2061
  )
1894
2062
  end
1895
2063
 
1896
- # The overall allocation across all groups
2064
+ # The event property used to group before applying thresholds
1897
2065
  sig { returns(String) }
1898
- attr_accessor :cumulative_allocation
2066
+ attr_accessor :grouping_key
1899
2067
 
1900
- # The allocation per individual group
2068
+ # The maximum amount to charge each group
1901
2069
  sig { returns(String) }
1902
- attr_accessor :group_allocation
2070
+ attr_accessor :maximum_charge
1903
2071
 
1904
- # The event property used to group usage before applying allocations
2072
+ # The minimum amount to charge each group, regardless of usage
1905
2073
  sig { returns(String) }
1906
- attr_accessor :grouping_key
2074
+ attr_accessor :minimum_charge
1907
2075
 
1908
- # The amount to charge for each unit outside of the allocation
2076
+ # The base price charged per group
1909
2077
  sig { returns(String) }
1910
- attr_accessor :unit_amount
2078
+ attr_accessor :per_unit_rate
1911
2079
 
1912
- # Configuration for cumulative_grouped_allocation pricing
2080
+ # Configuration for grouped_with_min_max_thresholds pricing
1913
2081
  sig do
1914
2082
  params(
1915
- cumulative_allocation: String,
1916
- group_allocation: String,
1917
2083
  grouping_key: String,
1918
- unit_amount: String
2084
+ maximum_charge: String,
2085
+ minimum_charge: String,
2086
+ per_unit_rate: String
1919
2087
  ).returns(T.attached_class)
1920
2088
  end
1921
2089
  def self.new(
1922
- # The overall allocation across all groups
1923
- cumulative_allocation:,
1924
- # The allocation per individual group
1925
- group_allocation:,
1926
- # The event property used to group usage before applying allocations
2090
+ # The event property used to group before applying thresholds
1927
2091
  grouping_key:,
1928
- # The amount to charge for each unit outside of the allocation
1929
- unit_amount:
1930
- )
1931
- end
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
+ )
2099
+ end
1932
2100
 
1933
2101
  sig do
1934
2102
  override.returns(
1935
2103
  {
1936
- cumulative_allocation: String,
1937
- group_allocation: String,
1938
2104
  grouping_key: String,
1939
- unit_amount: String
2105
+ maximum_charge: String,
2106
+ minimum_charge: String,
2107
+ per_unit_rate: String
1940
2108
  }
1941
2109
  )
1942
2110
  end
@@ -1945,11 +2113,11 @@ module Orb
1945
2113
  end
1946
2114
  end
1947
2115
 
1948
- class Percent < Orb::Internal::Type::BaseModel
2116
+ class CumulativeGroupedAllocation < Orb::Internal::Type::BaseModel
1949
2117
  OrHash =
1950
2118
  T.type_alias do
1951
2119
  T.any(
1952
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent,
2120
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation,
1953
2121
  Orb::Internal::AnyHash
1954
2122
  )
1955
2123
  end
@@ -1957,11 +2125,27 @@ module Orb
1957
2125
  # The cadence to bill for this price on.
1958
2126
  sig do
1959
2127
  returns(
1960
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::OrSymbol
2128
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::OrSymbol
1961
2129
  )
1962
2130
  end
1963
2131
  attr_accessor :cadence
1964
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
+
1965
2149
  # An ISO 4217 currency string for which this price is billed in.
1966
2150
  sig { returns(String) }
1967
2151
  attr_accessor :currency
@@ -1978,22 +2162,6 @@ module Orb
1978
2162
  sig { returns(String) }
1979
2163
  attr_accessor :name
1980
2164
 
1981
- # Configuration for percent pricing
1982
- sig do
1983
- returns(
1984
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig
1985
- )
1986
- end
1987
- attr_reader :percent_config
1988
-
1989
- sig do
1990
- params(
1991
- percent_config:
1992
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig::OrHash
1993
- ).void
1994
- end
1995
- attr_writer :percent_config
1996
-
1997
2165
  # The id of the billable metric for the price. Only needed if the price is
1998
2166
  # usage-based.
1999
2167
  sig { returns(T.nilable(String)) }
@@ -2085,12 +2253,12 @@ module Orb
2085
2253
  sig do
2086
2254
  params(
2087
2255
  cadence:
2088
- 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,
2089
2259
  currency: String,
2090
2260
  item_id: String,
2091
2261
  name: String,
2092
- percent_config:
2093
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig::OrHash,
2094
2262
  billable_metric_id: T.nilable(String),
2095
2263
  billed_in_advance: T.nilable(T::Boolean),
2096
2264
  billing_cycle_configuration:
@@ -2118,14 +2286,14 @@ module Orb
2118
2286
  def self.new(
2119
2287
  # The cadence to bill for this price on.
2120
2288
  cadence:,
2289
+ # Configuration for cumulative_grouped_allocation pricing
2290
+ cumulative_grouped_allocation_config:,
2121
2291
  # An ISO 4217 currency string for which this price is billed in.
2122
2292
  currency:,
2123
2293
  # The id of the item the price will be associated with.
2124
2294
  item_id:,
2125
2295
  # The name of the price.
2126
2296
  name:,
2127
- # Configuration for percent pricing
2128
- percent_config:,
2129
2297
  # The id of the billable metric for the price. Only needed if the price is
2130
2298
  # usage-based.
2131
2299
  billable_metric_id: nil,
@@ -2158,7 +2326,7 @@ module Orb
2158
2326
  # by setting `metadata` to `null`.
2159
2327
  metadata: nil,
2160
2328
  # The pricing model type
2161
- model_type: :percent
2329
+ model_type: :cumulative_grouped_allocation
2162
2330
  )
2163
2331
  end
2164
2332
 
@@ -2166,13 +2334,13 @@ module Orb
2166
2334
  override.returns(
2167
2335
  {
2168
2336
  cadence:
2169
- 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,
2170
2340
  currency: String,
2171
2341
  item_id: String,
2172
2342
  model_type: Symbol,
2173
2343
  name: String,
2174
- percent_config:
2175
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig,
2176
2344
  billable_metric_id: T.nilable(String),
2177
2345
  billed_in_advance: T.nilable(T::Boolean),
2178
2346
  billing_cycle_configuration:
@@ -2208,7 +2376,7 @@ module Orb
2208
2376
  T.type_alias do
2209
2377
  T.all(
2210
2378
  Symbol,
2211
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence
2379
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence
2212
2380
  )
2213
2381
  end
2214
2382
  OrSymbol = T.type_alias { T.any(Symbol, String) }
@@ -2216,38 +2384,38 @@ module Orb
2216
2384
  ANNUAL =
2217
2385
  T.let(
2218
2386
  :annual,
2219
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2387
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2220
2388
  )
2221
2389
  SEMI_ANNUAL =
2222
2390
  T.let(
2223
2391
  :semi_annual,
2224
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2392
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2225
2393
  )
2226
2394
  MONTHLY =
2227
2395
  T.let(
2228
2396
  :monthly,
2229
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2397
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2230
2398
  )
2231
2399
  QUARTERLY =
2232
2400
  T.let(
2233
2401
  :quarterly,
2234
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2402
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2235
2403
  )
2236
2404
  ONE_TIME =
2237
2405
  T.let(
2238
2406
  :one_time,
2239
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2407
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2240
2408
  )
2241
2409
  CUSTOM =
2242
2410
  T.let(
2243
2411
  :custom,
2244
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2412
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2245
2413
  )
2246
2414
 
2247
2415
  sig do
2248
2416
  override.returns(
2249
2417
  T::Array[
2250
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol
2418
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2251
2419
  ]
2252
2420
  )
2253
2421
  end
@@ -2255,38 +2423,72 @@ module Orb
2255
2423
  end
2256
2424
  end
2257
2425
 
2258
- class PercentConfig < Orb::Internal::Type::BaseModel
2426
+ class CumulativeGroupedAllocationConfig < Orb::Internal::Type::BaseModel
2259
2427
  OrHash =
2260
2428
  T.type_alias do
2261
2429
  T.any(
2262
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig,
2430
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig,
2263
2431
  Orb::Internal::AnyHash
2264
2432
  )
2265
2433
  end
2266
2434
 
2267
- # What percent of the component subtotals to charge
2268
- sig { returns(Float) }
2269
- attr_accessor :percent
2435
+ # The overall allocation across all groups
2436
+ sig { returns(String) }
2437
+ attr_accessor :cumulative_allocation
2270
2438
 
2271
- # Configuration for percent pricing
2272
- 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
2273
2460
  def self.new(
2274
- # What percent of the component subtotals to charge
2275
- 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:
2276
2469
  )
2277
2470
  end
2278
2471
 
2279
- 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
2280
2482
  def to_hash
2281
2483
  end
2282
2484
  end
2283
2485
  end
2284
2486
 
2285
- class EventOutput < Orb::Internal::Type::BaseModel
2487
+ class DailyCreditAllowance < Orb::Internal::Type::BaseModel
2286
2488
  OrHash =
2287
2489
  T.type_alias do
2288
2490
  T.any(
2289
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput,
2491
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance,
2290
2492
  Orb::Internal::AnyHash
2291
2493
  )
2292
2494
  end
@@ -2294,7 +2496,7 @@ module Orb
2294
2496
  # The cadence to bill for this price on.
2295
2497
  sig do
2296
2498
  returns(
2297
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::OrSymbol
2499
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::OrSymbol
2298
2500
  )
2299
2501
  end
2300
2502
  attr_accessor :cadence
@@ -2303,21 +2505,21 @@ module Orb
2303
2505
  sig { returns(String) }
2304
2506
  attr_accessor :currency
2305
2507
 
2306
- # Configuration for event_output pricing
2508
+ # Configuration for daily_credit_allowance pricing
2307
2509
  sig do
2308
2510
  returns(
2309
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig
2511
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig
2310
2512
  )
2311
2513
  end
2312
- attr_reader :event_output_config
2514
+ attr_reader :daily_credit_allowance_config
2313
2515
 
2314
2516
  sig do
2315
2517
  params(
2316
- event_output_config:
2317
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig::OrHash
2518
+ daily_credit_allowance_config:
2519
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig::OrHash
2318
2520
  ).void
2319
2521
  end
2320
- attr_writer :event_output_config
2522
+ attr_writer :daily_credit_allowance_config
2321
2523
 
2322
2524
  # The id of the item the price will be associated with.
2323
2525
  sig { returns(String) }
@@ -2422,10 +2624,10 @@ module Orb
2422
2624
  sig do
2423
2625
  params(
2424
2626
  cadence:
2425
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::OrSymbol,
2627
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::OrSymbol,
2426
2628
  currency: String,
2427
- event_output_config:
2428
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig::OrHash,
2629
+ daily_credit_allowance_config:
2630
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig::OrHash,
2429
2631
  item_id: String,
2430
2632
  name: String,
2431
2633
  billable_metric_id: T.nilable(String),
@@ -2457,8 +2659,8 @@ module Orb
2457
2659
  cadence:,
2458
2660
  # An ISO 4217 currency string for which this price is billed in.
2459
2661
  currency:,
2460
- # Configuration for event_output pricing
2461
- event_output_config:,
2662
+ # Configuration for daily_credit_allowance pricing
2663
+ daily_credit_allowance_config:,
2462
2664
  # The id of the item the price will be associated with.
2463
2665
  item_id:,
2464
2666
  # The name of the price.
@@ -2495,7 +2697,7 @@ module Orb
2495
2697
  # by setting `metadata` to `null`.
2496
2698
  metadata: nil,
2497
2699
  # The pricing model type
2498
- model_type: :event_output
2700
+ model_type: :daily_credit_allowance
2499
2701
  )
2500
2702
  end
2501
2703
 
@@ -2503,10 +2705,10 @@ module Orb
2503
2705
  override.returns(
2504
2706
  {
2505
2707
  cadence:
2506
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::OrSymbol,
2708
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::OrSymbol,
2507
2709
  currency: String,
2508
- event_output_config:
2509
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig,
2710
+ daily_credit_allowance_config:
2711
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig,
2510
2712
  item_id: String,
2511
2713
  model_type: Symbol,
2512
2714
  name: String,
@@ -2545,7 +2747,7 @@ module Orb
2545
2747
  T.type_alias do
2546
2748
  T.all(
2547
2749
  Symbol,
2548
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence
2750
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence
2549
2751
  )
2550
2752
  end
2551
2753
  OrSymbol = T.type_alias { T.any(Symbol, String) }
@@ -2553,38 +2755,38 @@ module Orb
2553
2755
  ANNUAL =
2554
2756
  T.let(
2555
2757
  :annual,
2556
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2758
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2557
2759
  )
2558
2760
  SEMI_ANNUAL =
2559
2761
  T.let(
2560
2762
  :semi_annual,
2561
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2763
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2562
2764
  )
2563
2765
  MONTHLY =
2564
2766
  T.let(
2565
2767
  :monthly,
2566
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2768
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2567
2769
  )
2568
2770
  QUARTERLY =
2569
2771
  T.let(
2570
2772
  :quarterly,
2571
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2773
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2572
2774
  )
2573
2775
  ONE_TIME =
2574
2776
  T.let(
2575
2777
  :one_time,
2576
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2778
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2577
2779
  )
2578
2780
  CUSTOM =
2579
2781
  T.let(
2580
2782
  :custom,
2581
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2783
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2582
2784
  )
2583
2785
 
2584
2786
  sig do
2585
2787
  override.returns(
2586
2788
  T::Array[
2587
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol
2789
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::Cadence::TaggedSymbol
2588
2790
  ]
2589
2791
  )
2590
2792
  end
@@ -2592,111 +2794,1336 @@ module Orb
2592
2794
  end
2593
2795
  end
2594
2796
 
2595
- class EventOutputConfig < Orb::Internal::Type::BaseModel
2797
+ class DailyCreditAllowanceConfig < Orb::Internal::Type::BaseModel
2596
2798
  OrHash =
2597
2799
  T.type_alias do
2598
2800
  T.any(
2599
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig,
2801
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::DailyCreditAllowance::DailyCreditAllowanceConfig,
2600
2802
  Orb::Internal::AnyHash
2601
2803
  )
2602
2804
  end
2603
2805
 
2604
- # 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.
2605
2807
  sig { returns(String) }
2606
- attr_accessor :unit_rating_key
2808
+ attr_accessor :daily_allowance
2607
2809
 
2608
- # If provided, this amount will be used as the unit rate when an event does not
2609
- # have a value for the `unit_rating_key`. If not provided, events missing a unit
2610
- # rate will be ignored.
2611
- sig { returns(T.nilable(String)) }
2612
- 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
2613
2814
 
2614
- # An optional key in the event data to group by (e.g., event ID). All events will
2615
- # also be grouped by their unit rate.
2616
- sig { returns(T.nilable(String)) }
2617
- 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
2618
2818
 
2619
- # 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
2620
2836
  sig do
2621
2837
  params(
2622
- unit_rating_key: String,
2623
- default_unit_rate: T.nilable(String),
2624
- 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
+ ]
2625
2846
  ).returns(T.attached_class)
2626
2847
  end
2627
2848
  def self.new(
2628
- # The key in the event data to extract the unit rate from.
2629
- unit_rating_key:,
2630
- # If provided, this amount will be used as the unit rate when an event does not
2631
- # have a value for the `unit_rating_key`. If not provided, events missing a unit
2632
- # rate will be ignored.
2633
- default_unit_rate: nil,
2634
- # An optional key in the event data to group by (e.g., event ID). All events will
2635
- # also be grouped by their unit rate.
2636
- 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:
2637
2862
  )
2638
2863
  end
2639
2864
 
2640
2865
  sig do
2641
2866
  override.returns(
2642
2867
  {
2643
- unit_rating_key: String,
2644
- default_unit_rate: T.nilable(String),
2645
- 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
+ ]
2646
2876
  }
2647
2877
  )
2648
2878
  end
2649
2879
  def to_hash
2650
2880
  end
2651
- end
2652
- end
2653
-
2654
- sig do
2655
- override.returns(
2656
- T::Array[
2657
- Orb::SubscriptionPriceIntervalsParams::Add::Price::Variants
2658
- ]
2659
- )
2660
- end
2661
- def self.variants
2662
- end
2663
- end
2664
- end
2665
2881
 
2666
- class AddAdjustment < Orb::Internal::Type::BaseModel
2667
- OrHash =
2668
- T.type_alias do
2669
- T.any(
2670
- Orb::SubscriptionPriceIntervalsParams::AddAdjustment,
2671
- Orb::Internal::AnyHash
2672
- )
2673
- 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
2674
2890
 
2675
- # The start date of the adjustment interval. This is the date that the adjustment
2676
- # will start affecting prices on the subscription. The adjustment will apply to
2677
- # invoice dates that overlap with this `start_date`. This `start_date` is treated
2678
- # as inclusive for in-advance prices, and exclusive for in-arrears prices.
2679
- sig { returns(T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol)) }
2680
- 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
2681
2895
 
2682
- # The definition of a new adjustment to create and add to the subscription.
2683
- sig do
2684
- returns(
2685
- T.nilable(
2686
- T.any(
2687
- Orb::NewPercentageDiscount,
2688
- Orb::NewUsageDiscount,
2689
- Orb::NewAmountDiscount,
2690
- Orb::NewMinimum,
2691
- Orb::NewMaximum
2692
- )
2693
- )
2694
- )
2695
- end
2696
- attr_accessor :adjustment
2896
+ # Credits charged per unit of usage matching the specified dimension_values
2897
+ sig { returns(String) }
2898
+ attr_accessor :unit_amount
2697
2899
 
2698
- # The ID of the adjustment to add to the subscription. Adjustment IDs can be
2699
- # re-used from existing subscriptions or plans, but adjustments associated with
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
2700
4127
  # coupon redemptions cannot be re-used.
2701
4128
  sig { returns(T.nilable(String)) }
2702
4129
  attr_accessor :adjustment_id
@@ -2722,7 +4149,8 @@ module Orb
2722
4149
  Orb::NewUsageDiscount::OrHash,
2723
4150
  Orb::NewAmountDiscount::OrHash,
2724
4151
  Orb::NewMinimum::OrHash,
2725
- Orb::NewMaximum::OrHash
4152
+ Orb::NewMaximum::OrHash,
4153
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount::OrHash
2726
4154
  )
2727
4155
  ),
2728
4156
  adjustment_id: T.nilable(String),
@@ -2761,7 +4189,8 @@ module Orb
2761
4189
  Orb::NewUsageDiscount,
2762
4190
  Orb::NewAmountDiscount,
2763
4191
  Orb::NewMinimum,
2764
- Orb::NewMaximum
4192
+ Orb::NewMaximum,
4193
+ Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::TieredPercentageDiscount
2765
4194
  )
2766
4195
  ),
2767
4196
  adjustment_id: T.nilable(String),
@@ -2807,10 +4236,444 @@ module Orb
2807
4236
  Orb::NewUsageDiscount,
2808
4237
  Orb::NewAmountDiscount,
2809
4238
  Orb::NewMinimum,
2810
- 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:
2811
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
2812
4624
  end
2813
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
+
2814
4677
  sig do
2815
4678
  override.returns(
2816
4679
  T::Array[