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
@@ -27,6 +27,7 @@ module Orb
27
27
  Orb::NewFloatingPackageWithAllocationPrice,
28
28
  Orb::NewFloatingUnitWithPercentPrice,
29
29
  Orb::NewFloatingMatrixWithAllocationPrice,
30
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts,
30
31
  Orb::NewFloatingTieredWithProrationPrice,
31
32
  Orb::NewFloatingUnitWithProrationPrice,
32
33
  Orb::NewFloatingGroupedAllocationPrice,
@@ -41,6 +42,8 @@ module Orb
41
42
  Orb::NewFloatingScalableMatrixWithTieredPricingPrice,
42
43
  Orb::NewFloatingCumulativeGroupedBulkPrice,
43
44
  Orb::PriceCreateParams::Body::CumulativeGroupedAllocation,
45
+ Orb::PriceCreateParams::Body::DailyCreditAllowance,
46
+ Orb::PriceCreateParams::Body::MeteredAllowance,
44
47
  Orb::NewFloatingMinimumCompositePrice,
45
48
  Orb::PriceCreateParams::Body::Percent,
46
49
  Orb::PriceCreateParams::Body::EventOutput
@@ -67,6 +70,7 @@ module Orb
67
70
  Orb::NewFloatingPackageWithAllocationPrice::OrHash,
68
71
  Orb::NewFloatingUnitWithPercentPrice::OrHash,
69
72
  Orb::NewFloatingMatrixWithAllocationPrice::OrHash,
73
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::OrHash,
70
74
  Orb::NewFloatingTieredWithProrationPrice::OrHash,
71
75
  Orb::NewFloatingUnitWithProrationPrice::OrHash,
72
76
  Orb::NewFloatingGroupedAllocationPrice::OrHash,
@@ -81,6 +85,8 @@ module Orb
81
85
  Orb::NewFloatingScalableMatrixWithTieredPricingPrice::OrHash,
82
86
  Orb::NewFloatingCumulativeGroupedBulkPrice::OrHash,
83
87
  Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::OrHash,
88
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::OrHash,
89
+ Orb::PriceCreateParams::Body::MeteredAllowance::OrHash,
84
90
  Orb::NewFloatingMinimumCompositePrice::OrHash,
85
91
  Orb::PriceCreateParams::Body::Percent::OrHash,
86
92
  Orb::PriceCreateParams::Body::EventOutput::OrHash
@@ -114,6 +120,7 @@ module Orb
114
120
  Orb::NewFloatingPackageWithAllocationPrice,
115
121
  Orb::NewFloatingUnitWithPercentPrice,
116
122
  Orb::NewFloatingMatrixWithAllocationPrice,
123
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts,
117
124
  Orb::NewFloatingTieredWithProrationPrice,
118
125
  Orb::NewFloatingUnitWithProrationPrice,
119
126
  Orb::NewFloatingGroupedAllocationPrice,
@@ -128,6 +135,8 @@ module Orb
128
135
  Orb::NewFloatingScalableMatrixWithTieredPricingPrice,
129
136
  Orb::NewFloatingCumulativeGroupedBulkPrice,
130
137
  Orb::PriceCreateParams::Body::CumulativeGroupedAllocation,
138
+ Orb::PriceCreateParams::Body::DailyCreditAllowance,
139
+ Orb::PriceCreateParams::Body::MeteredAllowance,
131
140
  Orb::NewFloatingMinimumCompositePrice,
132
141
  Orb::PriceCreateParams::Body::Percent,
133
142
  Orb::PriceCreateParams::Body::EventOutput
@@ -160,6 +169,7 @@ module Orb
160
169
  Orb::NewFloatingPackageWithAllocationPrice,
161
170
  Orb::NewFloatingUnitWithPercentPrice,
162
171
  Orb::NewFloatingMatrixWithAllocationPrice,
172
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts,
163
173
  Orb::NewFloatingTieredWithProrationPrice,
164
174
  Orb::NewFloatingUnitWithProrationPrice,
165
175
  Orb::NewFloatingGroupedAllocationPrice,
@@ -174,6 +184,8 @@ module Orb
174
184
  Orb::NewFloatingScalableMatrixWithTieredPricingPrice,
175
185
  Orb::NewFloatingCumulativeGroupedBulkPrice,
176
186
  Orb::PriceCreateParams::Body::CumulativeGroupedAllocation,
187
+ Orb::PriceCreateParams::Body::DailyCreditAllowance,
188
+ Orb::PriceCreateParams::Body::MeteredAllowance,
177
189
  Orb::NewFloatingMinimumCompositePrice,
178
190
  Orb::PriceCreateParams::Body::Percent,
179
191
  Orb::PriceCreateParams::Body::EventOutput
@@ -640,11 +652,1280 @@ module Orb
640
652
  end
641
653
  end
642
654
 
655
+ class MatrixWithThresholdDiscounts < Orb::Internal::Type::BaseModel
656
+ OrHash =
657
+ T.type_alias do
658
+ T.any(
659
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts,
660
+ Orb::Internal::AnyHash
661
+ )
662
+ end
663
+
664
+ # The cadence to bill for this price on.
665
+ sig do
666
+ returns(
667
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::Cadence::OrSymbol
668
+ )
669
+ end
670
+ attr_accessor :cadence
671
+
672
+ # An ISO 4217 currency string for which this price is billed in.
673
+ sig { returns(String) }
674
+ attr_accessor :currency
675
+
676
+ # The id of the item the price will be associated with.
677
+ sig { returns(String) }
678
+ attr_accessor :item_id
679
+
680
+ # Configuration for matrix_with_threshold_discounts pricing
681
+ sig do
682
+ returns(
683
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig
684
+ )
685
+ end
686
+ attr_reader :matrix_with_threshold_discounts_config
687
+
688
+ sig do
689
+ params(
690
+ matrix_with_threshold_discounts_config:
691
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::OrHash
692
+ ).void
693
+ end
694
+ attr_writer :matrix_with_threshold_discounts_config
695
+
696
+ # The pricing model type
697
+ sig { returns(Symbol) }
698
+ attr_accessor :model_type
699
+
700
+ # The name of the price.
701
+ sig { returns(String) }
702
+ attr_accessor :name
703
+
704
+ # The id of the billable metric for the price. Only needed if the price is
705
+ # usage-based.
706
+ sig { returns(T.nilable(String)) }
707
+ attr_accessor :billable_metric_id
708
+
709
+ # If the Price represents a fixed cost, the price will be billed in-advance if
710
+ # this is true, and in-arrears if this is false.
711
+ sig { returns(T.nilable(T::Boolean)) }
712
+ attr_accessor :billed_in_advance
713
+
714
+ # For custom cadence: specifies the duration of the billing period in days or
715
+ # months.
716
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
717
+ attr_reader :billing_cycle_configuration
718
+
719
+ sig do
720
+ params(
721
+ billing_cycle_configuration:
722
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
723
+ ).void
724
+ end
725
+ attr_writer :billing_cycle_configuration
726
+
727
+ # The per unit conversion rate of the price currency to the invoicing currency.
728
+ sig { returns(T.nilable(Float)) }
729
+ attr_accessor :conversion_rate
730
+
731
+ # The configuration for the rate of the price currency to the invoicing currency.
732
+ sig do
733
+ returns(
734
+ T.nilable(
735
+ T.any(
736
+ Orb::UnitConversionRateConfig,
737
+ Orb::TieredConversionRateConfig
738
+ )
739
+ )
740
+ )
741
+ end
742
+ attr_accessor :conversion_rate_config
743
+
744
+ # For dimensional price: specifies a price group and dimension values
745
+ sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) }
746
+ attr_reader :dimensional_price_configuration
747
+
748
+ sig do
749
+ params(
750
+ dimensional_price_configuration:
751
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash)
752
+ ).void
753
+ end
754
+ attr_writer :dimensional_price_configuration
755
+
756
+ # An alias for the price.
757
+ sig { returns(T.nilable(String)) }
758
+ attr_accessor :external_price_id
759
+
760
+ # If the Price represents a fixed cost, this represents the quantity of units
761
+ # applied.
762
+ sig { returns(T.nilable(Float)) }
763
+ attr_accessor :fixed_price_quantity
764
+
765
+ # The property used to group this price on an invoice
766
+ sig { returns(T.nilable(String)) }
767
+ attr_accessor :invoice_grouping_key
768
+
769
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
770
+ # If unspecified, a single invoice is produced per billing cycle.
771
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
772
+ attr_reader :invoicing_cycle_configuration
773
+
774
+ sig do
775
+ params(
776
+ invoicing_cycle_configuration:
777
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
778
+ ).void
779
+ end
780
+ attr_writer :invoicing_cycle_configuration
781
+
782
+ # The ID of the license type to associate with this price.
783
+ sig { returns(T.nilable(String)) }
784
+ attr_accessor :license_type_id
785
+
786
+ # User-specified key/value pairs for the resource. Individual keys can be removed
787
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
788
+ # by setting `metadata` to `null`.
789
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
790
+ attr_accessor :metadata
791
+
792
+ sig do
793
+ params(
794
+ cadence:
795
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::Cadence::OrSymbol,
796
+ currency: String,
797
+ item_id: String,
798
+ matrix_with_threshold_discounts_config:
799
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::OrHash,
800
+ name: String,
801
+ billable_metric_id: T.nilable(String),
802
+ billed_in_advance: T.nilable(T::Boolean),
803
+ billing_cycle_configuration:
804
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
805
+ conversion_rate: T.nilable(Float),
806
+ conversion_rate_config:
807
+ T.nilable(
808
+ T.any(
809
+ Orb::UnitConversionRateConfig::OrHash,
810
+ Orb::TieredConversionRateConfig::OrHash
811
+ )
812
+ ),
813
+ dimensional_price_configuration:
814
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash),
815
+ external_price_id: T.nilable(String),
816
+ fixed_price_quantity: T.nilable(Float),
817
+ invoice_grouping_key: T.nilable(String),
818
+ invoicing_cycle_configuration:
819
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
820
+ license_type_id: T.nilable(String),
821
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
822
+ model_type: Symbol
823
+ ).returns(T.attached_class)
824
+ end
825
+ def self.new(
826
+ # The cadence to bill for this price on.
827
+ cadence:,
828
+ # An ISO 4217 currency string for which this price is billed in.
829
+ currency:,
830
+ # The id of the item the price will be associated with.
831
+ item_id:,
832
+ # Configuration for matrix_with_threshold_discounts pricing
833
+ matrix_with_threshold_discounts_config:,
834
+ # The name of the price.
835
+ name:,
836
+ # The id of the billable metric for the price. Only needed if the price is
837
+ # usage-based.
838
+ billable_metric_id: nil,
839
+ # If the Price represents a fixed cost, the price will be billed in-advance if
840
+ # this is true, and in-arrears if this is false.
841
+ billed_in_advance: nil,
842
+ # For custom cadence: specifies the duration of the billing period in days or
843
+ # months.
844
+ billing_cycle_configuration: nil,
845
+ # The per unit conversion rate of the price currency to the invoicing currency.
846
+ conversion_rate: nil,
847
+ # The configuration for the rate of the price currency to the invoicing currency.
848
+ conversion_rate_config: nil,
849
+ # For dimensional price: specifies a price group and dimension values
850
+ dimensional_price_configuration: nil,
851
+ # An alias for the price.
852
+ external_price_id: nil,
853
+ # If the Price represents a fixed cost, this represents the quantity of units
854
+ # applied.
855
+ fixed_price_quantity: nil,
856
+ # The property used to group this price on an invoice
857
+ invoice_grouping_key: nil,
858
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
859
+ # If unspecified, a single invoice is produced per billing cycle.
860
+ invoicing_cycle_configuration: nil,
861
+ # The ID of the license type to associate with this price.
862
+ license_type_id: nil,
863
+ # User-specified key/value pairs for the resource. Individual keys can be removed
864
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
865
+ # by setting `metadata` to `null`.
866
+ metadata: nil,
867
+ # The pricing model type
868
+ model_type: :matrix_with_threshold_discounts
869
+ )
870
+ end
871
+
872
+ sig do
873
+ override.returns(
874
+ {
875
+ cadence:
876
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::Cadence::OrSymbol,
877
+ currency: String,
878
+ item_id: String,
879
+ matrix_with_threshold_discounts_config:
880
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig,
881
+ model_type: Symbol,
882
+ name: String,
883
+ billable_metric_id: T.nilable(String),
884
+ billed_in_advance: T.nilable(T::Boolean),
885
+ billing_cycle_configuration:
886
+ T.nilable(Orb::NewBillingCycleConfiguration),
887
+ conversion_rate: T.nilable(Float),
888
+ conversion_rate_config:
889
+ T.nilable(
890
+ T.any(
891
+ Orb::UnitConversionRateConfig,
892
+ Orb::TieredConversionRateConfig
893
+ )
894
+ ),
895
+ dimensional_price_configuration:
896
+ T.nilable(Orb::NewDimensionalPriceConfiguration),
897
+ external_price_id: T.nilable(String),
898
+ fixed_price_quantity: T.nilable(Float),
899
+ invoice_grouping_key: T.nilable(String),
900
+ invoicing_cycle_configuration:
901
+ T.nilable(Orb::NewBillingCycleConfiguration),
902
+ license_type_id: T.nilable(String),
903
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])
904
+ }
905
+ )
906
+ end
907
+ def to_hash
908
+ end
909
+
910
+ # The cadence to bill for this price on.
911
+ module Cadence
912
+ extend Orb::Internal::Type::Enum
913
+
914
+ TaggedSymbol =
915
+ T.type_alias do
916
+ T.all(
917
+ Symbol,
918
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::Cadence
919
+ )
920
+ end
921
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
922
+
923
+ ANNUAL =
924
+ T.let(
925
+ :annual,
926
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
927
+ )
928
+ SEMI_ANNUAL =
929
+ T.let(
930
+ :semi_annual,
931
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
932
+ )
933
+ MONTHLY =
934
+ T.let(
935
+ :monthly,
936
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
937
+ )
938
+ QUARTERLY =
939
+ T.let(
940
+ :quarterly,
941
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
942
+ )
943
+ ONE_TIME =
944
+ T.let(
945
+ :one_time,
946
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
947
+ )
948
+ CUSTOM =
949
+ T.let(
950
+ :custom,
951
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
952
+ )
953
+
954
+ sig do
955
+ override.returns(
956
+ T::Array[
957
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::Cadence::TaggedSymbol
958
+ ]
959
+ )
960
+ end
961
+ def self.values
962
+ end
963
+ end
964
+
965
+ class MatrixWithThresholdDiscountsConfig < Orb::Internal::Type::BaseModel
966
+ OrHash =
967
+ T.type_alias do
968
+ T.any(
969
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig,
970
+ Orb::Internal::AnyHash
971
+ )
972
+ end
973
+
974
+ # Unit price used for usage that does not match any defined matrix cell.
975
+ sig { returns(String) }
976
+ attr_accessor :default_unit_amount
977
+
978
+ # First matrix dimension key.
979
+ sig { returns(String) }
980
+ attr_accessor :first_dimension
981
+
982
+ # Per-cell unit prices.
983
+ sig do
984
+ returns(
985
+ T::Array[
986
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::MatrixValue
987
+ ]
988
+ )
989
+ end
990
+ attr_accessor :matrix_values
991
+
992
+ # Optional second matrix dimension key.
993
+ sig { returns(T.nilable(String)) }
994
+ attr_accessor :second_dimension
995
+
996
+ sig do
997
+ returns(
998
+ T.nilable(
999
+ T::Array[
1000
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::ThresholdDiscountGroup
1001
+ ]
1002
+ )
1003
+ )
1004
+ end
1005
+ attr_reader :threshold_discount_groups
1006
+
1007
+ sig do
1008
+ params(
1009
+ threshold_discount_groups:
1010
+ T::Array[
1011
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::ThresholdDiscountGroup::OrHash
1012
+ ]
1013
+ ).void
1014
+ end
1015
+ attr_writer :threshold_discount_groups
1016
+
1017
+ # Configuration for matrix_with_threshold_discounts pricing
1018
+ sig do
1019
+ params(
1020
+ default_unit_amount: String,
1021
+ first_dimension: String,
1022
+ matrix_values:
1023
+ T::Array[
1024
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::MatrixValue::OrHash
1025
+ ],
1026
+ second_dimension: T.nilable(String),
1027
+ threshold_discount_groups:
1028
+ T::Array[
1029
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::ThresholdDiscountGroup::OrHash
1030
+ ]
1031
+ ).returns(T.attached_class)
1032
+ end
1033
+ def self.new(
1034
+ # Unit price used for usage that does not match any defined matrix cell.
1035
+ default_unit_amount:,
1036
+ # First matrix dimension key.
1037
+ first_dimension:,
1038
+ # Per-cell unit prices.
1039
+ matrix_values:,
1040
+ # Optional second matrix dimension key.
1041
+ second_dimension: nil,
1042
+ threshold_discount_groups: nil
1043
+ )
1044
+ end
1045
+
1046
+ sig do
1047
+ override.returns(
1048
+ {
1049
+ default_unit_amount: String,
1050
+ first_dimension: String,
1051
+ matrix_values:
1052
+ T::Array[
1053
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::MatrixValue
1054
+ ],
1055
+ second_dimension: T.nilable(String),
1056
+ threshold_discount_groups:
1057
+ T::Array[
1058
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::ThresholdDiscountGroup
1059
+ ]
1060
+ }
1061
+ )
1062
+ end
1063
+ def to_hash
1064
+ end
1065
+
1066
+ class MatrixValue < Orb::Internal::Type::BaseModel
1067
+ OrHash =
1068
+ T.type_alias do
1069
+ T.any(
1070
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::MatrixValue,
1071
+ Orb::Internal::AnyHash
1072
+ )
1073
+ end
1074
+
1075
+ sig { returns(String) }
1076
+ attr_accessor :first_dimension_value
1077
+
1078
+ sig { returns(String) }
1079
+ attr_accessor :unit_amount
1080
+
1081
+ sig { returns(T.nilable(String)) }
1082
+ attr_accessor :second_dimension_value
1083
+
1084
+ sig do
1085
+ params(
1086
+ first_dimension_value: String,
1087
+ unit_amount: String,
1088
+ second_dimension_value: T.nilable(String)
1089
+ ).returns(T.attached_class)
1090
+ end
1091
+ def self.new(
1092
+ first_dimension_value:,
1093
+ unit_amount:,
1094
+ second_dimension_value: nil
1095
+ )
1096
+ end
1097
+
1098
+ sig do
1099
+ override.returns(
1100
+ {
1101
+ first_dimension_value: String,
1102
+ unit_amount: String,
1103
+ second_dimension_value: T.nilable(String)
1104
+ }
1105
+ )
1106
+ end
1107
+ def to_hash
1108
+ end
1109
+ end
1110
+
1111
+ class ThresholdDiscountGroup < Orb::Internal::Type::BaseModel
1112
+ OrHash =
1113
+ T.type_alias do
1114
+ T.any(
1115
+ Orb::PriceCreateParams::Body::MatrixWithThresholdDiscounts::MatrixWithThresholdDiscountsConfig::ThresholdDiscountGroup,
1116
+ Orb::Internal::AnyHash
1117
+ )
1118
+ end
1119
+
1120
+ # Discount rate applied to spend above the threshold.
1121
+ sig { returns(String) }
1122
+ attr_accessor :above_threshold_discount_percentage
1123
+
1124
+ # Discount rate applied to spend at or below the threshold. Set to 0 for no
1125
+ # baseline discount.
1126
+ sig { returns(String) }
1127
+ attr_accessor :below_threshold_discount_percentage
1128
+
1129
+ # Semicolon-separated list of matrix cell coordinates targeted by this group. Each
1130
+ # coordinate is `first,second` when the matrix has two dimensions, or just `first`
1131
+ # for a single-dimension matrix. Example: `blue,circle;green,triangle`.
1132
+ sig { returns(String) }
1133
+ attr_accessor :cell_coordinates
1134
+
1135
+ sig { returns(String) }
1136
+ attr_accessor :threshold_amount
1137
+
1138
+ sig { returns(T.nilable(String)) }
1139
+ attr_accessor :description
1140
+
1141
+ sig do
1142
+ params(
1143
+ above_threshold_discount_percentage: String,
1144
+ below_threshold_discount_percentage: String,
1145
+ cell_coordinates: String,
1146
+ threshold_amount: String,
1147
+ description: T.nilable(String)
1148
+ ).returns(T.attached_class)
1149
+ end
1150
+ def self.new(
1151
+ # Discount rate applied to spend above the threshold.
1152
+ above_threshold_discount_percentage:,
1153
+ # Discount rate applied to spend at or below the threshold. Set to 0 for no
1154
+ # baseline discount.
1155
+ below_threshold_discount_percentage:,
1156
+ # Semicolon-separated list of matrix cell coordinates targeted by this group. Each
1157
+ # coordinate is `first,second` when the matrix has two dimensions, or just `first`
1158
+ # for a single-dimension matrix. Example: `blue,circle;green,triangle`.
1159
+ cell_coordinates:,
1160
+ threshold_amount:,
1161
+ description: nil
1162
+ )
1163
+ end
1164
+
1165
+ sig do
1166
+ override.returns(
1167
+ {
1168
+ above_threshold_discount_percentage: String,
1169
+ below_threshold_discount_percentage: String,
1170
+ cell_coordinates: String,
1171
+ threshold_amount: String,
1172
+ description: T.nilable(String)
1173
+ }
1174
+ )
1175
+ end
1176
+ def to_hash
1177
+ end
1178
+ end
1179
+ end
1180
+ end
1181
+
643
1182
  class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel
644
1183
  OrHash =
645
1184
  T.type_alias do
646
1185
  T.any(
647
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds,
1186
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds,
1187
+ Orb::Internal::AnyHash
1188
+ )
1189
+ end
1190
+
1191
+ # The cadence to bill for this price on.
1192
+ sig do
1193
+ returns(
1194
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::OrSymbol
1195
+ )
1196
+ end
1197
+ attr_accessor :cadence
1198
+
1199
+ # An ISO 4217 currency string for which this price is billed in.
1200
+ sig { returns(String) }
1201
+ attr_accessor :currency
1202
+
1203
+ # Configuration for grouped_with_min_max_thresholds pricing
1204
+ sig do
1205
+ returns(
1206
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig
1207
+ )
1208
+ end
1209
+ attr_reader :grouped_with_min_max_thresholds_config
1210
+
1211
+ sig do
1212
+ params(
1213
+ grouped_with_min_max_thresholds_config:
1214
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash
1215
+ ).void
1216
+ end
1217
+ attr_writer :grouped_with_min_max_thresholds_config
1218
+
1219
+ # The id of the item the price will be associated with.
1220
+ sig { returns(String) }
1221
+ attr_accessor :item_id
1222
+
1223
+ # The pricing model type
1224
+ sig { returns(Symbol) }
1225
+ attr_accessor :model_type
1226
+
1227
+ # The name of the price.
1228
+ sig { returns(String) }
1229
+ attr_accessor :name
1230
+
1231
+ # The id of the billable metric for the price. Only needed if the price is
1232
+ # usage-based.
1233
+ sig { returns(T.nilable(String)) }
1234
+ attr_accessor :billable_metric_id
1235
+
1236
+ # If the Price represents a fixed cost, the price will be billed in-advance if
1237
+ # this is true, and in-arrears if this is false.
1238
+ sig { returns(T.nilable(T::Boolean)) }
1239
+ attr_accessor :billed_in_advance
1240
+
1241
+ # For custom cadence: specifies the duration of the billing period in days or
1242
+ # months.
1243
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
1244
+ attr_reader :billing_cycle_configuration
1245
+
1246
+ sig do
1247
+ params(
1248
+ billing_cycle_configuration:
1249
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
1250
+ ).void
1251
+ end
1252
+ attr_writer :billing_cycle_configuration
1253
+
1254
+ # The per unit conversion rate of the price currency to the invoicing currency.
1255
+ sig { returns(T.nilable(Float)) }
1256
+ attr_accessor :conversion_rate
1257
+
1258
+ # The configuration for the rate of the price currency to the invoicing currency.
1259
+ sig do
1260
+ returns(
1261
+ T.nilable(
1262
+ T.any(
1263
+ Orb::UnitConversionRateConfig,
1264
+ Orb::TieredConversionRateConfig
1265
+ )
1266
+ )
1267
+ )
1268
+ end
1269
+ attr_accessor :conversion_rate_config
1270
+
1271
+ # For dimensional price: specifies a price group and dimension values
1272
+ sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) }
1273
+ attr_reader :dimensional_price_configuration
1274
+
1275
+ sig do
1276
+ params(
1277
+ dimensional_price_configuration:
1278
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash)
1279
+ ).void
1280
+ end
1281
+ attr_writer :dimensional_price_configuration
1282
+
1283
+ # An alias for the price.
1284
+ sig { returns(T.nilable(String)) }
1285
+ attr_accessor :external_price_id
1286
+
1287
+ # If the Price represents a fixed cost, this represents the quantity of units
1288
+ # applied.
1289
+ sig { returns(T.nilable(Float)) }
1290
+ attr_accessor :fixed_price_quantity
1291
+
1292
+ # The property used to group this price on an invoice
1293
+ sig { returns(T.nilable(String)) }
1294
+ attr_accessor :invoice_grouping_key
1295
+
1296
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
1297
+ # If unspecified, a single invoice is produced per billing cycle.
1298
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
1299
+ attr_reader :invoicing_cycle_configuration
1300
+
1301
+ sig do
1302
+ params(
1303
+ invoicing_cycle_configuration:
1304
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
1305
+ ).void
1306
+ end
1307
+ attr_writer :invoicing_cycle_configuration
1308
+
1309
+ # The ID of the license type to associate with this price.
1310
+ sig { returns(T.nilable(String)) }
1311
+ attr_accessor :license_type_id
1312
+
1313
+ # User-specified key/value pairs for the resource. Individual keys can be removed
1314
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
1315
+ # by setting `metadata` to `null`.
1316
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
1317
+ attr_accessor :metadata
1318
+
1319
+ sig do
1320
+ params(
1321
+ cadence:
1322
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::OrSymbol,
1323
+ currency: String,
1324
+ grouped_with_min_max_thresholds_config:
1325
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash,
1326
+ item_id: String,
1327
+ name: String,
1328
+ billable_metric_id: T.nilable(String),
1329
+ billed_in_advance: T.nilable(T::Boolean),
1330
+ billing_cycle_configuration:
1331
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
1332
+ conversion_rate: T.nilable(Float),
1333
+ conversion_rate_config:
1334
+ T.nilable(
1335
+ T.any(
1336
+ Orb::UnitConversionRateConfig::OrHash,
1337
+ Orb::TieredConversionRateConfig::OrHash
1338
+ )
1339
+ ),
1340
+ dimensional_price_configuration:
1341
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash),
1342
+ external_price_id: T.nilable(String),
1343
+ fixed_price_quantity: T.nilable(Float),
1344
+ invoice_grouping_key: T.nilable(String),
1345
+ invoicing_cycle_configuration:
1346
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
1347
+ license_type_id: T.nilable(String),
1348
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
1349
+ model_type: Symbol
1350
+ ).returns(T.attached_class)
1351
+ end
1352
+ def self.new(
1353
+ # The cadence to bill for this price on.
1354
+ cadence:,
1355
+ # An ISO 4217 currency string for which this price is billed in.
1356
+ currency:,
1357
+ # Configuration for grouped_with_min_max_thresholds pricing
1358
+ grouped_with_min_max_thresholds_config:,
1359
+ # The id of the item the price will be associated with.
1360
+ item_id:,
1361
+ # The name of the price.
1362
+ name:,
1363
+ # The id of the billable metric for the price. Only needed if the price is
1364
+ # usage-based.
1365
+ billable_metric_id: nil,
1366
+ # If the Price represents a fixed cost, the price will be billed in-advance if
1367
+ # this is true, and in-arrears if this is false.
1368
+ billed_in_advance: nil,
1369
+ # For custom cadence: specifies the duration of the billing period in days or
1370
+ # months.
1371
+ billing_cycle_configuration: nil,
1372
+ # The per unit conversion rate of the price currency to the invoicing currency.
1373
+ conversion_rate: nil,
1374
+ # The configuration for the rate of the price currency to the invoicing currency.
1375
+ conversion_rate_config: nil,
1376
+ # For dimensional price: specifies a price group and dimension values
1377
+ dimensional_price_configuration: nil,
1378
+ # An alias for the price.
1379
+ external_price_id: nil,
1380
+ # If the Price represents a fixed cost, this represents the quantity of units
1381
+ # applied.
1382
+ fixed_price_quantity: nil,
1383
+ # The property used to group this price on an invoice
1384
+ invoice_grouping_key: nil,
1385
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
1386
+ # If unspecified, a single invoice is produced per billing cycle.
1387
+ invoicing_cycle_configuration: nil,
1388
+ # The ID of the license type to associate with this price.
1389
+ license_type_id: nil,
1390
+ # User-specified key/value pairs for the resource. Individual keys can be removed
1391
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
1392
+ # by setting `metadata` to `null`.
1393
+ metadata: nil,
1394
+ # The pricing model type
1395
+ model_type: :grouped_with_min_max_thresholds
1396
+ )
1397
+ end
1398
+
1399
+ sig do
1400
+ override.returns(
1401
+ {
1402
+ cadence:
1403
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::OrSymbol,
1404
+ currency: String,
1405
+ grouped_with_min_max_thresholds_config:
1406
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig,
1407
+ item_id: String,
1408
+ model_type: Symbol,
1409
+ name: String,
1410
+ billable_metric_id: T.nilable(String),
1411
+ billed_in_advance: T.nilable(T::Boolean),
1412
+ billing_cycle_configuration:
1413
+ T.nilable(Orb::NewBillingCycleConfiguration),
1414
+ conversion_rate: T.nilable(Float),
1415
+ conversion_rate_config:
1416
+ T.nilable(
1417
+ T.any(
1418
+ Orb::UnitConversionRateConfig,
1419
+ Orb::TieredConversionRateConfig
1420
+ )
1421
+ ),
1422
+ dimensional_price_configuration:
1423
+ T.nilable(Orb::NewDimensionalPriceConfiguration),
1424
+ external_price_id: T.nilable(String),
1425
+ fixed_price_quantity: T.nilable(Float),
1426
+ invoice_grouping_key: T.nilable(String),
1427
+ invoicing_cycle_configuration:
1428
+ T.nilable(Orb::NewBillingCycleConfiguration),
1429
+ license_type_id: T.nilable(String),
1430
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])
1431
+ }
1432
+ )
1433
+ end
1434
+ def to_hash
1435
+ end
1436
+
1437
+ # The cadence to bill for this price on.
1438
+ module Cadence
1439
+ extend Orb::Internal::Type::Enum
1440
+
1441
+ TaggedSymbol =
1442
+ T.type_alias do
1443
+ T.all(
1444
+ Symbol,
1445
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence
1446
+ )
1447
+ end
1448
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1449
+
1450
+ ANNUAL =
1451
+ T.let(
1452
+ :annual,
1453
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1454
+ )
1455
+ SEMI_ANNUAL =
1456
+ T.let(
1457
+ :semi_annual,
1458
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1459
+ )
1460
+ MONTHLY =
1461
+ T.let(
1462
+ :monthly,
1463
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1464
+ )
1465
+ QUARTERLY =
1466
+ T.let(
1467
+ :quarterly,
1468
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1469
+ )
1470
+ ONE_TIME =
1471
+ T.let(
1472
+ :one_time,
1473
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1474
+ )
1475
+ CUSTOM =
1476
+ T.let(
1477
+ :custom,
1478
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1479
+ )
1480
+
1481
+ sig do
1482
+ override.returns(
1483
+ T::Array[
1484
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
1485
+ ]
1486
+ )
1487
+ end
1488
+ def self.values
1489
+ end
1490
+ end
1491
+
1492
+ class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel
1493
+ OrHash =
1494
+ T.type_alias do
1495
+ T.any(
1496
+ Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig,
1497
+ Orb::Internal::AnyHash
1498
+ )
1499
+ end
1500
+
1501
+ # The event property used to group before applying thresholds
1502
+ sig { returns(String) }
1503
+ attr_accessor :grouping_key
1504
+
1505
+ # The maximum amount to charge each group
1506
+ sig { returns(String) }
1507
+ attr_accessor :maximum_charge
1508
+
1509
+ # The minimum amount to charge each group, regardless of usage
1510
+ sig { returns(String) }
1511
+ attr_accessor :minimum_charge
1512
+
1513
+ # The base price charged per group
1514
+ sig { returns(String) }
1515
+ attr_accessor :per_unit_rate
1516
+
1517
+ # Configuration for grouped_with_min_max_thresholds pricing
1518
+ sig do
1519
+ params(
1520
+ grouping_key: String,
1521
+ maximum_charge: String,
1522
+ minimum_charge: String,
1523
+ per_unit_rate: String
1524
+ ).returns(T.attached_class)
1525
+ end
1526
+ def self.new(
1527
+ # The event property used to group before applying thresholds
1528
+ grouping_key:,
1529
+ # The maximum amount to charge each group
1530
+ maximum_charge:,
1531
+ # The minimum amount to charge each group, regardless of usage
1532
+ minimum_charge:,
1533
+ # The base price charged per group
1534
+ per_unit_rate:
1535
+ )
1536
+ end
1537
+
1538
+ sig do
1539
+ override.returns(
1540
+ {
1541
+ grouping_key: String,
1542
+ maximum_charge: String,
1543
+ minimum_charge: String,
1544
+ per_unit_rate: String
1545
+ }
1546
+ )
1547
+ end
1548
+ def to_hash
1549
+ end
1550
+ end
1551
+ end
1552
+
1553
+ class CumulativeGroupedAllocation < Orb::Internal::Type::BaseModel
1554
+ OrHash =
1555
+ T.type_alias do
1556
+ T.any(
1557
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation,
1558
+ Orb::Internal::AnyHash
1559
+ )
1560
+ end
1561
+
1562
+ # The cadence to bill for this price on.
1563
+ sig do
1564
+ returns(
1565
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::OrSymbol
1566
+ )
1567
+ end
1568
+ attr_accessor :cadence
1569
+
1570
+ # Configuration for cumulative_grouped_allocation pricing
1571
+ sig do
1572
+ returns(
1573
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig
1574
+ )
1575
+ end
1576
+ attr_reader :cumulative_grouped_allocation_config
1577
+
1578
+ sig do
1579
+ params(
1580
+ cumulative_grouped_allocation_config:
1581
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig::OrHash
1582
+ ).void
1583
+ end
1584
+ attr_writer :cumulative_grouped_allocation_config
1585
+
1586
+ # An ISO 4217 currency string for which this price is billed in.
1587
+ sig { returns(String) }
1588
+ attr_accessor :currency
1589
+
1590
+ # The id of the item the price will be associated with.
1591
+ sig { returns(String) }
1592
+ attr_accessor :item_id
1593
+
1594
+ # The pricing model type
1595
+ sig { returns(Symbol) }
1596
+ attr_accessor :model_type
1597
+
1598
+ # The name of the price.
1599
+ sig { returns(String) }
1600
+ attr_accessor :name
1601
+
1602
+ # The id of the billable metric for the price. Only needed if the price is
1603
+ # usage-based.
1604
+ sig { returns(T.nilable(String)) }
1605
+ attr_accessor :billable_metric_id
1606
+
1607
+ # If the Price represents a fixed cost, the price will be billed in-advance if
1608
+ # this is true, and in-arrears if this is false.
1609
+ sig { returns(T.nilable(T::Boolean)) }
1610
+ attr_accessor :billed_in_advance
1611
+
1612
+ # For custom cadence: specifies the duration of the billing period in days or
1613
+ # months.
1614
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
1615
+ attr_reader :billing_cycle_configuration
1616
+
1617
+ sig do
1618
+ params(
1619
+ billing_cycle_configuration:
1620
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
1621
+ ).void
1622
+ end
1623
+ attr_writer :billing_cycle_configuration
1624
+
1625
+ # The per unit conversion rate of the price currency to the invoicing currency.
1626
+ sig { returns(T.nilable(Float)) }
1627
+ attr_accessor :conversion_rate
1628
+
1629
+ # The configuration for the rate of the price currency to the invoicing currency.
1630
+ sig do
1631
+ returns(
1632
+ T.nilable(
1633
+ T.any(
1634
+ Orb::UnitConversionRateConfig,
1635
+ Orb::TieredConversionRateConfig
1636
+ )
1637
+ )
1638
+ )
1639
+ end
1640
+ attr_accessor :conversion_rate_config
1641
+
1642
+ # For dimensional price: specifies a price group and dimension values
1643
+ sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) }
1644
+ attr_reader :dimensional_price_configuration
1645
+
1646
+ sig do
1647
+ params(
1648
+ dimensional_price_configuration:
1649
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash)
1650
+ ).void
1651
+ end
1652
+ attr_writer :dimensional_price_configuration
1653
+
1654
+ # An alias for the price.
1655
+ sig { returns(T.nilable(String)) }
1656
+ attr_accessor :external_price_id
1657
+
1658
+ # If the Price represents a fixed cost, this represents the quantity of units
1659
+ # applied.
1660
+ sig { returns(T.nilable(Float)) }
1661
+ attr_accessor :fixed_price_quantity
1662
+
1663
+ # The property used to group this price on an invoice
1664
+ sig { returns(T.nilable(String)) }
1665
+ attr_accessor :invoice_grouping_key
1666
+
1667
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
1668
+ # If unspecified, a single invoice is produced per billing cycle.
1669
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
1670
+ attr_reader :invoicing_cycle_configuration
1671
+
1672
+ sig do
1673
+ params(
1674
+ invoicing_cycle_configuration:
1675
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
1676
+ ).void
1677
+ end
1678
+ attr_writer :invoicing_cycle_configuration
1679
+
1680
+ # The ID of the license type to associate with this price.
1681
+ sig { returns(T.nilable(String)) }
1682
+ attr_accessor :license_type_id
1683
+
1684
+ # User-specified key/value pairs for the resource. Individual keys can be removed
1685
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
1686
+ # by setting `metadata` to `null`.
1687
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
1688
+ attr_accessor :metadata
1689
+
1690
+ sig do
1691
+ params(
1692
+ cadence:
1693
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::OrSymbol,
1694
+ cumulative_grouped_allocation_config:
1695
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig::OrHash,
1696
+ currency: String,
1697
+ item_id: String,
1698
+ name: String,
1699
+ billable_metric_id: T.nilable(String),
1700
+ billed_in_advance: T.nilable(T::Boolean),
1701
+ billing_cycle_configuration:
1702
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
1703
+ conversion_rate: T.nilable(Float),
1704
+ conversion_rate_config:
1705
+ T.nilable(
1706
+ T.any(
1707
+ Orb::UnitConversionRateConfig::OrHash,
1708
+ Orb::TieredConversionRateConfig::OrHash
1709
+ )
1710
+ ),
1711
+ dimensional_price_configuration:
1712
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash),
1713
+ external_price_id: T.nilable(String),
1714
+ fixed_price_quantity: T.nilable(Float),
1715
+ invoice_grouping_key: T.nilable(String),
1716
+ invoicing_cycle_configuration:
1717
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
1718
+ license_type_id: T.nilable(String),
1719
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
1720
+ model_type: Symbol
1721
+ ).returns(T.attached_class)
1722
+ end
1723
+ def self.new(
1724
+ # The cadence to bill for this price on.
1725
+ cadence:,
1726
+ # Configuration for cumulative_grouped_allocation pricing
1727
+ cumulative_grouped_allocation_config:,
1728
+ # An ISO 4217 currency string for which this price is billed in.
1729
+ currency:,
1730
+ # The id of the item the price will be associated with.
1731
+ item_id:,
1732
+ # The name of the price.
1733
+ name:,
1734
+ # The id of the billable metric for the price. Only needed if the price is
1735
+ # usage-based.
1736
+ billable_metric_id: nil,
1737
+ # If the Price represents a fixed cost, the price will be billed in-advance if
1738
+ # this is true, and in-arrears if this is false.
1739
+ billed_in_advance: nil,
1740
+ # For custom cadence: specifies the duration of the billing period in days or
1741
+ # months.
1742
+ billing_cycle_configuration: nil,
1743
+ # The per unit conversion rate of the price currency to the invoicing currency.
1744
+ conversion_rate: nil,
1745
+ # The configuration for the rate of the price currency to the invoicing currency.
1746
+ conversion_rate_config: nil,
1747
+ # For dimensional price: specifies a price group and dimension values
1748
+ dimensional_price_configuration: nil,
1749
+ # An alias for the price.
1750
+ external_price_id: nil,
1751
+ # If the Price represents a fixed cost, this represents the quantity of units
1752
+ # applied.
1753
+ fixed_price_quantity: nil,
1754
+ # The property used to group this price on an invoice
1755
+ invoice_grouping_key: nil,
1756
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
1757
+ # If unspecified, a single invoice is produced per billing cycle.
1758
+ invoicing_cycle_configuration: nil,
1759
+ # The ID of the license type to associate with this price.
1760
+ license_type_id: nil,
1761
+ # User-specified key/value pairs for the resource. Individual keys can be removed
1762
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
1763
+ # by setting `metadata` to `null`.
1764
+ metadata: nil,
1765
+ # The pricing model type
1766
+ model_type: :cumulative_grouped_allocation
1767
+ )
1768
+ end
1769
+
1770
+ sig do
1771
+ override.returns(
1772
+ {
1773
+ cadence:
1774
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::OrSymbol,
1775
+ cumulative_grouped_allocation_config:
1776
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig,
1777
+ currency: String,
1778
+ item_id: String,
1779
+ model_type: Symbol,
1780
+ name: String,
1781
+ billable_metric_id: T.nilable(String),
1782
+ billed_in_advance: T.nilable(T::Boolean),
1783
+ billing_cycle_configuration:
1784
+ T.nilable(Orb::NewBillingCycleConfiguration),
1785
+ conversion_rate: T.nilable(Float),
1786
+ conversion_rate_config:
1787
+ T.nilable(
1788
+ T.any(
1789
+ Orb::UnitConversionRateConfig,
1790
+ Orb::TieredConversionRateConfig
1791
+ )
1792
+ ),
1793
+ dimensional_price_configuration:
1794
+ T.nilable(Orb::NewDimensionalPriceConfiguration),
1795
+ external_price_id: T.nilable(String),
1796
+ fixed_price_quantity: T.nilable(Float),
1797
+ invoice_grouping_key: T.nilable(String),
1798
+ invoicing_cycle_configuration:
1799
+ T.nilable(Orb::NewBillingCycleConfiguration),
1800
+ license_type_id: T.nilable(String),
1801
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])
1802
+ }
1803
+ )
1804
+ end
1805
+ def to_hash
1806
+ end
1807
+
1808
+ # The cadence to bill for this price on.
1809
+ module Cadence
1810
+ extend Orb::Internal::Type::Enum
1811
+
1812
+ TaggedSymbol =
1813
+ T.type_alias do
1814
+ T.all(
1815
+ Symbol,
1816
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence
1817
+ )
1818
+ end
1819
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1820
+
1821
+ ANNUAL =
1822
+ T.let(
1823
+ :annual,
1824
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
1825
+ )
1826
+ SEMI_ANNUAL =
1827
+ T.let(
1828
+ :semi_annual,
1829
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
1830
+ )
1831
+ MONTHLY =
1832
+ T.let(
1833
+ :monthly,
1834
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
1835
+ )
1836
+ QUARTERLY =
1837
+ T.let(
1838
+ :quarterly,
1839
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
1840
+ )
1841
+ ONE_TIME =
1842
+ T.let(
1843
+ :one_time,
1844
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
1845
+ )
1846
+ CUSTOM =
1847
+ T.let(
1848
+ :custom,
1849
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
1850
+ )
1851
+
1852
+ sig do
1853
+ override.returns(
1854
+ T::Array[
1855
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
1856
+ ]
1857
+ )
1858
+ end
1859
+ def self.values
1860
+ end
1861
+ end
1862
+
1863
+ class CumulativeGroupedAllocationConfig < Orb::Internal::Type::BaseModel
1864
+ OrHash =
1865
+ T.type_alias do
1866
+ T.any(
1867
+ Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig,
1868
+ Orb::Internal::AnyHash
1869
+ )
1870
+ end
1871
+
1872
+ # The overall allocation across all groups
1873
+ sig { returns(String) }
1874
+ attr_accessor :cumulative_allocation
1875
+
1876
+ # The allocation per individual group
1877
+ sig { returns(String) }
1878
+ attr_accessor :group_allocation
1879
+
1880
+ # The event property used to group usage before applying allocations
1881
+ sig { returns(String) }
1882
+ attr_accessor :grouping_key
1883
+
1884
+ # The amount to charge for each unit outside of the allocation
1885
+ sig { returns(String) }
1886
+ attr_accessor :unit_amount
1887
+
1888
+ # Configuration for cumulative_grouped_allocation pricing
1889
+ sig do
1890
+ params(
1891
+ cumulative_allocation: String,
1892
+ group_allocation: String,
1893
+ grouping_key: String,
1894
+ unit_amount: String
1895
+ ).returns(T.attached_class)
1896
+ end
1897
+ def self.new(
1898
+ # The overall allocation across all groups
1899
+ cumulative_allocation:,
1900
+ # The allocation per individual group
1901
+ group_allocation:,
1902
+ # The event property used to group usage before applying allocations
1903
+ grouping_key:,
1904
+ # The amount to charge for each unit outside of the allocation
1905
+ unit_amount:
1906
+ )
1907
+ end
1908
+
1909
+ sig do
1910
+ override.returns(
1911
+ {
1912
+ cumulative_allocation: String,
1913
+ group_allocation: String,
1914
+ grouping_key: String,
1915
+ unit_amount: String
1916
+ }
1917
+ )
1918
+ end
1919
+ def to_hash
1920
+ end
1921
+ end
1922
+ end
1923
+
1924
+ class DailyCreditAllowance < Orb::Internal::Type::BaseModel
1925
+ OrHash =
1926
+ T.type_alias do
1927
+ T.any(
1928
+ Orb::PriceCreateParams::Body::DailyCreditAllowance,
648
1929
  Orb::Internal::AnyHash
649
1930
  )
650
1931
  end
@@ -652,7 +1933,7 @@ module Orb
652
1933
  # The cadence to bill for this price on.
653
1934
  sig do
654
1935
  returns(
655
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::OrSymbol
1936
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::Cadence::OrSymbol
656
1937
  )
657
1938
  end
658
1939
  attr_accessor :cadence
@@ -661,21 +1942,21 @@ module Orb
661
1942
  sig { returns(String) }
662
1943
  attr_accessor :currency
663
1944
 
664
- # Configuration for grouped_with_min_max_thresholds pricing
1945
+ # Configuration for daily_credit_allowance pricing
665
1946
  sig do
666
1947
  returns(
667
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig
1948
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::DailyCreditAllowanceConfig
668
1949
  )
669
1950
  end
670
- attr_reader :grouped_with_min_max_thresholds_config
1951
+ attr_reader :daily_credit_allowance_config
671
1952
 
672
1953
  sig do
673
1954
  params(
674
- grouped_with_min_max_thresholds_config:
675
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash
1955
+ daily_credit_allowance_config:
1956
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::DailyCreditAllowanceConfig::OrHash
676
1957
  ).void
677
1958
  end
678
- attr_writer :grouped_with_min_max_thresholds_config
1959
+ attr_writer :daily_credit_allowance_config
679
1960
 
680
1961
  # The id of the item the price will be associated with.
681
1962
  sig { returns(String) }
@@ -780,10 +2061,10 @@ module Orb
780
2061
  sig do
781
2062
  params(
782
2063
  cadence:
783
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::OrSymbol,
2064
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::Cadence::OrSymbol,
784
2065
  currency: String,
785
- grouped_with_min_max_thresholds_config:
786
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash,
2066
+ daily_credit_allowance_config:
2067
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::DailyCreditAllowanceConfig::OrHash,
787
2068
  item_id: String,
788
2069
  name: String,
789
2070
  billable_metric_id: T.nilable(String),
@@ -815,8 +2096,8 @@ module Orb
815
2096
  cadence:,
816
2097
  # An ISO 4217 currency string for which this price is billed in.
817
2098
  currency:,
818
- # Configuration for grouped_with_min_max_thresholds pricing
819
- grouped_with_min_max_thresholds_config:,
2099
+ # Configuration for daily_credit_allowance pricing
2100
+ daily_credit_allowance_config:,
820
2101
  # The id of the item the price will be associated with.
821
2102
  item_id:,
822
2103
  # The name of the price.
@@ -853,7 +2134,7 @@ module Orb
853
2134
  # by setting `metadata` to `null`.
854
2135
  metadata: nil,
855
2136
  # The pricing model type
856
- model_type: :grouped_with_min_max_thresholds
2137
+ model_type: :daily_credit_allowance
857
2138
  )
858
2139
  end
859
2140
 
@@ -861,10 +2142,10 @@ module Orb
861
2142
  override.returns(
862
2143
  {
863
2144
  cadence:
864
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::OrSymbol,
2145
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::Cadence::OrSymbol,
865
2146
  currency: String,
866
- grouped_with_min_max_thresholds_config:
867
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig,
2147
+ daily_credit_allowance_config:
2148
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::DailyCreditAllowanceConfig,
868
2149
  item_id: String,
869
2150
  model_type: Symbol,
870
2151
  name: String,
@@ -903,7 +2184,7 @@ module Orb
903
2184
  T.type_alias do
904
2185
  T.all(
905
2186
  Symbol,
906
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence
2187
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::Cadence
907
2188
  )
908
2189
  end
909
2190
  OrSymbol = T.type_alias { T.any(Symbol, String) }
@@ -911,38 +2192,38 @@ module Orb
911
2192
  ANNUAL =
912
2193
  T.let(
913
2194
  :annual,
914
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
2195
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::Cadence::TaggedSymbol
915
2196
  )
916
2197
  SEMI_ANNUAL =
917
2198
  T.let(
918
2199
  :semi_annual,
919
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
2200
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::Cadence::TaggedSymbol
920
2201
  )
921
2202
  MONTHLY =
922
2203
  T.let(
923
2204
  :monthly,
924
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
2205
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::Cadence::TaggedSymbol
925
2206
  )
926
2207
  QUARTERLY =
927
2208
  T.let(
928
2209
  :quarterly,
929
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
2210
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::Cadence::TaggedSymbol
930
2211
  )
931
2212
  ONE_TIME =
932
2213
  T.let(
933
2214
  :one_time,
934
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
2215
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::Cadence::TaggedSymbol
935
2216
  )
936
2217
  CUSTOM =
937
2218
  T.let(
938
2219
  :custom,
939
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
2220
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::Cadence::TaggedSymbol
940
2221
  )
941
2222
 
942
2223
  sig do
943
2224
  override.returns(
944
2225
  T::Array[
945
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol
2226
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::Cadence::TaggedSymbol
946
2227
  ]
947
2228
  )
948
2229
  end
@@ -950,72 +2231,144 @@ module Orb
950
2231
  end
951
2232
  end
952
2233
 
953
- class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel
2234
+ class DailyCreditAllowanceConfig < Orb::Internal::Type::BaseModel
954
2235
  OrHash =
955
2236
  T.type_alias do
956
2237
  T.any(
957
- Orb::PriceCreateParams::Body::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig,
2238
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::DailyCreditAllowanceConfig,
958
2239
  Orb::Internal::AnyHash
959
2240
  )
960
2241
  end
961
2242
 
962
- # The event property used to group before applying thresholds
2243
+ # Credits granted per day. Lose-it-or-use-it; does not roll over.
963
2244
  sig { returns(String) }
964
- attr_accessor :grouping_key
2245
+ attr_accessor :daily_allowance
965
2246
 
966
- # The maximum amount to charge each group
2247
+ # Default per-unit credit rate for any usage not bucketed into a specified
2248
+ # matrix_value
967
2249
  sig { returns(String) }
968
- attr_accessor :maximum_charge
2250
+ attr_accessor :default_unit_amount
969
2251
 
970
- # The minimum amount to charge each group, regardless of usage
971
- sig { returns(String) }
972
- attr_accessor :minimum_charge
2252
+ # One or two event property values to evaluate matrix groups by
2253
+ sig { returns(T::Array[T.nilable(String)]) }
2254
+ attr_accessor :dimensions
973
2255
 
974
- # The base price charged per group
2256
+ # Event property whose value identifies the day bucket the event belongs to (e.g.
2257
+ # 'event_day' set to an ISO date string in the customer's timezone). The allowance
2258
+ # resets per distinct value of this property.
975
2259
  sig { returns(String) }
976
- attr_accessor :per_unit_rate
2260
+ attr_accessor :event_day_property
977
2261
 
978
- # Configuration for grouped_with_min_max_thresholds pricing
2262
+ # Per-dimension credit rates
2263
+ sig do
2264
+ returns(
2265
+ T::Array[
2266
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::DailyCreditAllowanceConfig::MatrixValue
2267
+ ]
2268
+ )
2269
+ end
2270
+ attr_accessor :matrix_values
2271
+
2272
+ # Configuration for daily_credit_allowance pricing
979
2273
  sig do
980
2274
  params(
981
- grouping_key: String,
982
- maximum_charge: String,
983
- minimum_charge: String,
984
- per_unit_rate: String
2275
+ daily_allowance: String,
2276
+ default_unit_amount: String,
2277
+ dimensions: T::Array[T.nilable(String)],
2278
+ event_day_property: String,
2279
+ matrix_values:
2280
+ T::Array[
2281
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::DailyCreditAllowanceConfig::MatrixValue::OrHash
2282
+ ]
985
2283
  ).returns(T.attached_class)
986
2284
  end
987
2285
  def self.new(
988
- # The event property used to group before applying thresholds
989
- grouping_key:,
990
- # The maximum amount to charge each group
991
- maximum_charge:,
992
- # The minimum amount to charge each group, regardless of usage
993
- minimum_charge:,
994
- # The base price charged per group
995
- per_unit_rate:
2286
+ # Credits granted per day. Lose-it-or-use-it; does not roll over.
2287
+ daily_allowance:,
2288
+ # Default per-unit credit rate for any usage not bucketed into a specified
2289
+ # matrix_value
2290
+ default_unit_amount:,
2291
+ # One or two event property values to evaluate matrix groups by
2292
+ dimensions:,
2293
+ # Event property whose value identifies the day bucket the event belongs to (e.g.
2294
+ # 'event_day' set to an ISO date string in the customer's timezone). The allowance
2295
+ # resets per distinct value of this property.
2296
+ event_day_property:,
2297
+ # Per-dimension credit rates
2298
+ matrix_values:
996
2299
  )
997
2300
  end
998
2301
 
999
2302
  sig do
1000
2303
  override.returns(
1001
2304
  {
1002
- grouping_key: String,
1003
- maximum_charge: String,
1004
- minimum_charge: String,
1005
- per_unit_rate: String
2305
+ daily_allowance: String,
2306
+ default_unit_amount: String,
2307
+ dimensions: T::Array[T.nilable(String)],
2308
+ event_day_property: String,
2309
+ matrix_values:
2310
+ T::Array[
2311
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::DailyCreditAllowanceConfig::MatrixValue
2312
+ ]
1006
2313
  }
1007
2314
  )
1008
2315
  end
1009
2316
  def to_hash
1010
2317
  end
2318
+
2319
+ class MatrixValue < Orb::Internal::Type::BaseModel
2320
+ OrHash =
2321
+ T.type_alias do
2322
+ T.any(
2323
+ Orb::PriceCreateParams::Body::DailyCreditAllowance::DailyCreditAllowanceConfig::MatrixValue,
2324
+ Orb::Internal::AnyHash
2325
+ )
2326
+ end
2327
+
2328
+ # One or two matrix keys to filter usage to this value by. For example, ["model"]
2329
+ # could be used to apply a different credit rate to each AI model.
2330
+ sig { returns(T::Array[T.nilable(String)]) }
2331
+ attr_accessor :dimension_values
2332
+
2333
+ # Credits charged per unit of usage matching the specified dimension_values
2334
+ sig { returns(String) }
2335
+ attr_accessor :unit_amount
2336
+
2337
+ # Per-dimension credit price for the daily credit allowance model.
2338
+ sig do
2339
+ params(
2340
+ dimension_values: T::Array[T.nilable(String)],
2341
+ unit_amount: String
2342
+ ).returns(T.attached_class)
2343
+ end
2344
+ def self.new(
2345
+ # One or two matrix keys to filter usage to this value by. For example, ["model"]
2346
+ # could be used to apply a different credit rate to each AI model.
2347
+ dimension_values:,
2348
+ # Credits charged per unit of usage matching the specified dimension_values
2349
+ unit_amount:
2350
+ )
2351
+ end
2352
+
2353
+ sig do
2354
+ override.returns(
2355
+ {
2356
+ dimension_values: T::Array[T.nilable(String)],
2357
+ unit_amount: String
2358
+ }
2359
+ )
2360
+ end
2361
+ def to_hash
2362
+ end
2363
+ end
1011
2364
  end
1012
2365
  end
1013
2366
 
1014
- class CumulativeGroupedAllocation < Orb::Internal::Type::BaseModel
2367
+ class MeteredAllowance < Orb::Internal::Type::BaseModel
1015
2368
  OrHash =
1016
2369
  T.type_alias do
1017
2370
  T.any(
1018
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation,
2371
+ Orb::PriceCreateParams::Body::MeteredAllowance,
1019
2372
  Orb::Internal::AnyHash
1020
2373
  )
1021
2374
  end
@@ -1023,34 +2376,34 @@ module Orb
1023
2376
  # The cadence to bill for this price on.
1024
2377
  sig do
1025
2378
  returns(
1026
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::OrSymbol
2379
+ Orb::PriceCreateParams::Body::MeteredAllowance::Cadence::OrSymbol
1027
2380
  )
1028
2381
  end
1029
2382
  attr_accessor :cadence
1030
2383
 
1031
- # Configuration for cumulative_grouped_allocation pricing
2384
+ # An ISO 4217 currency string for which this price is billed in.
2385
+ sig { returns(String) }
2386
+ attr_accessor :currency
2387
+
2388
+ # The id of the item the price will be associated with.
2389
+ sig { returns(String) }
2390
+ attr_accessor :item_id
2391
+
2392
+ # Configuration for metered_allowance pricing
1032
2393
  sig do
1033
2394
  returns(
1034
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig
2395
+ Orb::PriceCreateParams::Body::MeteredAllowance::MeteredAllowanceConfig
1035
2396
  )
1036
2397
  end
1037
- attr_reader :cumulative_grouped_allocation_config
2398
+ attr_reader :metered_allowance_config
1038
2399
 
1039
2400
  sig do
1040
2401
  params(
1041
- cumulative_grouped_allocation_config:
1042
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig::OrHash
2402
+ metered_allowance_config:
2403
+ Orb::PriceCreateParams::Body::MeteredAllowance::MeteredAllowanceConfig::OrHash
1043
2404
  ).void
1044
2405
  end
1045
- attr_writer :cumulative_grouped_allocation_config
1046
-
1047
- # An ISO 4217 currency string for which this price is billed in.
1048
- sig { returns(String) }
1049
- attr_accessor :currency
1050
-
1051
- # The id of the item the price will be associated with.
1052
- sig { returns(String) }
1053
- attr_accessor :item_id
2406
+ attr_writer :metered_allowance_config
1054
2407
 
1055
2408
  # The pricing model type
1056
2409
  sig { returns(Symbol) }
@@ -1151,11 +2504,11 @@ module Orb
1151
2504
  sig do
1152
2505
  params(
1153
2506
  cadence:
1154
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::OrSymbol,
1155
- cumulative_grouped_allocation_config:
1156
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig::OrHash,
2507
+ Orb::PriceCreateParams::Body::MeteredAllowance::Cadence::OrSymbol,
1157
2508
  currency: String,
1158
2509
  item_id: String,
2510
+ metered_allowance_config:
2511
+ Orb::PriceCreateParams::Body::MeteredAllowance::MeteredAllowanceConfig::OrHash,
1159
2512
  name: String,
1160
2513
  billable_metric_id: T.nilable(String),
1161
2514
  billed_in_advance: T.nilable(T::Boolean),
@@ -1184,12 +2537,12 @@ module Orb
1184
2537
  def self.new(
1185
2538
  # The cadence to bill for this price on.
1186
2539
  cadence:,
1187
- # Configuration for cumulative_grouped_allocation pricing
1188
- cumulative_grouped_allocation_config:,
1189
2540
  # An ISO 4217 currency string for which this price is billed in.
1190
2541
  currency:,
1191
2542
  # The id of the item the price will be associated with.
1192
2543
  item_id:,
2544
+ # Configuration for metered_allowance pricing
2545
+ metered_allowance_config:,
1193
2546
  # The name of the price.
1194
2547
  name:,
1195
2548
  # The id of the billable metric for the price. Only needed if the price is
@@ -1224,7 +2577,7 @@ module Orb
1224
2577
  # by setting `metadata` to `null`.
1225
2578
  metadata: nil,
1226
2579
  # The pricing model type
1227
- model_type: :cumulative_grouped_allocation
2580
+ model_type: :metered_allowance
1228
2581
  )
1229
2582
  end
1230
2583
 
@@ -1232,11 +2585,11 @@ module Orb
1232
2585
  override.returns(
1233
2586
  {
1234
2587
  cadence:
1235
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::OrSymbol,
1236
- cumulative_grouped_allocation_config:
1237
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig,
2588
+ Orb::PriceCreateParams::Body::MeteredAllowance::Cadence::OrSymbol,
1238
2589
  currency: String,
1239
2590
  item_id: String,
2591
+ metered_allowance_config:
2592
+ Orb::PriceCreateParams::Body::MeteredAllowance::MeteredAllowanceConfig,
1240
2593
  model_type: Symbol,
1241
2594
  name: String,
1242
2595
  billable_metric_id: T.nilable(String),
@@ -1274,7 +2627,7 @@ module Orb
1274
2627
  T.type_alias do
1275
2628
  T.all(
1276
2629
  Symbol,
1277
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence
2630
+ Orb::PriceCreateParams::Body::MeteredAllowance::Cadence
1278
2631
  )
1279
2632
  end
1280
2633
  OrSymbol = T.type_alias { T.any(Symbol, String) }
@@ -1282,38 +2635,38 @@ module Orb
1282
2635
  ANNUAL =
1283
2636
  T.let(
1284
2637
  :annual,
1285
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2638
+ Orb::PriceCreateParams::Body::MeteredAllowance::Cadence::TaggedSymbol
1286
2639
  )
1287
2640
  SEMI_ANNUAL =
1288
2641
  T.let(
1289
2642
  :semi_annual,
1290
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2643
+ Orb::PriceCreateParams::Body::MeteredAllowance::Cadence::TaggedSymbol
1291
2644
  )
1292
2645
  MONTHLY =
1293
2646
  T.let(
1294
2647
  :monthly,
1295
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2648
+ Orb::PriceCreateParams::Body::MeteredAllowance::Cadence::TaggedSymbol
1296
2649
  )
1297
2650
  QUARTERLY =
1298
2651
  T.let(
1299
2652
  :quarterly,
1300
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2653
+ Orb::PriceCreateParams::Body::MeteredAllowance::Cadence::TaggedSymbol
1301
2654
  )
1302
2655
  ONE_TIME =
1303
2656
  T.let(
1304
2657
  :one_time,
1305
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2658
+ Orb::PriceCreateParams::Body::MeteredAllowance::Cadence::TaggedSymbol
1306
2659
  )
1307
2660
  CUSTOM =
1308
2661
  T.let(
1309
2662
  :custom,
1310
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2663
+ Orb::PriceCreateParams::Body::MeteredAllowance::Cadence::TaggedSymbol
1311
2664
  )
1312
2665
 
1313
2666
  sig do
1314
2667
  override.returns(
1315
2668
  T::Array[
1316
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::Cadence::TaggedSymbol
2669
+ Orb::PriceCreateParams::Body::MeteredAllowance::Cadence::TaggedSymbol
1317
2670
  ]
1318
2671
  )
1319
2672
  end
@@ -1321,59 +2674,91 @@ module Orb
1321
2674
  end
1322
2675
  end
1323
2676
 
1324
- class CumulativeGroupedAllocationConfig < Orb::Internal::Type::BaseModel
2677
+ class MeteredAllowanceConfig < Orb::Internal::Type::BaseModel
1325
2678
  OrHash =
1326
2679
  T.type_alias do
1327
2680
  T.any(
1328
- Orb::PriceCreateParams::Body::CumulativeGroupedAllocation::CumulativeGroupedAllocationConfig,
2681
+ Orb::PriceCreateParams::Body::MeteredAllowance::MeteredAllowanceConfig,
1329
2682
  Orb::Internal::AnyHash
1330
2683
  )
1331
2684
  end
1332
2685
 
1333
- # The overall allocation across all groups
2686
+ # The grouping_key value whose summed quantity represents the allowance for this
2687
+ # period (e.g. 'storage_snapshot' emitting 3 × avg storage). Capped at consumption
2688
+ # — credit can never exceed actual usage.
1334
2689
  sig { returns(String) }
1335
- attr_accessor :cumulative_allocation
2690
+ attr_accessor :allowance_grouping_value
1336
2691
 
1337
- # The allocation per individual group
2692
+ # The grouping_key value whose summed quantity represents consumption (e.g.
2693
+ # 'download'). Charged at unit_amount.
1338
2694
  sig { returns(String) }
1339
- attr_accessor :group_allocation
2695
+ attr_accessor :consumption_grouping_value
1340
2696
 
1341
- # The event property used to group usage before applying allocations
2697
+ # Event property used to partition the metric into consumption and allowance
2698
+ # quantities (e.g. 'event_name'). The metric is queried with this key and the two
2699
+ # values below select which partition is which.
1342
2700
  sig { returns(String) }
1343
2701
  attr_accessor :grouping_key
1344
2702
 
1345
- # The amount to charge for each unit outside of the allocation
2703
+ # Per-unit price applied to gross consumption and to the allowance credit.
1346
2704
  sig { returns(String) }
1347
2705
  attr_accessor :unit_amount
1348
2706
 
1349
- # Configuration for cumulative_grouped_allocation pricing
2707
+ # Sub-line label for the credit row (e.g. 'Up to 3x free egress').
2708
+ sig { returns(T.nilable(String)) }
2709
+ attr_reader :allowance_display_name
2710
+
2711
+ sig { params(allowance_display_name: String).void }
2712
+ attr_writer :allowance_display_name
2713
+
2714
+ # Sub-line label for the gross consumption row (e.g. 'bytes gotten').
2715
+ sig { returns(T.nilable(String)) }
2716
+ attr_reader :consumption_display_name
2717
+
2718
+ sig { params(consumption_display_name: String).void }
2719
+ attr_writer :consumption_display_name
2720
+
2721
+ # Configuration for metered_allowance pricing
1350
2722
  sig do
1351
2723
  params(
1352
- cumulative_allocation: String,
1353
- group_allocation: String,
2724
+ allowance_grouping_value: String,
2725
+ consumption_grouping_value: String,
1354
2726
  grouping_key: String,
1355
- unit_amount: String
2727
+ unit_amount: String,
2728
+ allowance_display_name: String,
2729
+ consumption_display_name: String
1356
2730
  ).returns(T.attached_class)
1357
2731
  end
1358
2732
  def self.new(
1359
- # The overall allocation across all groups
1360
- cumulative_allocation:,
1361
- # The allocation per individual group
1362
- group_allocation:,
1363
- # The event property used to group usage before applying allocations
2733
+ # The grouping_key value whose summed quantity represents the allowance for this
2734
+ # period (e.g. 'storage_snapshot' emitting 3 × avg storage). Capped at consumption
2735
+ # credit can never exceed actual usage.
2736
+ allowance_grouping_value:,
2737
+ # The grouping_key value whose summed quantity represents consumption (e.g.
2738
+ # 'download'). Charged at unit_amount.
2739
+ consumption_grouping_value:,
2740
+ # Event property used to partition the metric into consumption and allowance
2741
+ # quantities (e.g. 'event_name'). The metric is queried with this key and the two
2742
+ # values below select which partition is which.
1364
2743
  grouping_key:,
1365
- # The amount to charge for each unit outside of the allocation
1366
- unit_amount:
2744
+ # Per-unit price applied to gross consumption and to the allowance credit.
2745
+ unit_amount:,
2746
+ # Sub-line label for the credit row (e.g. 'Up to 3x free egress').
2747
+ allowance_display_name: nil,
2748
+ # Sub-line label for the gross consumption row (e.g. 'bytes gotten').
2749
+ consumption_display_name: nil
1367
2750
  )
1368
2751
  end
1369
2752
 
1370
2753
  sig do
1371
2754
  override.returns(
1372
2755
  {
1373
- cumulative_allocation: String,
1374
- group_allocation: String,
2756
+ allowance_grouping_value: String,
2757
+ consumption_grouping_value: String,
1375
2758
  grouping_key: String,
1376
- unit_amount: String
2759
+ unit_amount: String,
2760
+ allowance_display_name: String,
2761
+ consumption_display_name: String
1377
2762
  }
1378
2763
  )
1379
2764
  end
@@ -1691,19 +3076,60 @@ module Orb
1691
3076
  )
1692
3077
  end
1693
3078
 
1694
- # What percent of the component subtotals to charge
3079
+ # Fraction of the component subtotals to charge (0 < percent <= 1).
1695
3080
  sig { returns(Float) }
1696
3081
  attr_accessor :percent
1697
3082
 
3083
+ # Maximum amount to charge. If unset, the fee has no upper bound.
3084
+ sig { returns(T.nilable(String)) }
3085
+ attr_accessor :maximum_amount
3086
+
3087
+ # Minimum amount to charge. If unset, the fee is bounded below by 0.
3088
+ sig { returns(T.nilable(String)) }
3089
+ attr_accessor :minimum_amount
3090
+
3091
+ # If true, the minimum_amount is prorated based on the service period. The
3092
+ # maximum_amount is an absolute cap (never prorated), and the percent applied to
3093
+ # upstream subtotals is never prorated either.
3094
+ sig { returns(T.nilable(T::Boolean)) }
3095
+ attr_reader :prorated
3096
+
3097
+ sig { params(prorated: T::Boolean).void }
3098
+ attr_writer :prorated
3099
+
1698
3100
  # Configuration for percent pricing
1699
- sig { params(percent: Float).returns(T.attached_class) }
3101
+ sig do
3102
+ params(
3103
+ percent: Float,
3104
+ maximum_amount: T.nilable(String),
3105
+ minimum_amount: T.nilable(String),
3106
+ prorated: T::Boolean
3107
+ ).returns(T.attached_class)
3108
+ end
1700
3109
  def self.new(
1701
- # What percent of the component subtotals to charge
1702
- percent:
3110
+ # Fraction of the component subtotals to charge (0 < percent <= 1).
3111
+ percent:,
3112
+ # Maximum amount to charge. If unset, the fee has no upper bound.
3113
+ maximum_amount: nil,
3114
+ # Minimum amount to charge. If unset, the fee is bounded below by 0.
3115
+ minimum_amount: nil,
3116
+ # If true, the minimum_amount is prorated based on the service period. The
3117
+ # maximum_amount is an absolute cap (never prorated), and the percent applied to
3118
+ # upstream subtotals is never prorated either.
3119
+ prorated: nil
1703
3120
  )
1704
3121
  end
1705
3122
 
1706
- sig { override.returns({ percent: Float }) }
3123
+ sig do
3124
+ override.returns(
3125
+ {
3126
+ percent: Float,
3127
+ maximum_amount: T.nilable(String),
3128
+ minimum_amount: T.nilable(String),
3129
+ prorated: T::Boolean
3130
+ }
3131
+ )
3132
+ end
1707
3133
  def to_hash
1708
3134
  end
1709
3135
  end