orb-billing 1.14.0 → 1.16.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 (351) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +14 -0
  5. data/lib/orb/internal/transport/base_client.rb +5 -0
  6. data/lib/orb/internal/type/union.rb +13 -27
  7. data/lib/orb/models/accounting_provider_config.rb +14 -3
  8. data/lib/orb/models/adjustment_interval.rb +185 -3
  9. data/lib/orb/models/alert.rb +105 -1
  10. data/lib/orb/models/alert_create_for_subscription_params.rb +120 -7
  11. data/lib/orb/models/alert_update_params.rb +113 -1
  12. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +2419 -17109
  13. data/lib/orb/models/beta_create_plan_version_params.rb +2361 -16947
  14. data/lib/orb/models/billable_metric.rb +10 -1
  15. data/lib/orb/models/changed_subscription_resources.rb +200 -10
  16. data/lib/orb/models/conversion_rate_config.rb +18 -0
  17. data/lib/orb/models/credit_block_list_invoices_response.rb +192 -1
  18. data/lib/orb/models/credit_block_retrieve_response.rb +185 -1
  19. data/lib/orb/models/customer.rb +111 -4
  20. data/lib/orb/models/customer_create_params.rb +6 -1
  21. data/lib/orb/models/customer_tax_id.rb +15 -1
  22. data/lib/orb/models/customer_update_by_external_id_params.rb +16 -2
  23. data/lib/orb/models/customer_update_params.rb +16 -2
  24. data/lib/orb/models/customers/credit_list_by_external_id_response.rb +192 -1
  25. data/lib/orb/models/customers/credit_list_response.rb +189 -1
  26. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +4 -4
  27. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +4 -4
  28. data/lib/orb/models/dimensional_price_group.rb +1 -1
  29. data/lib/orb/models/discount.rb +145 -1
  30. data/lib/orb/models/event_ingest_params.rb +5 -2
  31. data/lib/orb/models/invoice.rb +198 -10
  32. data/lib/orb/models/invoice_create_params.rb +6 -5
  33. data/lib/orb/models/invoice_fetch_upcoming_response.rb +200 -10
  34. data/lib/orb/models/invoice_issue_summary_response.rb +9 -3
  35. data/lib/orb/models/invoice_level_discount.rb +145 -1
  36. data/lib/orb/models/invoice_line_item_create_response.rb +189 -5
  37. data/lib/orb/models/invoice_list_summary_response.rb +9 -3
  38. data/lib/orb/models/licenses/external_license_get_usage_params.rb +3 -3
  39. data/lib/orb/models/licenses/usage_get_all_usage_params.rb +3 -3
  40. data/lib/orb/models/licenses/usage_get_usage_params.rb +3 -3
  41. data/lib/orb/models/mutated_subscription.rb +169 -4
  42. data/lib/orb/models/new_allocation_price.rb +11 -1
  43. data/lib/orb/models/new_floating_bulk_price.rb +1 -3
  44. data/lib/orb/models/new_floating_bulk_with_proration_price.rb +1 -3
  45. data/lib/orb/models/new_floating_cumulative_grouped_bulk_price.rb +1 -3
  46. data/lib/orb/models/new_floating_grouped_allocation_price.rb +1 -3
  47. data/lib/orb/models/new_floating_grouped_tiered_package_price.rb +1 -3
  48. data/lib/orb/models/new_floating_grouped_tiered_price.rb +1 -3
  49. data/lib/orb/models/new_floating_grouped_with_metered_minimum_price.rb +1 -3
  50. data/lib/orb/models/new_floating_grouped_with_prorated_minimum_price.rb +1 -3
  51. data/lib/orb/models/new_floating_matrix_price.rb +1 -3
  52. data/lib/orb/models/new_floating_matrix_with_allocation_price.rb +1 -3
  53. data/lib/orb/models/new_floating_matrix_with_display_name_price.rb +1 -3
  54. data/lib/orb/models/new_floating_max_group_tiered_package_price.rb +1 -3
  55. data/lib/orb/models/new_floating_minimum_composite_price.rb +1 -3
  56. data/lib/orb/models/new_floating_package_price.rb +1 -3
  57. data/lib/orb/models/new_floating_package_with_allocation_price.rb +1 -3
  58. data/lib/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rb +1 -3
  59. data/lib/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rb +1 -3
  60. data/lib/orb/models/new_floating_threshold_total_amount_price.rb +1 -3
  61. data/lib/orb/models/new_floating_tiered_package_price.rb +1 -3
  62. data/lib/orb/models/new_floating_tiered_package_with_minimum_price.rb +1 -3
  63. data/lib/orb/models/new_floating_tiered_price.rb +1 -3
  64. data/lib/orb/models/new_floating_tiered_with_minimum_price.rb +1 -3
  65. data/lib/orb/models/new_floating_tiered_with_proration_price.rb +1 -3
  66. data/lib/orb/models/new_floating_unit_price.rb +1 -3
  67. data/lib/orb/models/new_floating_unit_with_percent_price.rb +1 -3
  68. data/lib/orb/models/new_floating_unit_with_proration_price.rb +1 -3
  69. data/lib/orb/models/new_plan_bulk_price.rb +1 -1
  70. data/lib/orb/models/new_plan_bulk_with_proration_price.rb +1 -3
  71. data/lib/orb/models/new_plan_cumulative_grouped_bulk_price.rb +1 -3
  72. data/lib/orb/models/new_plan_grouped_allocation_price.rb +1 -3
  73. data/lib/orb/models/new_plan_grouped_tiered_package_price.rb +1 -3
  74. data/lib/orb/models/new_plan_grouped_tiered_price.rb +1 -3
  75. data/lib/orb/models/new_plan_grouped_with_metered_minimum_price.rb +1 -3
  76. data/lib/orb/models/new_plan_grouped_with_prorated_minimum_price.rb +1 -3
  77. data/lib/orb/models/new_plan_matrix_price.rb +1 -5
  78. data/lib/orb/models/new_plan_matrix_with_allocation_price.rb +1 -3
  79. data/lib/orb/models/new_plan_matrix_with_display_name_price.rb +1 -3
  80. data/lib/orb/models/new_plan_max_group_tiered_package_price.rb +1 -3
  81. data/lib/orb/models/new_plan_minimum_composite_price.rb +1 -3
  82. data/lib/orb/models/new_plan_package_price.rb +1 -5
  83. data/lib/orb/models/new_plan_package_with_allocation_price.rb +1 -3
  84. data/lib/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rb +1 -3
  85. data/lib/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rb +1 -3
  86. data/lib/orb/models/new_plan_threshold_total_amount_price.rb +1 -3
  87. data/lib/orb/models/new_plan_tiered_package_price.rb +1 -3
  88. data/lib/orb/models/new_plan_tiered_package_with_minimum_price.rb +1 -3
  89. data/lib/orb/models/new_plan_tiered_price.rb +1 -5
  90. data/lib/orb/models/new_plan_tiered_with_minimum_price.rb +1 -3
  91. data/lib/orb/models/new_plan_unit_price.rb +1 -1
  92. data/lib/orb/models/new_plan_unit_with_percent_price.rb +1 -3
  93. data/lib/orb/models/new_plan_unit_with_proration_price.rb +1 -3
  94. data/lib/orb/models/new_subscription_bulk_price.rb +1 -3
  95. data/lib/orb/models/new_subscription_bulk_with_proration_price.rb +1 -3
  96. data/lib/orb/models/new_subscription_cumulative_grouped_bulk_price.rb +1 -3
  97. data/lib/orb/models/new_subscription_grouped_allocation_price.rb +1 -3
  98. data/lib/orb/models/new_subscription_grouped_tiered_package_price.rb +1 -3
  99. data/lib/orb/models/new_subscription_grouped_tiered_price.rb +1 -3
  100. data/lib/orb/models/new_subscription_grouped_with_metered_minimum_price.rb +1 -3
  101. data/lib/orb/models/new_subscription_grouped_with_prorated_minimum_price.rb +1 -3
  102. data/lib/orb/models/new_subscription_matrix_price.rb +1 -3
  103. data/lib/orb/models/new_subscription_matrix_with_allocation_price.rb +1 -3
  104. data/lib/orb/models/new_subscription_matrix_with_display_name_price.rb +1 -3
  105. data/lib/orb/models/new_subscription_max_group_tiered_package_price.rb +1 -3
  106. data/lib/orb/models/new_subscription_minimum_composite_price.rb +1 -3
  107. data/lib/orb/models/new_subscription_package_price.rb +1 -3
  108. data/lib/orb/models/new_subscription_package_with_allocation_price.rb +1 -3
  109. data/lib/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rb +1 -3
  110. data/lib/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb +1 -3
  111. data/lib/orb/models/new_subscription_threshold_total_amount_price.rb +1 -3
  112. data/lib/orb/models/new_subscription_tiered_package_price.rb +1 -3
  113. data/lib/orb/models/new_subscription_tiered_package_with_minimum_price.rb +1 -3
  114. data/lib/orb/models/new_subscription_tiered_price.rb +1 -3
  115. data/lib/orb/models/new_subscription_tiered_with_minimum_price.rb +1 -3
  116. data/lib/orb/models/new_subscription_unit_price.rb +1 -3
  117. data/lib/orb/models/new_subscription_unit_with_percent_price.rb +1 -3
  118. data/lib/orb/models/new_subscription_unit_with_proration_price.rb +1 -3
  119. data/lib/orb/models/per_price_cost.rb +2 -2
  120. data/lib/orb/models/plan.rb +189 -9
  121. data/lib/orb/models/plan_create_params.rb +1047 -8228
  122. data/lib/orb/models/plan_update_params.rb +9 -1
  123. data/lib/orb/models/plan_version.rb +186 -5
  124. data/lib/orb/models/plans/external_plan_id_update_params.rb +9 -1
  125. data/lib/orb/models/plans/migration_cancel_response.rb +22 -4
  126. data/lib/orb/models/plans/migration_list_response.rb +22 -4
  127. data/lib/orb/models/plans/migration_retrieve_response.rb +22 -4
  128. data/lib/orb/models/price.rb +2614 -1268
  129. data/lib/orb/models/price_create_params.rb +866 -49
  130. data/lib/orb/models/price_evaluate_multiple_params.rb +889 -54
  131. data/lib/orb/models/price_evaluate_preview_events_params.rb +881 -46
  132. data/lib/orb/models/price_interval.rb +2 -2
  133. data/lib/orb/models/subscription.rb +168 -4
  134. data/lib/orb/models/subscription_create_params.rb +2818 -674
  135. data/lib/orb/models/subscription_price_intervals_params.rb +1098 -57
  136. data/lib/orb/models/subscription_schedule_plan_change_params.rb +2834 -687
  137. data/lib/orb/models/subscription_update_params.rb +12 -1
  138. data/lib/orb/models.rb +2 -0
  139. data/lib/orb/resources/alerts.rb +14 -3
  140. data/lib/orb/resources/customers/credits/ledger.rb +28 -14
  141. data/lib/orb/resources/customers.rb +6 -2
  142. data/lib/orb/resources/events.rb +7 -34
  143. data/lib/orb/resources/invoices.rb +6 -2
  144. data/lib/orb/resources/licenses/external_licenses.rb +1 -1
  145. data/lib/orb/resources/licenses/usage.rb +2 -2
  146. data/lib/orb/resources/metrics.rb +5 -5
  147. data/lib/orb/resources/plans/external_plan_id.rb +5 -3
  148. data/lib/orb/resources/plans.rb +9 -5
  149. data/lib/orb/resources/prices/external_price_id.rb +2 -2
  150. data/lib/orb/resources/prices.rb +5 -5
  151. data/lib/orb/resources/subscriptions.rb +20 -3
  152. data/lib/orb/version.rb +1 -1
  153. data/lib/orb.rb +1 -0
  154. data/rbi/orb/models/accounting_provider_config.rbi +38 -5
  155. data/rbi/orb/models/adjustment_interval.rbi +336 -0
  156. data/rbi/orb/models/alert.rbi +172 -3
  157. data/rbi/orb/models/alert_create_for_subscription_params.rbi +268 -9
  158. data/rbi/orb/models/alert_update_params.rbi +208 -0
  159. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +3833 -28395
  160. data/rbi/orb/models/beta_create_plan_version_params.rbi +3833 -28363
  161. data/rbi/orb/models/billable_metric.rbi +10 -0
  162. data/rbi/orb/models/changed_subscription_resources.rbi +360 -5
  163. data/rbi/orb/models/conversion_rate_config.rbi +18 -0
  164. data/rbi/orb/models/credit_block_list_invoices_response.rbi +425 -3
  165. data/rbi/orb/models/credit_block_retrieve_response.rbi +421 -3
  166. data/rbi/orb/models/customer.rbi +190 -10
  167. data/rbi/orb/models/customer_create_params.rbi +12 -2
  168. data/rbi/orb/models/customer_tax_id.rbi +15 -1
  169. data/rbi/orb/models/customer_update_by_external_id_params.rbi +22 -2
  170. data/rbi/orb/models/customer_update_params.rbi +22 -2
  171. data/rbi/orb/models/customers/credit_list_by_external_id_response.rbi +425 -3
  172. data/rbi/orb/models/customers/credit_list_response.rbi +426 -3
  173. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +6 -6
  174. data/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi +6 -6
  175. data/rbi/orb/models/dimensional_price_group.rbi +1 -1
  176. data/rbi/orb/models/discount.rbi +269 -1
  177. data/rbi/orb/models/event_ingest_params.rbi +4 -2
  178. data/rbi/orb/models/invoice.rbi +360 -5
  179. data/rbi/orb/models/invoice_create_params.rbi +12 -7
  180. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +360 -5
  181. data/rbi/orb/models/invoice_issue_summary_response.rbi +19 -4
  182. data/rbi/orb/models/invoice_level_discount.rbi +298 -1
  183. data/rbi/orb/models/invoice_line_item_create_response.rbi +339 -0
  184. data/rbi/orb/models/invoice_list_summary_response.rbi +19 -4
  185. data/rbi/orb/models/licenses/external_license_get_usage_params.rbi +3 -3
  186. data/rbi/orb/models/licenses/usage_get_all_usage_params.rbi +3 -3
  187. data/rbi/orb/models/licenses/usage_get_usage_params.rbi +3 -3
  188. data/rbi/orb/models/mutated_subscription.rbi +324 -2
  189. data/rbi/orb/models/new_allocation_price.rbi +12 -0
  190. data/rbi/orb/models/per_price_cost.rbi +3 -0
  191. data/rbi/orb/models/plan.rbi +339 -2
  192. data/rbi/orb/models/plan_create_params.rbi +1877 -14138
  193. data/rbi/orb/models/plan_update_params.rbi +8 -0
  194. data/rbi/orb/models/plan_version.rbi +339 -0
  195. data/rbi/orb/models/plans/external_plan_id_update_params.rbi +8 -0
  196. data/rbi/orb/models/plans/migration_cancel_response.rbi +22 -1
  197. data/rbi/orb/models/plans/migration_list_response.rbi +22 -1
  198. data/rbi/orb/models/plans/migration_retrieve_response.rbi +22 -1
  199. data/rbi/orb/models/price.rbi +4552 -2285
  200. data/rbi/orb/models/price_create_params.rbi +1540 -114
  201. data/rbi/orb/models/price_evaluate_multiple_params.rbi +1540 -114
  202. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +1540 -114
  203. data/rbi/orb/models/price_interval.rbi +3 -0
  204. data/rbi/orb/models/subscription.rbi +324 -2
  205. data/rbi/orb/models/subscription_create_params.rbi +4998 -1186
  206. data/rbi/orb/models/subscription_price_intervals_params.rbi +2127 -264
  207. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +4997 -1185
  208. data/rbi/orb/models/subscription_update_params.rbi +14 -0
  209. data/rbi/orb/models.rbi +2 -0
  210. data/rbi/orb/resources/alerts.rbi +39 -4
  211. data/rbi/orb/resources/customers/credits/ledger.rbi +28 -14
  212. data/rbi/orb/resources/customers.rbi +23 -0
  213. data/rbi/orb/resources/events.rbi +8 -35
  214. data/rbi/orb/resources/invoices.rbi +9 -3
  215. data/rbi/orb/resources/licenses/external_licenses.rbi +1 -1
  216. data/rbi/orb/resources/licenses/usage.rbi +2 -2
  217. data/rbi/orb/resources/metrics.rbi +5 -5
  218. data/rbi/orb/resources/plans/external_plan_id.rbi +5 -2
  219. data/rbi/orb/resources/plans.rbi +9 -3
  220. data/rbi/orb/resources/prices.rbi +3 -0
  221. data/rbi/orb/resources/subscriptions.rbi +29 -0
  222. data/sig/orb/models/accounting_provider_config.rbs +21 -4
  223. data/sig/orb/models/adjustment_interval.rbs +134 -0
  224. data/sig/orb/models/alert.rbs +85 -3
  225. data/sig/orb/models/alert_create_for_subscription_params.rbs +86 -4
  226. data/sig/orb/models/alert_update_params.rbs +86 -1
  227. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +1803 -11601
  228. data/sig/orb/models/beta_create_plan_version_params.rbs +1747 -11541
  229. data/sig/orb/models/billable_metric.rbs +5 -0
  230. data/sig/orb/models/changed_subscription_resources.rbs +140 -1
  231. data/sig/orb/models/conversion_rate_config.rbs +12 -0
  232. data/sig/orb/models/credit_block_list_invoices_response.rbs +142 -3
  233. data/sig/orb/models/credit_block_retrieve_response.rbs +142 -3
  234. data/sig/orb/models/customer.rbs +70 -4
  235. data/sig/orb/models/customer_create_params.rbs +2 -2
  236. data/sig/orb/models/customer_tax_id.rbs +20 -2
  237. data/sig/orb/models/customer_update_by_external_id_params.rbs +7 -2
  238. data/sig/orb/models/customer_update_params.rbs +7 -2
  239. data/sig/orb/models/customers/credit_list_by_external_id_response.rbs +142 -3
  240. data/sig/orb/models/customers/credit_list_response.rbs +142 -3
  241. data/sig/orb/models/discount.rbs +114 -0
  242. data/sig/orb/models/invoice.rbs +140 -1
  243. data/sig/orb/models/invoice_fetch_upcoming_response.rbs +140 -1
  244. data/sig/orb/models/invoice_issue_summary_response.rbs +2 -1
  245. data/sig/orb/models/invoice_level_discount.rbs +117 -1
  246. data/sig/orb/models/invoice_line_item_create_response.rbs +134 -0
  247. data/sig/orb/models/invoice_list_summary_response.rbs +2 -1
  248. data/sig/orb/models/licenses/external_license_get_usage_params.rbs +4 -4
  249. data/sig/orb/models/licenses/usage_get_all_usage_params.rbs +4 -4
  250. data/sig/orb/models/licenses/usage_get_usage_params.rbs +4 -4
  251. data/sig/orb/models/mutated_subscription.rbs +124 -0
  252. data/sig/orb/models/new_allocation_price.rbs +5 -0
  253. data/sig/orb/models/new_floating_bulk_price.rbs +4 -4
  254. data/sig/orb/models/new_floating_bulk_with_proration_price.rbs +4 -4
  255. data/sig/orb/models/new_floating_cumulative_grouped_bulk_price.rbs +4 -4
  256. data/sig/orb/models/new_floating_grouped_allocation_price.rbs +4 -4
  257. data/sig/orb/models/new_floating_grouped_tiered_package_price.rbs +4 -4
  258. data/sig/orb/models/new_floating_grouped_tiered_price.rbs +4 -4
  259. data/sig/orb/models/new_floating_grouped_with_metered_minimum_price.rbs +4 -4
  260. data/sig/orb/models/new_floating_grouped_with_prorated_minimum_price.rbs +4 -4
  261. data/sig/orb/models/new_floating_matrix_price.rbs +4 -4
  262. data/sig/orb/models/new_floating_matrix_with_allocation_price.rbs +4 -4
  263. data/sig/orb/models/new_floating_matrix_with_display_name_price.rbs +4 -4
  264. data/sig/orb/models/new_floating_max_group_tiered_package_price.rbs +4 -4
  265. data/sig/orb/models/new_floating_minimum_composite_price.rbs +4 -4
  266. data/sig/orb/models/new_floating_package_price.rbs +4 -4
  267. data/sig/orb/models/new_floating_package_with_allocation_price.rbs +4 -4
  268. data/sig/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rbs +4 -4
  269. data/sig/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbs +4 -4
  270. data/sig/orb/models/new_floating_threshold_total_amount_price.rbs +4 -4
  271. data/sig/orb/models/new_floating_tiered_package_price.rbs +4 -4
  272. data/sig/orb/models/new_floating_tiered_package_with_minimum_price.rbs +4 -4
  273. data/sig/orb/models/new_floating_tiered_price.rbs +4 -4
  274. data/sig/orb/models/new_floating_tiered_with_minimum_price.rbs +4 -4
  275. data/sig/orb/models/new_floating_tiered_with_proration_price.rbs +4 -4
  276. data/sig/orb/models/new_floating_unit_price.rbs +4 -4
  277. data/sig/orb/models/new_floating_unit_with_percent_price.rbs +4 -4
  278. data/sig/orb/models/new_floating_unit_with_proration_price.rbs +4 -4
  279. data/sig/orb/models/new_plan_bulk_price.rbs +4 -4
  280. data/sig/orb/models/new_plan_bulk_with_proration_price.rbs +4 -4
  281. data/sig/orb/models/new_plan_cumulative_grouped_bulk_price.rbs +4 -4
  282. data/sig/orb/models/new_plan_grouped_allocation_price.rbs +4 -4
  283. data/sig/orb/models/new_plan_grouped_tiered_package_price.rbs +4 -4
  284. data/sig/orb/models/new_plan_grouped_tiered_price.rbs +4 -4
  285. data/sig/orb/models/new_plan_grouped_with_metered_minimum_price.rbs +4 -4
  286. data/sig/orb/models/new_plan_grouped_with_prorated_minimum_price.rbs +4 -4
  287. data/sig/orb/models/new_plan_matrix_price.rbs +4 -4
  288. data/sig/orb/models/new_plan_matrix_with_allocation_price.rbs +4 -4
  289. data/sig/orb/models/new_plan_matrix_with_display_name_price.rbs +4 -4
  290. data/sig/orb/models/new_plan_max_group_tiered_package_price.rbs +4 -4
  291. data/sig/orb/models/new_plan_minimum_composite_price.rbs +4 -4
  292. data/sig/orb/models/new_plan_package_price.rbs +4 -4
  293. data/sig/orb/models/new_plan_package_with_allocation_price.rbs +4 -4
  294. data/sig/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rbs +4 -4
  295. data/sig/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbs +4 -4
  296. data/sig/orb/models/new_plan_threshold_total_amount_price.rbs +4 -4
  297. data/sig/orb/models/new_plan_tiered_package_price.rbs +4 -4
  298. data/sig/orb/models/new_plan_tiered_package_with_minimum_price.rbs +4 -4
  299. data/sig/orb/models/new_plan_tiered_price.rbs +4 -4
  300. data/sig/orb/models/new_plan_tiered_with_minimum_price.rbs +4 -4
  301. data/sig/orb/models/new_plan_unit_price.rbs +4 -4
  302. data/sig/orb/models/new_plan_unit_with_percent_price.rbs +4 -4
  303. data/sig/orb/models/new_plan_unit_with_proration_price.rbs +4 -4
  304. data/sig/orb/models/new_subscription_bulk_price.rbs +4 -4
  305. data/sig/orb/models/new_subscription_bulk_with_proration_price.rbs +4 -4
  306. data/sig/orb/models/new_subscription_cumulative_grouped_bulk_price.rbs +4 -4
  307. data/sig/orb/models/new_subscription_grouped_allocation_price.rbs +4 -4
  308. data/sig/orb/models/new_subscription_grouped_tiered_package_price.rbs +4 -4
  309. data/sig/orb/models/new_subscription_grouped_tiered_price.rbs +4 -4
  310. data/sig/orb/models/new_subscription_grouped_with_metered_minimum_price.rbs +4 -4
  311. data/sig/orb/models/new_subscription_grouped_with_prorated_minimum_price.rbs +4 -4
  312. data/sig/orb/models/new_subscription_matrix_price.rbs +4 -4
  313. data/sig/orb/models/new_subscription_matrix_with_allocation_price.rbs +4 -4
  314. data/sig/orb/models/new_subscription_matrix_with_display_name_price.rbs +4 -4
  315. data/sig/orb/models/new_subscription_max_group_tiered_package_price.rbs +4 -4
  316. data/sig/orb/models/new_subscription_minimum_composite_price.rbs +4 -4
  317. data/sig/orb/models/new_subscription_package_price.rbs +4 -4
  318. data/sig/orb/models/new_subscription_package_with_allocation_price.rbs +4 -4
  319. data/sig/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rbs +4 -4
  320. data/sig/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbs +4 -4
  321. data/sig/orb/models/new_subscription_threshold_total_amount_price.rbs +4 -4
  322. data/sig/orb/models/new_subscription_tiered_package_price.rbs +4 -4
  323. data/sig/orb/models/new_subscription_tiered_package_with_minimum_price.rbs +4 -4
  324. data/sig/orb/models/new_subscription_tiered_price.rbs +4 -4
  325. data/sig/orb/models/new_subscription_tiered_with_minimum_price.rbs +4 -4
  326. data/sig/orb/models/new_subscription_unit_price.rbs +4 -4
  327. data/sig/orb/models/new_subscription_unit_with_percent_price.rbs +4 -4
  328. data/sig/orb/models/new_subscription_unit_with_proration_price.rbs +4 -4
  329. data/sig/orb/models/plan.rbs +134 -0
  330. data/sig/orb/models/plan_create_params.rbs +836 -5728
  331. data/sig/orb/models/plan_update_params.rbs +5 -0
  332. data/sig/orb/models/plan_version.rbs +134 -0
  333. data/sig/orb/models/plans/external_plan_id_update_params.rbs +5 -0
  334. data/sig/orb/models/price.rbs +2200 -1150
  335. data/sig/orb/models/price_create_params.rbs +611 -23
  336. data/sig/orb/models/price_evaluate_multiple_params.rbs +626 -23
  337. data/sig/orb/models/price_evaluate_preview_events_params.rbs +626 -23
  338. data/sig/orb/models/subscription.rbs +124 -0
  339. data/sig/orb/models/subscription_create_params.rbs +2009 -430
  340. data/sig/orb/models/subscription_price_intervals_params.rbs +795 -23
  341. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +2009 -430
  342. data/sig/orb/models/subscription_update_params.rbs +5 -0
  343. data/sig/orb/models.rbs +2 -0
  344. data/sig/orb/resources/alerts.rbs +5 -1
  345. data/sig/orb/resources/customers.rbs +2 -0
  346. data/sig/orb/resources/licenses/external_licenses.rbs +1 -1
  347. data/sig/orb/resources/licenses/usage.rbs +2 -2
  348. data/sig/orb/resources/plans/external_plan_id.rbs +1 -0
  349. data/sig/orb/resources/plans.rbs +2 -0
  350. data/sig/orb/resources/subscriptions.rbs +3 -0
  351. metadata +6 -7
@@ -36,6 +36,13 @@ module Orb
36
36
  # @return [String]
37
37
  required :name, String
38
38
 
39
+ # @!attribute sql
40
+ # The SQL definition of the metric. For metrics defined via configuration rather
41
+ # than SQL, this is a derived SQL representation.
42
+ #
43
+ # @return [String]
44
+ required :sql, String
45
+
39
46
  # @!attribute status
40
47
  #
41
48
  # @return [Symbol, Orb::Models::BillableMetric::Status]
@@ -48,7 +55,7 @@ module Orb
48
55
  Orb::Internal::Type::ArrayOf[Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]],
49
56
  nil?: true
50
57
 
51
- # @!method initialize(id:, description:, item:, metadata:, name:, status:, parameter_definitions: nil)
58
+ # @!method initialize(id:, description:, item:, metadata:, name:, sql:, status:, parameter_definitions: nil)
52
59
  # Some parameter documentations has been truncated, see
53
60
  # {Orb::Models::BillableMetric} for more details.
54
61
  #
@@ -66,6 +73,8 @@ module Orb
66
73
  #
67
74
  # @param name [String]
68
75
  #
76
+ # @param sql [String] The SQL definition of the metric. For metrics defined via configuration rather t
77
+ #
69
78
  # @param status [Symbol, Orb::Models::BillableMetric::Status]
70
79
  #
71
80
  # @param parameter_definitions [Array<Hash{Symbol=>Object}>, nil]
@@ -148,11 +148,13 @@ module Orb
148
148
  # | Estonia | `eu_vat` | European VAT Number |
149
149
  # | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
150
150
  # | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
151
+ # | Faroe Islands | `fo_vat` | Faroe Islands VAT Number |
151
152
  # | Finland | `eu_vat` | European VAT Number |
152
153
  # | France | `eu_vat` | European VAT Number |
153
154
  # | Georgia | `ge_vat` | Georgian VAT |
154
155
  # | Germany | `de_stn` | German Tax Number (Steuernummer) |
155
156
  # | Germany | `eu_vat` | European VAT Number |
157
+ # | Gibraltar | `gi_tin` | Gibraltar Tax Identification Number |
156
158
  # | Greece | `eu_vat` | European VAT Number |
157
159
  # | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
158
160
  # | Hong Kong | `hk_br` | Hong Kong BR Number |
@@ -164,6 +166,7 @@ module Orb
164
166
  # | Ireland | `eu_vat` | European VAT Number |
165
167
  # | Israel | `il_vat` | Israel VAT |
166
168
  # | Italy | `eu_vat` | European VAT Number |
169
+ # | Italy | `it_cf` | Italian Codice Fiscale Number |
167
170
  # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
168
171
  # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
169
172
  # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
@@ -194,6 +197,7 @@ module Orb
194
197
  # | Norway | `no_vat` | Norwegian VAT Number |
195
198
  # | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
196
199
  # | Oman | `om_vat` | Omani VAT Number |
200
+ # | Paraguay | `py_ruc` | Paraguayan RUC Number |
197
201
  # | Peru | `pe_ruc` | Peruvian RUC Number |
198
202
  # | Philippines | `ph_tin` | Philippines Tax Identification Number |
199
203
  # | Poland | `eu_vat` | European VAT Number |
@@ -215,6 +219,7 @@ module Orb
215
219
  # | South Korea | `kr_brn` | Korean BRN |
216
220
  # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
217
221
  # | Spain | `eu_vat` | European VAT Number |
222
+ # | Sri Lanka | `lk_vat` | Sri Lanka VAT Number |
218
223
  # | Suriname | `sr_fin` | Suriname FIN Number |
219
224
  # | Sweden | `eu_vat` | European VAT Number |
220
225
  # | Switzerland | `ch_uid` | Switzerland UID Number |
@@ -252,7 +257,7 @@ module Orb
252
257
 
253
258
  # @!attribute discounts
254
259
  #
255
- # @return [Array<Orb::Models::PercentageDiscount, Orb::Models::AmountDiscount, Orb::Models::TrialDiscount>]
260
+ # @return [Array<Orb::Models::PercentageDiscount, Orb::Models::AmountDiscount, Orb::Models::TrialDiscount, Orb::Models::InvoiceLevelDiscount::TieredPercentage>]
256
261
  required :discounts, -> { Orb::Internal::Type::ArrayOf[union: Orb::InvoiceLevelDiscount] }
257
262
 
258
263
  # @!attribute due_date
@@ -271,8 +276,8 @@ module Orb
271
276
  required :eligible_to_issue_at, Time, nil?: true
272
277
 
273
278
  # @!attribute hosted_invoice_url
274
- # A URL for the customer-facing invoice portal. This URL expires 30 days after the
275
- # invoice's due date, or 60 days after being re-generated through the UI.
279
+ # A URL for the customer-facing invoice portal. This URL expires 60 days after the
280
+ # link is generated, or 30 days after the invoice's due date — whichever is later.
276
281
  #
277
282
  # @return [String, nil]
278
283
  required :hosted_invoice_url, String, nil?: true
@@ -475,13 +480,13 @@ module Orb
475
480
  #
476
481
  # @param discount [Object] This field is deprecated in favor of `discounts`. If a `discounts` list is provi
477
482
  #
478
- # @param discounts [Array<Orb::Models::PercentageDiscount, Orb::Models::AmountDiscount, Orb::Models::TrialDiscount>]
483
+ # @param discounts [Array<Orb::Models::PercentageDiscount, Orb::Models::AmountDiscount, Orb::Models::TrialDiscount, Orb::Models::InvoiceLevelDiscount::TieredPercentage>]
479
484
  #
480
485
  # @param due_date [Time, nil] When the invoice payment is due. The due date is null if the invoice is not yet
481
486
  #
482
487
  # @param eligible_to_issue_at [Time, nil] If the invoice has a status of `draft`, this will be the time that the invoice w
483
488
  #
484
- # @param hosted_invoice_url [String, nil] A URL for the customer-facing invoice portal. This URL expires 30 days after the
489
+ # @param hosted_invoice_url [String, nil] A URL for the customer-facing invoice portal. This URL expires 60 days after the
485
490
  #
486
491
  # @param invoice_date [Time] The scheduled date of the invoice
487
492
  #
@@ -791,7 +796,7 @@ module Orb
791
796
  # invoice calculations (ie. usage discounts -> amount discounts -> percentage
792
797
  # discounts -> minimums -> maximums).
793
798
  #
794
- # @return [Array<Orb::Models::MonetaryUsageDiscountAdjustment, Orb::Models::MonetaryAmountDiscountAdjustment, Orb::Models::MonetaryPercentageDiscountAdjustment, Orb::Models::MonetaryMinimumAdjustment, Orb::Models::MonetaryMaximumAdjustment>]
799
+ # @return [Array<Orb::Models::MonetaryUsageDiscountAdjustment, Orb::Models::MonetaryAmountDiscountAdjustment, Orb::Models::MonetaryPercentageDiscountAdjustment, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount, Orb::Models::MonetaryMinimumAdjustment, Orb::Models::MonetaryMaximumAdjustment>]
795
800
  required :adjustments,
796
801
  -> { Orb::Internal::Type::ArrayOf[union: Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment] }
797
802
 
@@ -852,7 +857,7 @@ module Orb
852
857
  # For more on the types of prices, see
853
858
  # [the core concepts documentation](/core-concepts#plan-and-price)
854
859
  #
855
- # @return [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::BulkWithFilters, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::CumulativeGroupedAllocation, Orb::Models::Price::MinimumComposite, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput]
860
+ # @return [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::BulkWithFilters, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::MatrixWithThresholdDiscounts, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::CumulativeGroupedAllocation, Orb::Models::Price::DailyCreditAllowance, Orb::Models::Price::MeteredAllowance, Orb::Models::Price::MinimumComposite, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput]
856
861
  required :price, union: -> { Orb::Price }
857
862
 
858
863
  # @!attribute quantity
@@ -903,7 +908,7 @@ module Orb
903
908
  #
904
909
  # @param adjusted_subtotal [String] The line amount after any adjustments and before overage conversion, credits and
905
910
  #
906
- # @param adjustments [Array<Orb::Models::MonetaryUsageDiscountAdjustment, Orb::Models::MonetaryAmountDiscountAdjustment, Orb::Models::MonetaryPercentageDiscountAdjustment, Orb::Models::MonetaryMinimumAdjustment, Orb::Models::MonetaryMaximumAdjustment>] All adjustments applied to the line item in the order they were applied based on
911
+ # @param adjustments [Array<Orb::Models::MonetaryUsageDiscountAdjustment, Orb::Models::MonetaryAmountDiscountAdjustment, Orb::Models::MonetaryPercentageDiscountAdjustment, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount, Orb::Models::MonetaryMinimumAdjustment, Orb::Models::MonetaryMaximumAdjustment>] All adjustments applied to the line item in the order they were applied based on
907
912
  #
908
913
  # @param amount [String] The final amount for a line item after all adjustments and pre paid credits have
909
914
  #
@@ -919,7 +924,7 @@ module Orb
919
924
  #
920
925
  # @param partially_invoiced_amount [String] Any amount applied from a partial invoice
921
926
  #
922
- # @param price [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::BulkWithFilters, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::CumulativeGroupedAllocation, Orb::Models::Price::MinimumComposite, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] The Price resource represents a price that can be billed on a subscription, resu
927
+ # @param price [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::BulkWithFilters, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::MatrixWithThresholdDiscounts, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::CumulativeGroupedAllocation, Orb::Models::Price::DailyCreditAllowance, Orb::Models::Price::MeteredAllowance, Orb::Models::Price::MinimumComposite, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] The Price resource represents a price that can be billed on a subscription, resu
923
928
  #
924
929
  # @param quantity [Float] Either the fixed fee quantity or the usage during the service period.
925
930
  #
@@ -944,12 +949,196 @@ module Orb
944
949
 
945
950
  variant :percentage_discount, -> { Orb::MonetaryPercentageDiscountAdjustment }
946
951
 
952
+ variant :tiered_percentage_discount,
953
+ -> { Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount }
954
+
947
955
  variant :minimum, -> { Orb::MonetaryMinimumAdjustment }
948
956
 
949
957
  variant :maximum, -> { Orb::MonetaryMaximumAdjustment }
950
958
 
959
+ class TieredPercentageDiscount < Orb::Internal::Type::BaseModel
960
+ # @!attribute id
961
+ #
962
+ # @return [String]
963
+ required :id, String
964
+
965
+ # @!attribute adjustment_type
966
+ #
967
+ # @return [Symbol, :tiered_percentage_discount]
968
+ required :adjustment_type, const: :tiered_percentage_discount
969
+
970
+ # @!attribute amount
971
+ # The value applied by an adjustment.
972
+ #
973
+ # @return [String]
974
+ required :amount, String
975
+
976
+ # @!attribute applies_to_price_ids
977
+ # @deprecated
978
+ #
979
+ # The price IDs that this adjustment applies to.
980
+ #
981
+ # @return [Array<String>]
982
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
983
+
984
+ # @!attribute filters
985
+ # The filters that determine which prices to apply this adjustment to.
986
+ #
987
+ # @return [Array<Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Filter>]
988
+ required :filters,
989
+ -> { Orb::Internal::Type::ArrayOf[Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Filter] }
990
+
991
+ # @!attribute is_invoice_level
992
+ # True for adjustments that apply to an entire invoice, false for adjustments that
993
+ # apply to only one price.
994
+ #
995
+ # @return [Boolean]
996
+ required :is_invoice_level, Orb::Internal::Type::Boolean
997
+
998
+ # @!attribute reason
999
+ # The reason for the adjustment.
1000
+ #
1001
+ # @return [String, nil]
1002
+ required :reason, String, nil?: true
1003
+
1004
+ # @!attribute replaces_adjustment_id
1005
+ # The adjustment id this adjustment replaces. This adjustment will take the place
1006
+ # of the replaced adjustment in plan version migrations.
1007
+ #
1008
+ # @return [String, nil]
1009
+ required :replaces_adjustment_id, String, nil?: true
1010
+
1011
+ # @!attribute tiers
1012
+ # The ordered, contiguous bands of cumulative eligible spend, each discounted at
1013
+ # its own percentage (progressive fill-a-tier), applied to the prices this
1014
+ # adjustment covers in a given billing period.
1015
+ #
1016
+ # @return [Array<Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Tier>]
1017
+ required :tiers,
1018
+ -> { Orb::Internal::Type::ArrayOf[Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Tier] }
1019
+
1020
+ # @!method initialize(id:, amount:, applies_to_price_ids:, filters:, is_invoice_level:, reason:, replaces_adjustment_id:, tiers:, adjustment_type: :tiered_percentage_discount)
1021
+ # Some parameter documentations has been truncated, see
1022
+ # {Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount}
1023
+ # for more details.
1024
+ #
1025
+ # @param id [String]
1026
+ #
1027
+ # @param amount [String] The value applied by an adjustment.
1028
+ #
1029
+ # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
1030
+ #
1031
+ # @param filters [Array<Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Filter>] The filters that determine which prices to apply this adjustment to.
1032
+ #
1033
+ # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invoice, false for adjustments that
1034
+ #
1035
+ # @param reason [String, nil] The reason for the adjustment.
1036
+ #
1037
+ # @param replaces_adjustment_id [String, nil] The adjustment id this adjustment replaces. This adjustment will take the place
1038
+ #
1039
+ # @param tiers [Array<Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Tier>] The ordered, contiguous bands of cumulative eligible spend, each discounted at i
1040
+ #
1041
+ # @param adjustment_type [Symbol, :tiered_percentage_discount]
1042
+
1043
+ class Filter < Orb::Internal::Type::BaseModel
1044
+ # @!attribute field
1045
+ # The property of the price to filter on.
1046
+ #
1047
+ # @return [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field]
1048
+ required :field,
1049
+ enum: -> { Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field }
1050
+
1051
+ # @!attribute operator
1052
+ # Should prices that match the filter be included or excluded.
1053
+ #
1054
+ # @return [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator]
1055
+ required :operator,
1056
+ enum: -> { Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator }
1057
+
1058
+ # @!attribute values
1059
+ # The IDs or values that match this filter.
1060
+ #
1061
+ # @return [Array<String>]
1062
+ required :values, Orb::Internal::Type::ArrayOf[String]
1063
+
1064
+ # @!method initialize(field:, operator:, values:)
1065
+ # @param field [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field] The property of the price to filter on.
1066
+ #
1067
+ # @param operator [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator] Should prices that match the filter be included or excluded.
1068
+ #
1069
+ # @param values [Array<String>] The IDs or values that match this filter.
1070
+
1071
+ # The property of the price to filter on.
1072
+ #
1073
+ # @see Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Filter#field
1074
+ module Field
1075
+ extend Orb::Internal::Type::Enum
1076
+
1077
+ PRICE_ID = :price_id
1078
+ ITEM_ID = :item_id
1079
+ PRICE_TYPE = :price_type
1080
+ CURRENCY = :currency
1081
+ PRICING_UNIT_ID = :pricing_unit_id
1082
+
1083
+ # @!method self.values
1084
+ # @return [Array<Symbol>]
1085
+ end
1086
+
1087
+ # Should prices that match the filter be included or excluded.
1088
+ #
1089
+ # @see Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Filter#operator
1090
+ module Operator
1091
+ extend Orb::Internal::Type::Enum
1092
+
1093
+ INCLUDES = :includes
1094
+ EXCLUDES = :excludes
1095
+
1096
+ # @!method self.values
1097
+ # @return [Array<Symbol>]
1098
+ end
1099
+ end
1100
+
1101
+ class Tier < Orb::Internal::Type::BaseModel
1102
+ # @!attribute lower_bound
1103
+ # Exclusive lower bound of cumulative spend for this tier.
1104
+ #
1105
+ # @return [Float]
1106
+ required :lower_bound, Float
1107
+
1108
+ # @!attribute percentage
1109
+ # The percentage (between 0 and 1) discounted from spend that falls within this
1110
+ # tier.
1111
+ #
1112
+ # @return [Float]
1113
+ required :percentage, Float
1114
+
1115
+ # @!attribute upper_bound
1116
+ # Inclusive upper bound of cumulative spend for this tier; null for the final
1117
+ # open-ended tier.
1118
+ #
1119
+ # @return [Float, nil]
1120
+ optional :upper_bound, Float, nil?: true
1121
+
1122
+ # @!method initialize(lower_bound:, percentage:, upper_bound: nil)
1123
+ # Some parameter documentations has been truncated, see
1124
+ # {Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount::Tier}
1125
+ # for more details.
1126
+ #
1127
+ # One band of a tiered percentage discount. Bounds are denominated in the
1128
+ # discount's currency. `lower_bound` is the exclusive start of the band and
1129
+ # `upper_bound` is the inclusive end; `upper_bound` is null only for the
1130
+ # open-ended final tier.
1131
+ #
1132
+ # @param lower_bound [Float] Exclusive lower bound of cumulative spend for this tier.
1133
+ #
1134
+ # @param percentage [Float] The percentage (between 0 and 1) discounted from spend that falls within this ti
1135
+ #
1136
+ # @param upper_bound [Float, nil] Inclusive upper bound of cumulative spend for this tier; null for the final open
1137
+ end
1138
+ end
1139
+
951
1140
  # @!method self.variants
952
- # @return [Array(Orb::Models::MonetaryUsageDiscountAdjustment, Orb::Models::MonetaryAmountDiscountAdjustment, Orb::Models::MonetaryPercentageDiscountAdjustment, Orb::Models::MonetaryMinimumAdjustment, Orb::Models::MonetaryMaximumAdjustment)]
1141
+ # @return [Array(Orb::Models::MonetaryUsageDiscountAdjustment, Orb::Models::MonetaryAmountDiscountAdjustment, Orb::Models::MonetaryPercentageDiscountAdjustment, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::TieredPercentageDiscount, Orb::Models::MonetaryMinimumAdjustment, Orb::Models::MonetaryMaximumAdjustment)]
953
1142
  end
954
1143
 
955
1144
  module SubLineItem
@@ -1042,6 +1231,7 @@ module Orb
1042
1231
  extend Orb::Internal::Type::Enum
1043
1232
 
1044
1233
  STRIPE = :stripe
1234
+ ADYEN = :adyen
1045
1235
 
1046
1236
  # @!method self.values
1047
1237
  # @return [Array<Symbol>]
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ module ConversionRateConfig
6
+ extend Orb::Internal::Type::Union
7
+
8
+ discriminator :conversion_rate_type
9
+
10
+ variant :unit, -> { Orb::UnitConversionRateConfig }
11
+
12
+ variant :tiered, -> { Orb::TieredConversionRateConfig }
13
+
14
+ # @!method self.variants
15
+ # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)]
16
+ end
17
+ end
18
+ end
@@ -33,6 +33,17 @@ module Orb
33
33
  # @return [Float]
34
34
  required :balance, Float
35
35
 
36
+ # @!attribute credit_block_source
37
+ # How this credit block was created: `allocation` (a subscription's recurring
38
+ # credit allocation), `top_up` (an automatic balance-threshold top-up),
39
+ # `commitment` (a subscription commitment true-up rolled forward as credit), or
40
+ # `manual` (a manual credit ledger increment, including credits voided or expired
41
+ # off another block).
42
+ #
43
+ # @return [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::CreditBlockSource]
44
+ required :credit_block_source,
45
+ enum: -> { Orb::Models::CreditBlockListInvoicesResponse::Block::CreditBlockSource }
46
+
36
47
  # @!attribute effective_date
37
48
  #
38
49
  # @return [Time, nil]
@@ -73,7 +84,25 @@ module Orb
73
84
  # @return [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::Status]
74
85
  required :status, enum: -> { Orb::Models::CreditBlockListInvoicesResponse::Block::Status }
75
86
 
76
- # @!method initialize(id:, balance:, effective_date:, expiry_date:, filters:, maximum_initial_balance:, metadata:, per_unit_cost_basis:, status:)
87
+ # @!attribute credit_allocation
88
+ # The credit allocation that funded a block. Extends the allocation resource
89
+ # serialized on prices with the catalog-item attribution of the funding price.
90
+ #
91
+ # @return [Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation, nil]
92
+ optional :credit_allocation,
93
+ -> { Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation },
94
+ nil?: true
95
+
96
+ # @!attribute credit_commitment
97
+ # The subscription commitment whose true-up rolled forward into this credit block.
98
+ # Present only when `credit_block_source` is `commitment`.
99
+ #
100
+ # @return [Orb::Models::CreditBlockListInvoicesResponse::Block::CreditCommitment, nil]
101
+ optional :credit_commitment,
102
+ -> { Orb::Models::CreditBlockListInvoicesResponse::Block::CreditCommitment },
103
+ nil?: true
104
+
105
+ # @!method initialize(id:, balance:, credit_block_source:, effective_date:, expiry_date:, filters:, maximum_initial_balance:, metadata:, per_unit_cost_basis:, status:, credit_allocation: nil, credit_commitment: nil)
77
106
  # Some parameter documentations has been truncated, see
78
107
  # {Orb::Models::CreditBlockListInvoicesResponse::Block} for more details.
79
108
  #
@@ -83,6 +112,8 @@ module Orb
83
112
  #
84
113
  # @param balance [Float]
85
114
  #
115
+ # @param credit_block_source [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::CreditBlockSource] How this credit block was created: `allocation` (a subscription's recurring cred
116
+ #
86
117
  # @param effective_date [Time, nil]
87
118
  #
88
119
  # @param expiry_date [Time, nil]
@@ -96,6 +127,29 @@ module Orb
96
127
  # @param per_unit_cost_basis [String, nil]
97
128
  #
98
129
  # @param status [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::Status]
130
+ #
131
+ # @param credit_allocation [Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation, nil] The credit allocation that funded a block. Extends the allocation resource
132
+ #
133
+ # @param credit_commitment [Orb::Models::CreditBlockListInvoicesResponse::Block::CreditCommitment, nil] The subscription commitment whose true-up rolled forward into this credit block.
134
+
135
+ # How this credit block was created: `allocation` (a subscription's recurring
136
+ # credit allocation), `top_up` (an automatic balance-threshold top-up),
137
+ # `commitment` (a subscription commitment true-up rolled forward as credit), or
138
+ # `manual` (a manual credit ledger increment, including credits voided or expired
139
+ # off another block).
140
+ #
141
+ # @see Orb::Models::CreditBlockListInvoicesResponse::Block#credit_block_source
142
+ module CreditBlockSource
143
+ extend Orb::Internal::Type::Enum
144
+
145
+ ALLOCATION = :allocation
146
+ TOP_UP = :top_up
147
+ COMMITMENT = :commitment
148
+ MANUAL = :manual
149
+
150
+ # @!method self.values
151
+ # @return [Array<Symbol>]
152
+ end
99
153
 
100
154
  class Filter < Orb::Internal::Type::BaseModel
101
155
  # @!attribute field
@@ -163,6 +217,143 @@ module Orb
163
217
  # @!method self.values
164
218
  # @return [Array<Symbol>]
165
219
  end
220
+
221
+ # @see Orb::Models::CreditBlockListInvoicesResponse::Block#credit_allocation
222
+ class CreditAllocation < Orb::Internal::Type::BaseModel
223
+ # @!attribute allows_rollover
224
+ #
225
+ # @return [Boolean]
226
+ required :allows_rollover, Orb::Internal::Type::Boolean
227
+
228
+ # @!attribute currency
229
+ #
230
+ # @return [String]
231
+ required :currency, String
232
+
233
+ # @!attribute custom_expiration
234
+ #
235
+ # @return [Orb::Models::CustomExpiration, nil]
236
+ required :custom_expiration, -> { Orb::CustomExpiration }, nil?: true
237
+
238
+ # @!attribute item_id
239
+ # The ID of the catalog item this block was allocated from, derived from the
240
+ # allocation's price.
241
+ #
242
+ # @return [String]
243
+ required :item_id, String
244
+
245
+ # @!attribute filters
246
+ #
247
+ # @return [Array<Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation::Filter>, nil]
248
+ optional :filters,
249
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation::Filter] }
250
+
251
+ # @!attribute license_type_id
252
+ #
253
+ # @return [String, nil]
254
+ optional :license_type_id, String, nil?: true
255
+
256
+ # @!method initialize(allows_rollover:, currency:, custom_expiration:, item_id:, filters: nil, license_type_id: nil)
257
+ # Some parameter documentations has been truncated, see
258
+ # {Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation} for more
259
+ # details.
260
+ #
261
+ # The credit allocation that funded a block. Extends the allocation resource
262
+ # serialized on prices with the catalog-item attribution of the funding price.
263
+ #
264
+ # @param allows_rollover [Boolean]
265
+ #
266
+ # @param currency [String]
267
+ #
268
+ # @param custom_expiration [Orb::Models::CustomExpiration, nil]
269
+ #
270
+ # @param item_id [String] The ID of the catalog item this block was allocated from, derived from the alloc
271
+ #
272
+ # @param filters [Array<Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation::Filter>]
273
+ #
274
+ # @param license_type_id [String, nil]
275
+
276
+ class Filter < Orb::Internal::Type::BaseModel
277
+ # @!attribute field
278
+ # The property of the price to filter on.
279
+ #
280
+ # @return [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation::Filter::Field]
281
+ required :field,
282
+ enum: -> { Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation::Filter::Field }
283
+
284
+ # @!attribute operator
285
+ # Should prices that match the filter be included or excluded.
286
+ #
287
+ # @return [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation::Filter::Operator]
288
+ required :operator,
289
+ enum: -> { Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation::Filter::Operator }
290
+
291
+ # @!attribute values
292
+ # The IDs or values that match this filter.
293
+ #
294
+ # @return [Array<String>]
295
+ required :values, Orb::Internal::Type::ArrayOf[String]
296
+
297
+ # @!method initialize(field:, operator:, values:)
298
+ # @param field [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation::Filter::Field] The property of the price to filter on.
299
+ #
300
+ # @param operator [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation::Filter::Operator] Should prices that match the filter be included or excluded.
301
+ #
302
+ # @param values [Array<String>] The IDs or values that match this filter.
303
+
304
+ # The property of the price to filter on.
305
+ #
306
+ # @see Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation::Filter#field
307
+ module Field
308
+ extend Orb::Internal::Type::Enum
309
+
310
+ PRICE_ID = :price_id
311
+ ITEM_ID = :item_id
312
+ PRICE_TYPE = :price_type
313
+ CURRENCY = :currency
314
+ PRICING_UNIT_ID = :pricing_unit_id
315
+
316
+ # @!method self.values
317
+ # @return [Array<Symbol>]
318
+ end
319
+
320
+ # Should prices that match the filter be included or excluded.
321
+ #
322
+ # @see Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation::Filter#operator
323
+ module Operator
324
+ extend Orb::Internal::Type::Enum
325
+
326
+ INCLUDES = :includes
327
+ EXCLUDES = :excludes
328
+
329
+ # @!method self.values
330
+ # @return [Array<Symbol>]
331
+ end
332
+ end
333
+ end
334
+
335
+ # @see Orb::Models::CreditBlockListInvoicesResponse::Block#credit_commitment
336
+ class CreditCommitment < Orb::Internal::Type::BaseModel
337
+ # @!attribute id
338
+ # The ID of the subscription commitment this block was rolled forward from.
339
+ #
340
+ # @return [String]
341
+ required :id, String
342
+
343
+ # @!attribute subscription_id
344
+ # The subscription the commitment belongs to.
345
+ #
346
+ # @return [String, nil]
347
+ optional :subscription_id, String, nil?: true
348
+
349
+ # @!method initialize(id:, subscription_id: nil)
350
+ # The subscription commitment whose true-up rolled forward into this credit block.
351
+ # Present only when `credit_block_source` is `commitment`.
352
+ #
353
+ # @param id [String] The ID of the subscription commitment this block was rolled forward from.
354
+ #
355
+ # @param subscription_id [String, nil] The subscription the commitment belongs to.
356
+ end
166
357
  end
167
358
 
168
359
  class Invoice < Orb::Internal::Type::BaseModel