orb-billing 1.35.0 → 1.36.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 (258) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +4 -0
  5. data/lib/orb/models/backfill_reflected_webhook_event.rb +180 -0
  6. data/lib/orb/models/backfill_reverted_webhook_event.rb +180 -0
  7. data/lib/orb/models/billable_metric_edited_webhook_event.rb +104 -0
  8. data/lib/orb/models/credit_block_accounting_sync_failed_webhook_event.rb +499 -0
  9. data/lib/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rb +494 -0
  10. data/lib/orb/models/credit_note_accounting_sync_failed_webhook_event.rb +161 -0
  11. data/lib/orb/models/credit_note_accounting_sync_succeeded_webhook_event.rb +155 -0
  12. data/lib/orb/models/credit_note_issued_webhook_event.rb +65 -0
  13. data/lib/orb/models/credit_note_marked_as_void_webhook_event.rb +65 -0
  14. data/lib/orb/models/customer_accounting_sync_failed_webhook_event.rb +171 -0
  15. data/lib/orb/models/customer_accounting_sync_succeeded_webhook_event.rb +165 -0
  16. data/lib/orb/models/customer_balance_transaction_created_webhook_event.rb +212 -0
  17. data/lib/orb/models/customer_created_webhook_event.rb +81 -0
  18. data/lib/orb/models/customer_credit_balance_depleted_webhook_event.rb +560 -0
  19. data/lib/orb/models/customer_credit_balance_dropped_webhook_event.rb +566 -0
  20. data/lib/orb/models/customer_credit_balance_recovered_webhook_event.rb +560 -0
  21. data/lib/orb/models/customer_credit_ledger_incremented_webhook_event.rb +474 -0
  22. data/lib/orb/models/customer_edited_webhook_event.rb +344 -0
  23. data/lib/orb/models/data_exports_transfer_error_webhook_event.rb +100 -0
  24. data/lib/orb/models/data_exports_transfer_success_webhook_event.rb +94 -0
  25. data/lib/orb/models/event_unmatched_event_webhook_event.rb +105 -0
  26. data/lib/orb/models/ingestion_unmatched_customer_ids_webhook_event.rb +64 -0
  27. data/lib/orb/models/invoice_accounting_sync_failed_webhook_event.rb +164 -0
  28. data/lib/orb/models/invoice_accounting_sync_succeeded_webhook_event.rb +158 -0
  29. data/lib/orb/models/invoice_automation_schedule_step_executed_webhook_event.rb +338 -0
  30. data/lib/orb/models/invoice_cost_data_exported_webhook_event.rb +83 -0
  31. data/lib/orb/models/invoice_due_date_recalculation_canceled_webhook_event.rb +70 -0
  32. data/lib/orb/models/invoice_due_date_recalculation_completed_webhook_event.rb +70 -0
  33. data/lib/orb/models/invoice_due_date_recalculation_started_webhook_event.rb +64 -0
  34. data/lib/orb/models/invoice_dunning_schedule_created_webhook_event.rb +186 -0
  35. data/lib/orb/models/invoice_dunning_schedule_ended_webhook_event.rb +180 -0
  36. data/lib/orb/models/invoice_dunning_schedule_reset_webhook_event.rb +184 -0
  37. data/lib/orb/models/invoice_dunning_schedule_step_executed_webhook_event.rb +133 -0
  38. data/lib/orb/models/invoice_edited_webhook_event.rb +550 -0
  39. data/lib/orb/models/invoice_invoice_date_elapsed_webhook_event.rb +120 -0
  40. data/lib/orb/models/invoice_issue_failed_webhook_event.rb +79 -0
  41. data/lib/orb/models/invoice_issued_summary_webhook_event.rb +841 -0
  42. data/lib/orb/models/invoice_issued_webhook_event.rb +79 -0
  43. data/lib/orb/models/invoice_manually_marked_as_paid_webhook_event.rb +91 -0
  44. data/lib/orb/models/invoice_manually_marked_as_void_webhook_event.rb +68 -0
  45. data/lib/orb/models/invoice_payment_failed_webhook_event.rb +92 -0
  46. data/lib/orb/models/invoice_payment_processing_webhook_event.rb +85 -0
  47. data/lib/orb/models/invoice_payment_succeeded_webhook_event.rb +101 -0
  48. data/lib/orb/models/invoice_sync_failed_webhook_event.rb +85 -0
  49. data/lib/orb/models/invoice_sync_succeeded_webhook_event.rb +85 -0
  50. data/lib/orb/models/invoice_undo_mark_as_paid_webhook_event.rb +68 -0
  51. data/lib/orb/models/metric_events_dropped_by_watermark_webhook_event.rb +98 -0
  52. data/lib/orb/models/payment_method_created_webhook_event.rb +156 -0
  53. data/lib/orb/models/payment_method_deleted_webhook_event.rb +156 -0
  54. data/lib/orb/models/plan_default_version_set_webhook_event.rb +108 -0
  55. data/lib/orb/models/plan_version_created_webhook_event.rb +108 -0
  56. data/lib/orb/models/price_edited_webhook_event.rb +105 -0
  57. data/lib/orb/models/resource_event_test_webhook_event.rb +64 -0
  58. data/lib/orb/models/sales_order_accounting_sync_failed_webhook_event.rb +164 -0
  59. data/lib/orb/models/sales_order_accounting_sync_succeeded_webhook_event.rb +158 -0
  60. data/lib/orb/models/subscription_accounting_sync_failed_webhook_event.rb +178 -0
  61. data/lib/orb/models/subscription_accounting_sync_succeeded_webhook_event.rb +172 -0
  62. data/lib/orb/models/subscription_alert_disabled_webhook_event.rb +624 -0
  63. data/lib/orb/models/subscription_cancellation_scheduled_webhook_event.rb +93 -0
  64. data/lib/orb/models/subscription_cancellation_unscheduled_webhook_event.rb +93 -0
  65. data/lib/orb/models/subscription_cost_exceeded_webhook_event.rb +540 -0
  66. data/lib/orb/models/subscription_created_webhook_event.rb +82 -0
  67. data/lib/orb/models/subscription_edited_webhook_event.rb +134 -0
  68. data/lib/orb/models/subscription_ended_webhook_event.rb +82 -0
  69. data/lib/orb/models/subscription_fixed_fee_quantity_updated_webhook_event.rb +111 -0
  70. data/lib/orb/models/subscription_grouped_cost_exceeded_webhook_event.rb +655 -0
  71. data/lib/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rb +191 -0
  72. data/lib/orb/models/subscription_license_allocation_reset_webhook_event.rb +214 -0
  73. data/lib/orb/models/subscription_license_balance_threshold_reached_webhook_event.rb +652 -0
  74. data/lib/orb/models/subscription_plan_change_scheduled_webhook_event.rb +105 -0
  75. data/lib/orb/models/subscription_plan_changed_webhook_event.rb +93 -0
  76. data/lib/orb/models/subscription_plan_version_change_scheduled_webhook_event.rb +106 -0
  77. data/lib/orb/models/subscription_plan_version_changed_webhook_event.rb +105 -0
  78. data/lib/orb/models/subscription_spend_exceeded_webhook_event.rb +541 -0
  79. data/lib/orb/models/subscription_started_webhook_event.rb +82 -0
  80. data/lib/orb/models/subscription_trial_ended_webhook_event.rb +82 -0
  81. data/lib/orb/models/subscription_usage_exceeded_webhook_event.rb +548 -0
  82. data/lib/orb/models/transaction_accounting_sync_failed_webhook_event.rb +236 -0
  83. data/lib/orb/models/transaction_accounting_sync_succeeded_webhook_event.rb +232 -0
  84. data/lib/orb/models/unwrap_webhook_event.rb +250 -0
  85. data/lib/orb/models/webhook_unwrap_params.rb +14 -0
  86. data/lib/orb/models.rb +180 -0
  87. data/lib/orb/resources/webhooks.rb +22 -0
  88. data/lib/orb/version.rb +1 -1
  89. data/lib/orb.rb +82 -0
  90. data/rbi/orb/client.rbi +3 -0
  91. data/rbi/orb/models/backfill_reflected_webhook_event.rbi +274 -0
  92. data/rbi/orb/models/backfill_reverted_webhook_event.rbi +271 -0
  93. data/rbi/orb/models/billable_metric_edited_webhook_event.rbi +198 -0
  94. data/rbi/orb/models/credit_block_accounting_sync_failed_webhook_event.rbi +1039 -0
  95. data/rbi/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbi +1034 -0
  96. data/rbi/orb/models/credit_note_accounting_sync_failed_webhook_event.rbi +315 -0
  97. data/rbi/orb/models/credit_note_accounting_sync_succeeded_webhook_event.rbi +310 -0
  98. data/rbi/orb/models/credit_note_issued_webhook_event.rbi +98 -0
  99. data/rbi/orb/models/credit_note_marked_as_void_webhook_event.rbi +102 -0
  100. data/rbi/orb/models/customer_accounting_sync_failed_webhook_event.rbi +339 -0
  101. data/rbi/orb/models/customer_accounting_sync_succeeded_webhook_event.rbi +335 -0
  102. data/rbi/orb/models/customer_balance_transaction_created_webhook_event.rbi +437 -0
  103. data/rbi/orb/models/customer_created_webhook_event.rbi +128 -0
  104. data/rbi/orb/models/customer_credit_balance_depleted_webhook_event.rbi +1091 -0
  105. data/rbi/orb/models/customer_credit_balance_dropped_webhook_event.rbi +1096 -0
  106. data/rbi/orb/models/customer_credit_balance_recovered_webhook_event.rbi +1091 -0
  107. data/rbi/orb/models/customer_credit_ledger_incremented_webhook_event.rbi +987 -0
  108. data/rbi/orb/models/customer_edited_webhook_event.rbi +599 -0
  109. data/rbi/orb/models/data_exports_transfer_error_webhook_event.rbi +170 -0
  110. data/rbi/orb/models/data_exports_transfer_success_webhook_event.rbi +165 -0
  111. data/rbi/orb/models/event_unmatched_event_webhook_event.rbi +193 -0
  112. data/rbi/orb/models/ingestion_unmatched_customer_ids_webhook_event.rbi +132 -0
  113. data/rbi/orb/models/invoice_accounting_sync_failed_webhook_event.rbi +319 -0
  114. data/rbi/orb/models/invoice_accounting_sync_succeeded_webhook_event.rbi +312 -0
  115. data/rbi/orb/models/invoice_automation_schedule_step_executed_webhook_event.rbi +614 -0
  116. data/rbi/orb/models/invoice_cost_data_exported_webhook_event.rbi +144 -0
  117. data/rbi/orb/models/invoice_due_date_recalculation_canceled_webhook_event.rbi +139 -0
  118. data/rbi/orb/models/invoice_due_date_recalculation_completed_webhook_event.rbi +139 -0
  119. data/rbi/orb/models/invoice_due_date_recalculation_started_webhook_event.rbi +132 -0
  120. data/rbi/orb/models/invoice_dunning_schedule_created_webhook_event.rbi +331 -0
  121. data/rbi/orb/models/invoice_dunning_schedule_ended_webhook_event.rbi +324 -0
  122. data/rbi/orb/models/invoice_dunning_schedule_reset_webhook_event.rbi +329 -0
  123. data/rbi/orb/models/invoice_dunning_schedule_step_executed_webhook_event.rbi +250 -0
  124. data/rbi/orb/models/invoice_edited_webhook_event.rbi +942 -0
  125. data/rbi/orb/models/invoice_invoice_date_elapsed_webhook_event.rbi +251 -0
  126. data/rbi/orb/models/invoice_issue_failed_webhook_event.rbi +132 -0
  127. data/rbi/orb/models/invoice_issued_summary_webhook_event.rbi +1432 -0
  128. data/rbi/orb/models/invoice_issued_webhook_event.rbi +134 -0
  129. data/rbi/orb/models/invoice_manually_marked_as_paid_webhook_event.rbi +165 -0
  130. data/rbi/orb/models/invoice_manually_marked_as_void_webhook_event.rbi +114 -0
  131. data/rbi/orb/models/invoice_payment_failed_webhook_event.rbi +157 -0
  132. data/rbi/orb/models/invoice_payment_processing_webhook_event.rbi +156 -0
  133. data/rbi/orb/models/invoice_payment_succeeded_webhook_event.rbi +175 -0
  134. data/rbi/orb/models/invoice_sync_failed_webhook_event.rbi +147 -0
  135. data/rbi/orb/models/invoice_sync_succeeded_webhook_event.rbi +147 -0
  136. data/rbi/orb/models/invoice_undo_mark_as_paid_webhook_event.rbi +106 -0
  137. data/rbi/orb/models/metric_events_dropped_by_watermark_webhook_event.rbi +167 -0
  138. data/rbi/orb/models/payment_method_created_webhook_event.rbi +259 -0
  139. data/rbi/orb/models/payment_method_deleted_webhook_event.rbi +259 -0
  140. data/rbi/orb/models/plan_default_version_set_webhook_event.rbi +196 -0
  141. data/rbi/orb/models/plan_version_created_webhook_event.rbi +190 -0
  142. data/rbi/orb/models/price_edited_webhook_event.rbi +235 -0
  143. data/rbi/orb/models/resource_event_test_webhook_event.rbi +116 -0
  144. data/rbi/orb/models/sales_order_accounting_sync_failed_webhook_event.rbi +321 -0
  145. data/rbi/orb/models/sales_order_accounting_sync_succeeded_webhook_event.rbi +316 -0
  146. data/rbi/orb/models/subscription_accounting_sync_failed_webhook_event.rbi +353 -0
  147. data/rbi/orb/models/subscription_accounting_sync_succeeded_webhook_event.rbi +346 -0
  148. data/rbi/orb/models/subscription_alert_disabled_webhook_event.rbi +1232 -0
  149. data/rbi/orb/models/subscription_cancellation_scheduled_webhook_event.rbi +179 -0
  150. data/rbi/orb/models/subscription_cancellation_unscheduled_webhook_event.rbi +183 -0
  151. data/rbi/orb/models/subscription_cost_exceeded_webhook_event.rbi +1034 -0
  152. data/rbi/orb/models/subscription_created_webhook_event.rbi +132 -0
  153. data/rbi/orb/models/subscription_edited_webhook_event.rbi +247 -0
  154. data/rbi/orb/models/subscription_ended_webhook_event.rbi +132 -0
  155. data/rbi/orb/models/subscription_fixed_fee_quantity_updated_webhook_event.rbi +206 -0
  156. data/rbi/orb/models/subscription_grouped_cost_exceeded_webhook_event.rbi +1262 -0
  157. data/rbi/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rbi +374 -0
  158. data/rbi/orb/models/subscription_license_allocation_reset_webhook_event.rbi +421 -0
  159. data/rbi/orb/models/subscription_license_balance_threshold_reached_webhook_event.rbi +1265 -0
  160. data/rbi/orb/models/subscription_plan_change_scheduled_webhook_event.rbi +198 -0
  161. data/rbi/orb/models/subscription_plan_changed_webhook_event.rbi +169 -0
  162. data/rbi/orb/models/subscription_plan_version_change_scheduled_webhook_event.rbi +205 -0
  163. data/rbi/orb/models/subscription_plan_version_changed_webhook_event.rbi +199 -0
  164. data/rbi/orb/models/subscription_spend_exceeded_webhook_event.rbi +1035 -0
  165. data/rbi/orb/models/subscription_started_webhook_event.rbi +132 -0
  166. data/rbi/orb/models/subscription_trial_ended_webhook_event.rbi +136 -0
  167. data/rbi/orb/models/subscription_usage_exceeded_webhook_event.rbi +1041 -0
  168. data/rbi/orb/models/transaction_accounting_sync_failed_webhook_event.rbi +455 -0
  169. data/rbi/orb/models/transaction_accounting_sync_succeeded_webhook_event.rbi +449 -0
  170. data/rbi/orb/models/unwrap_webhook_event.rbi +99 -0
  171. data/rbi/orb/models/webhook_unwrap_params.rbi +25 -0
  172. data/rbi/orb/models.rbi +224 -0
  173. data/rbi/orb/resources/webhooks.rbi +103 -0
  174. data/sig/orb/client.rbs +2 -0
  175. data/sig/orb/models/backfill_reflected_webhook_event.rbs +130 -0
  176. data/sig/orb/models/backfill_reverted_webhook_event.rbs +130 -0
  177. data/sig/orb/models/billable_metric_edited_webhook_event.rbs +94 -0
  178. data/sig/orb/models/credit_block_accounting_sync_failed_webhook_event.rbs +412 -0
  179. data/sig/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbs +407 -0
  180. data/sig/orb/models/credit_note_accounting_sync_failed_webhook_event.rbs +147 -0
  181. data/sig/orb/models/credit_note_accounting_sync_succeeded_webhook_event.rbs +142 -0
  182. data/sig/orb/models/credit_note_issued_webhook_event.rbs +50 -0
  183. data/sig/orb/models/credit_note_marked_as_void_webhook_event.rbs +50 -0
  184. data/sig/orb/models/customer_accounting_sync_failed_webhook_event.rbs +142 -0
  185. data/sig/orb/models/customer_accounting_sync_succeeded_webhook_event.rbs +137 -0
  186. data/sig/orb/models/customer_balance_transaction_created_webhook_event.rbs +171 -0
  187. data/sig/orb/models/customer_created_webhook_event.rbs +50 -0
  188. data/sig/orb/models/customer_credit_balance_depleted_webhook_event.rbs +374 -0
  189. data/sig/orb/models/customer_credit_balance_dropped_webhook_event.rbs +379 -0
  190. data/sig/orb/models/customer_credit_balance_recovered_webhook_event.rbs +374 -0
  191. data/sig/orb/models/customer_credit_ledger_incremented_webhook_event.rbs +364 -0
  192. data/sig/orb/models/customer_edited_webhook_event.rbs +139 -0
  193. data/sig/orb/models/data_exports_transfer_error_webhook_event.rbs +92 -0
  194. data/sig/orb/models/data_exports_transfer_success_webhook_event.rbs +87 -0
  195. data/sig/orb/models/event_unmatched_event_webhook_event.rbs +102 -0
  196. data/sig/orb/models/ingestion_unmatched_customer_ids_webhook_event.rbs +55 -0
  197. data/sig/orb/models/invoice_accounting_sync_failed_webhook_event.rbs +147 -0
  198. data/sig/orb/models/invoice_accounting_sync_succeeded_webhook_event.rbs +142 -0
  199. data/sig/orb/models/invoice_automation_schedule_step_executed_webhook_event.rbs +313 -0
  200. data/sig/orb/models/invoice_cost_data_exported_webhook_event.rbs +73 -0
  201. data/sig/orb/models/invoice_due_date_recalculation_canceled_webhook_event.rbs +57 -0
  202. data/sig/orb/models/invoice_due_date_recalculation_completed_webhook_event.rbs +57 -0
  203. data/sig/orb/models/invoice_due_date_recalculation_started_webhook_event.rbs +55 -0
  204. data/sig/orb/models/invoice_dunning_schedule_created_webhook_event.rbs +171 -0
  205. data/sig/orb/models/invoice_dunning_schedule_ended_webhook_event.rbs +166 -0
  206. data/sig/orb/models/invoice_dunning_schedule_reset_webhook_event.rbs +156 -0
  207. data/sig/orb/models/invoice_dunning_schedule_step_executed_webhook_event.rbs +119 -0
  208. data/sig/orb/models/invoice_edited_webhook_event.rbs +388 -0
  209. data/sig/orb/models/invoice_invoice_date_elapsed_webhook_event.rbs +111 -0
  210. data/sig/orb/models/invoice_issue_failed_webhook_event.rbs +60 -0
  211. data/sig/orb/models/invoice_issued_summary_webhook_event.rbs +504 -0
  212. data/sig/orb/models/invoice_issued_webhook_event.rbs +60 -0
  213. data/sig/orb/models/invoice_manually_marked_as_paid_webhook_event.rbs +73 -0
  214. data/sig/orb/models/invoice_manually_marked_as_void_webhook_event.rbs +50 -0
  215. data/sig/orb/models/invoice_payment_failed_webhook_event.rbs +77 -0
  216. data/sig/orb/models/invoice_payment_processing_webhook_event.rbs +71 -0
  217. data/sig/orb/models/invoice_payment_succeeded_webhook_event.rbs +82 -0
  218. data/sig/orb/models/invoice_sync_failed_webhook_event.rbs +69 -0
  219. data/sig/orb/models/invoice_sync_succeeded_webhook_event.rbs +69 -0
  220. data/sig/orb/models/invoice_undo_mark_as_paid_webhook_event.rbs +50 -0
  221. data/sig/orb/models/metric_events_dropped_by_watermark_webhook_event.rbs +82 -0
  222. data/sig/orb/models/payment_method_created_webhook_event.rbs +112 -0
  223. data/sig/orb/models/payment_method_deleted_webhook_event.rbs +112 -0
  224. data/sig/orb/models/plan_default_version_set_webhook_event.rbs +94 -0
  225. data/sig/orb/models/plan_version_created_webhook_event.rbs +91 -0
  226. data/sig/orb/models/price_edited_webhook_event.rbs +77 -0
  227. data/sig/orb/models/resource_event_test_webhook_event.rbs +57 -0
  228. data/sig/orb/models/sales_order_accounting_sync_failed_webhook_event.rbs +147 -0
  229. data/sig/orb/models/sales_order_accounting_sync_succeeded_webhook_event.rbs +142 -0
  230. data/sig/orb/models/subscription_accounting_sync_failed_webhook_event.rbs +147 -0
  231. data/sig/orb/models/subscription_accounting_sync_succeeded_webhook_event.rbs +142 -0
  232. data/sig/orb/models/subscription_alert_disabled_webhook_event.rbs +444 -0
  233. data/sig/orb/models/subscription_cancellation_scheduled_webhook_event.rbs +60 -0
  234. data/sig/orb/models/subscription_cancellation_unscheduled_webhook_event.rbs +60 -0
  235. data/sig/orb/models/subscription_cost_exceeded_webhook_event.rbs +362 -0
  236. data/sig/orb/models/subscription_created_webhook_event.rbs +50 -0
  237. data/sig/orb/models/subscription_edited_webhook_event.rbs +109 -0
  238. data/sig/orb/models/subscription_ended_webhook_event.rbs +50 -0
  239. data/sig/orb/models/subscription_fixed_fee_quantity_updated_webhook_event.rbs +82 -0
  240. data/sig/orb/models/subscription_grouped_cost_exceeded_webhook_event.rbs +465 -0
  241. data/sig/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rbs +158 -0
  242. data/sig/orb/models/subscription_license_allocation_reset_webhook_event.rbs +180 -0
  243. data/sig/orb/models/subscription_license_balance_threshold_reached_webhook_event.rbs +460 -0
  244. data/sig/orb/models/subscription_plan_change_scheduled_webhook_event.rbs +73 -0
  245. data/sig/orb/models/subscription_plan_changed_webhook_event.rbs +60 -0
  246. data/sig/orb/models/subscription_plan_version_change_scheduled_webhook_event.rbs +77 -0
  247. data/sig/orb/models/subscription_plan_version_changed_webhook_event.rbs +77 -0
  248. data/sig/orb/models/subscription_spend_exceeded_webhook_event.rbs +362 -0
  249. data/sig/orb/models/subscription_started_webhook_event.rbs +50 -0
  250. data/sig/orb/models/subscription_trial_ended_webhook_event.rbs +50 -0
  251. data/sig/orb/models/subscription_usage_exceeded_webhook_event.rbs +367 -0
  252. data/sig/orb/models/transaction_accounting_sync_failed_webhook_event.rbs +205 -0
  253. data/sig/orb/models/transaction_accounting_sync_succeeded_webhook_event.rbs +200 -0
  254. data/sig/orb/models/unwrap_webhook_event.rbs +90 -0
  255. data/sig/orb/models/webhook_unwrap_params.rbs +14 -0
  256. data/sig/orb/models.rbs +162 -0
  257. data/sig/orb/resources/webhooks.rbs +89 -0
  258. metadata +247 -1
@@ -0,0 +1,942 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ class InvoiceEditedWebhookEvent < Orb::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Orb::InvoiceEditedWebhookEvent, Orb::Internal::AnyHash)
9
+ end
10
+
11
+ # The ID of this webhook event.
12
+ sig { returns(String) }
13
+ attr_accessor :id
14
+
15
+ # The time at which this event was created, to the second.
16
+ sig { returns(Time) }
17
+ attr_accessor :created_at
18
+
19
+ # An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity,
20
+ # representing the request for payment for a single subscription. This includes a
21
+ # set of line items, which correspond to prices in the subscription's plan and can
22
+ # represent fixed recurring fees or usage-based fees. They are generated at the
23
+ # end of a billing period, or as the result of an action, such as a cancellation.
24
+ sig { returns(Orb::Invoice) }
25
+ attr_reader :invoice
26
+
27
+ sig { params(invoice: Orb::Invoice::OrHash).void }
28
+ attr_writer :invoice
29
+
30
+ sig { returns(Orb::InvoiceEditedWebhookEvent::Properties) }
31
+ attr_reader :properties
32
+
33
+ sig do
34
+ params(
35
+ properties: Orb::InvoiceEditedWebhookEvent::Properties::OrHash
36
+ ).void
37
+ end
38
+ attr_writer :properties
39
+
40
+ # The event this payload describes.
41
+ sig { returns(Orb::InvoiceEditedWebhookEvent::Type::TaggedSymbol) }
42
+ attr_accessor :type
43
+
44
+ # Issued when a draft invoice has been edited.
45
+ sig do
46
+ params(
47
+ id: String,
48
+ created_at: Time,
49
+ invoice: Orb::Invoice::OrHash,
50
+ properties: Orb::InvoiceEditedWebhookEvent::Properties::OrHash,
51
+ type: Orb::InvoiceEditedWebhookEvent::Type::OrSymbol
52
+ ).returns(T.attached_class)
53
+ end
54
+ def self.new(
55
+ # The ID of this webhook event.
56
+ id:,
57
+ # The time at which this event was created, to the second.
58
+ created_at:,
59
+ # An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity,
60
+ # representing the request for payment for a single subscription. This includes a
61
+ # set of line items, which correspond to prices in the subscription's plan and can
62
+ # represent fixed recurring fees or usage-based fees. They are generated at the
63
+ # end of a billing period, or as the result of an action, such as a cancellation.
64
+ invoice:,
65
+ properties:,
66
+ # The event this payload describes.
67
+ type:
68
+ )
69
+ end
70
+
71
+ sig do
72
+ override.returns(
73
+ {
74
+ id: String,
75
+ created_at: Time,
76
+ invoice: Orb::Invoice,
77
+ properties: Orb::InvoiceEditedWebhookEvent::Properties,
78
+ type: Orb::InvoiceEditedWebhookEvent::Type::TaggedSymbol
79
+ }
80
+ )
81
+ end
82
+ def to_hash
83
+ end
84
+
85
+ class Properties < Orb::Internal::Type::BaseModel
86
+ OrHash =
87
+ T.type_alias do
88
+ T.any(
89
+ Orb::InvoiceEditedWebhookEvent::Properties,
90
+ Orb::Internal::AnyHash
91
+ )
92
+ end
93
+
94
+ # `due_date` is an ISO-8601 string rather than a datetime: the untyped message
95
+ # called `.isoformat()` on it, so it keeps microseconds where the webhook JSON
96
+ # provider would have truncated them.
97
+ sig do
98
+ returns(
99
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes
100
+ )
101
+ end
102
+ attr_reader :previous_attributes
103
+
104
+ sig do
105
+ params(
106
+ previous_attributes:
107
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::OrHash
108
+ ).void
109
+ end
110
+ attr_writer :previous_attributes
111
+
112
+ sig do
113
+ params(
114
+ previous_attributes:
115
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::OrHash
116
+ ).returns(T.attached_class)
117
+ end
118
+ def self.new(
119
+ # `due_date` is an ISO-8601 string rather than a datetime: the untyped message
120
+ # called `.isoformat()` on it, so it keeps microseconds where the webhook JSON
121
+ # provider would have truncated them.
122
+ previous_attributes:
123
+ )
124
+ end
125
+
126
+ sig do
127
+ override.returns(
128
+ {
129
+ previous_attributes:
130
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes
131
+ }
132
+ )
133
+ end
134
+ def to_hash
135
+ end
136
+
137
+ class PreviousAttributes < Orb::Internal::Type::BaseModel
138
+ OrHash =
139
+ T.type_alias do
140
+ T.any(
141
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes,
142
+ Orb::Internal::AnyHash
143
+ )
144
+ end
145
+
146
+ sig { returns(T.nilable(String)) }
147
+ attr_accessor :amount_due
148
+
149
+ sig do
150
+ returns(T.nilable(T::Array[Orb::InvoiceLevelDiscount::Variants]))
151
+ end
152
+ attr_accessor :discounts
153
+
154
+ sig { returns(T.nilable(String)) }
155
+ attr_accessor :due_date
156
+
157
+ sig do
158
+ returns(
159
+ T.nilable(
160
+ T::Array[
161
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem
162
+ ]
163
+ )
164
+ )
165
+ end
166
+ attr_accessor :line_items
167
+
168
+ sig { returns(T.nilable(Orb::Maximum)) }
169
+ attr_reader :maximum
170
+
171
+ sig { params(maximum: T.nilable(Orb::Maximum::OrHash)).void }
172
+ attr_writer :maximum
173
+
174
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
175
+ attr_accessor :metadata
176
+
177
+ sig { returns(T.nilable(Orb::Minimum)) }
178
+ attr_reader :minimum
179
+
180
+ sig { params(minimum: T.nilable(Orb::Minimum::OrHash)).void }
181
+ attr_writer :minimum
182
+
183
+ sig { returns(T.nilable(Integer)) }
184
+ attr_accessor :net_terms
185
+
186
+ sig { returns(T.nilable(String)) }
187
+ attr_accessor :subtotal
188
+
189
+ sig { returns(T.nilable(String)) }
190
+ attr_accessor :total
191
+
192
+ # `due_date` is an ISO-8601 string rather than a datetime: the untyped message
193
+ # called `.isoformat()` on it, so it keeps microseconds where the webhook JSON
194
+ # provider would have truncated them.
195
+ sig do
196
+ params(
197
+ amount_due: T.nilable(String),
198
+ discounts:
199
+ T.nilable(
200
+ T::Array[
201
+ T.any(
202
+ Orb::PercentageDiscount::OrHash,
203
+ Orb::AmountDiscount::OrHash,
204
+ Orb::TrialDiscount::OrHash,
205
+ Orb::InvoiceLevelDiscount::TieredPercentage::OrHash
206
+ )
207
+ ]
208
+ ),
209
+ due_date: T.nilable(String),
210
+ line_items:
211
+ T.nilable(
212
+ T::Array[
213
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::OrHash
214
+ ]
215
+ ),
216
+ maximum: T.nilable(Orb::Maximum::OrHash),
217
+ metadata: T.nilable(T::Hash[Symbol, String]),
218
+ minimum: T.nilable(Orb::Minimum::OrHash),
219
+ net_terms: T.nilable(Integer),
220
+ subtotal: T.nilable(String),
221
+ total: T.nilable(String)
222
+ ).returns(T.attached_class)
223
+ end
224
+ def self.new(
225
+ amount_due: nil,
226
+ discounts: nil,
227
+ due_date: nil,
228
+ line_items: nil,
229
+ maximum: nil,
230
+ metadata: nil,
231
+ minimum: nil,
232
+ net_terms: nil,
233
+ subtotal: nil,
234
+ total: nil
235
+ )
236
+ end
237
+
238
+ sig do
239
+ override.returns(
240
+ {
241
+ amount_due: T.nilable(String),
242
+ discounts:
243
+ T.nilable(T::Array[Orb::InvoiceLevelDiscount::Variants]),
244
+ due_date: T.nilable(String),
245
+ line_items:
246
+ T.nilable(
247
+ T::Array[
248
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem
249
+ ]
250
+ ),
251
+ maximum: T.nilable(Orb::Maximum),
252
+ metadata: T.nilable(T::Hash[Symbol, String]),
253
+ minimum: T.nilable(Orb::Minimum),
254
+ net_terms: T.nilable(Integer),
255
+ subtotal: T.nilable(String),
256
+ total: T.nilable(String)
257
+ }
258
+ )
259
+ end
260
+ def to_hash
261
+ end
262
+
263
+ class LineItem < Orb::Internal::Type::BaseModel
264
+ OrHash =
265
+ T.type_alias do
266
+ T.any(
267
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem,
268
+ Orb::Internal::AnyHash
269
+ )
270
+ end
271
+
272
+ # A unique ID for this line item.
273
+ sig { returns(String) }
274
+ attr_accessor :id
275
+
276
+ # The line amount after any adjustments and before overage conversion, credits and
277
+ # partial invoicing.
278
+ sig { returns(String) }
279
+ attr_accessor :adjusted_subtotal
280
+
281
+ # All adjustments applied to the line item in the order they were applied based on
282
+ # invoice calculations (ie. usage discounts -> amount discounts -> percentage
283
+ # discounts -> minimums -> maximums).
284
+ sig do
285
+ returns(
286
+ T::Array[
287
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::Variants
288
+ ]
289
+ )
290
+ end
291
+ attr_accessor :adjustments
292
+
293
+ # The final amount for a line item after all adjustments and pre paid credits have
294
+ # been applied.
295
+ sig { returns(String) }
296
+ attr_accessor :amount
297
+
298
+ # The number of prepaid credits applied.
299
+ sig { returns(String) }
300
+ attr_accessor :credits_applied
301
+
302
+ # The end date of the range of time applied for this line item's price.
303
+ sig { returns(Time) }
304
+ attr_accessor :end_date
305
+
306
+ # An additional filter that was used to calculate the usage for this line item.
307
+ sig { returns(T.nilable(String)) }
308
+ attr_accessor :filter
309
+
310
+ # [DEPRECATED] For configured prices that are split by a grouping key, this will
311
+ # be populated with the key and a value. The `amount` and `subtotal` will be the
312
+ # values for this particular grouping.
313
+ sig { returns(T.nilable(String)) }
314
+ attr_accessor :grouping
315
+
316
+ # The name of the price associated with this line item.
317
+ sig { returns(String) }
318
+ attr_accessor :name
319
+
320
+ # Any amount applied from a partial invoice
321
+ sig { returns(String) }
322
+ attr_accessor :partially_invoiced_amount
323
+
324
+ # The Price resource represents a price that can be billed on a subscription,
325
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
326
+ # take a quantity and determine an amount to bill.
327
+ #
328
+ # Orb supports a few different pricing models out of the box. Each of these models
329
+ # is serialized differently in a given Price object. The model_type field
330
+ # determines the key for the configuration object that is present.
331
+ #
332
+ # For more on the types of prices, see
333
+ # [the core concepts documentation](/core-concepts#plan-and-price)
334
+ sig { returns(Orb::Price::Variants) }
335
+ attr_accessor :price
336
+
337
+ # Either the fixed fee quantity or the usage during the service period.
338
+ sig { returns(Float) }
339
+ attr_accessor :quantity
340
+
341
+ # The start date of the range of time applied for this line item's price.
342
+ sig { returns(Time) }
343
+ attr_accessor :start_date
344
+
345
+ # For complex pricing structures, the line item can be broken down further in
346
+ # `sub_line_items`.
347
+ sig do
348
+ returns(
349
+ T::Array[
350
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::SubLineItem::Variants
351
+ ]
352
+ )
353
+ end
354
+ attr_accessor :sub_line_items
355
+
356
+ # The line amount before any adjustments.
357
+ sig { returns(String) }
358
+ attr_accessor :subtotal
359
+
360
+ # An array of tax rates and their incurred tax amounts. Empty if no tax
361
+ # integration is configured.
362
+ sig { returns(T::Array[Orb::TaxAmount]) }
363
+ attr_accessor :tax_amounts
364
+
365
+ # A list of customer ids that were used to calculate the usage for this line item.
366
+ sig { returns(T.nilable(T::Array[String])) }
367
+ attr_accessor :usage_customer_ids
368
+
369
+ sig do
370
+ params(
371
+ id: String,
372
+ adjusted_subtotal: String,
373
+ adjustments:
374
+ T::Array[
375
+ T.any(
376
+ Orb::MonetaryUsageDiscountAdjustment::OrHash,
377
+ Orb::MonetaryAmountDiscountAdjustment::OrHash,
378
+ Orb::MonetaryPercentageDiscountAdjustment::OrHash,
379
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::OrHash,
380
+ Orb::MonetaryMinimumAdjustment::OrHash,
381
+ Orb::MonetaryMaximumAdjustment::OrHash
382
+ )
383
+ ],
384
+ amount: String,
385
+ credits_applied: String,
386
+ end_date: Time,
387
+ filter: T.nilable(String),
388
+ grouping: T.nilable(String),
389
+ name: String,
390
+ partially_invoiced_amount: String,
391
+ price:
392
+ T.any(
393
+ Orb::Price::Unit::OrHash,
394
+ Orb::Price::Tiered::OrHash,
395
+ Orb::Price::Bulk::OrHash,
396
+ Orb::Price::BulkWithFilters::OrHash,
397
+ Orb::Price::Package::OrHash,
398
+ Orb::Price::Matrix::OrHash,
399
+ Orb::Price::ThresholdTotalAmount::OrHash,
400
+ Orb::Price::TieredPackage::OrHash,
401
+ Orb::Price::TieredWithMinimum::OrHash,
402
+ Orb::Price::GroupedTiered::OrHash,
403
+ Orb::Price::GroupedTieredMatrix::OrHash,
404
+ Orb::Price::TieredPackageWithMinimum::OrHash,
405
+ Orb::Price::PackageWithAllocation::OrHash,
406
+ Orb::Price::UnitWithPercent::OrHash,
407
+ Orb::Price::MatrixWithAllocation::OrHash,
408
+ Orb::Price::TieredMatrixWithAllocation::OrHash,
409
+ Orb::Price::MatrixWithThresholdDiscounts::OrHash,
410
+ Orb::Price::TieredWithProration::OrHash,
411
+ Orb::Price::UnitWithProration::OrHash,
412
+ Orb::Price::GroupedAllocation::OrHash,
413
+ Orb::Price::BulkWithProration::OrHash,
414
+ Orb::Price::GroupedWithProratedMinimum::OrHash,
415
+ Orb::Price::GroupedWithMeteredMinimum::OrHash,
416
+ Orb::Price::GroupedWithMinMaxThresholds::OrHash,
417
+ Orb::Price::MatrixWithDisplayName::OrHash,
418
+ Orb::Price::GroupedTieredPackage::OrHash,
419
+ Orb::Price::MaxGroupTieredPackage::OrHash,
420
+ Orb::Price::ScalableMatrixWithUnitPricing::OrHash,
421
+ Orb::Price::ScalableMatrixWithTieredPricing::OrHash,
422
+ Orb::Price::CumulativeGroupedBulk::OrHash,
423
+ Orb::Price::CumulativeGroupedAllocation::OrHash,
424
+ Orb::Price::DailyCreditAllowance::OrHash,
425
+ Orb::Price::MeteredAllowance::OrHash,
426
+ Orb::Price::MinimumComposite::OrHash,
427
+ Orb::Price::Percent::OrHash,
428
+ Orb::Price::EventOutput::OrHash
429
+ ),
430
+ quantity: Float,
431
+ start_date: Time,
432
+ sub_line_items:
433
+ T::Array[
434
+ T.any(
435
+ Orb::MatrixSubLineItem::OrHash,
436
+ Orb::TierSubLineItem::OrHash,
437
+ Orb::OtherSubLineItem::OrHash
438
+ )
439
+ ],
440
+ subtotal: String,
441
+ tax_amounts: T::Array[Orb::TaxAmount::OrHash],
442
+ usage_customer_ids: T.nilable(T::Array[String])
443
+ ).returns(T.attached_class)
444
+ end
445
+ def self.new(
446
+ # A unique ID for this line item.
447
+ id:,
448
+ # The line amount after any adjustments and before overage conversion, credits and
449
+ # partial invoicing.
450
+ adjusted_subtotal:,
451
+ # All adjustments applied to the line item in the order they were applied based on
452
+ # invoice calculations (ie. usage discounts -> amount discounts -> percentage
453
+ # discounts -> minimums -> maximums).
454
+ adjustments:,
455
+ # The final amount for a line item after all adjustments and pre paid credits have
456
+ # been applied.
457
+ amount:,
458
+ # The number of prepaid credits applied.
459
+ credits_applied:,
460
+ # The end date of the range of time applied for this line item's price.
461
+ end_date:,
462
+ # An additional filter that was used to calculate the usage for this line item.
463
+ filter:,
464
+ # [DEPRECATED] For configured prices that are split by a grouping key, this will
465
+ # be populated with the key and a value. The `amount` and `subtotal` will be the
466
+ # values for this particular grouping.
467
+ grouping:,
468
+ # The name of the price associated with this line item.
469
+ name:,
470
+ # Any amount applied from a partial invoice
471
+ partially_invoiced_amount:,
472
+ # The Price resource represents a price that can be billed on a subscription,
473
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
474
+ # take a quantity and determine an amount to bill.
475
+ #
476
+ # Orb supports a few different pricing models out of the box. Each of these models
477
+ # is serialized differently in a given Price object. The model_type field
478
+ # determines the key for the configuration object that is present.
479
+ #
480
+ # For more on the types of prices, see
481
+ # [the core concepts documentation](/core-concepts#plan-and-price)
482
+ price:,
483
+ # Either the fixed fee quantity or the usage during the service period.
484
+ quantity:,
485
+ # The start date of the range of time applied for this line item's price.
486
+ start_date:,
487
+ # For complex pricing structures, the line item can be broken down further in
488
+ # `sub_line_items`.
489
+ sub_line_items:,
490
+ # The line amount before any adjustments.
491
+ subtotal:,
492
+ # An array of tax rates and their incurred tax amounts. Empty if no tax
493
+ # integration is configured.
494
+ tax_amounts:,
495
+ # A list of customer ids that were used to calculate the usage for this line item.
496
+ usage_customer_ids:
497
+ )
498
+ end
499
+
500
+ sig do
501
+ override.returns(
502
+ {
503
+ id: String,
504
+ adjusted_subtotal: String,
505
+ adjustments:
506
+ T::Array[
507
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::Variants
508
+ ],
509
+ amount: String,
510
+ credits_applied: String,
511
+ end_date: Time,
512
+ filter: T.nilable(String),
513
+ grouping: T.nilable(String),
514
+ name: String,
515
+ partially_invoiced_amount: String,
516
+ price: Orb::Price::Variants,
517
+ quantity: Float,
518
+ start_date: Time,
519
+ sub_line_items:
520
+ T::Array[
521
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::SubLineItem::Variants
522
+ ],
523
+ subtotal: String,
524
+ tax_amounts: T::Array[Orb::TaxAmount],
525
+ usage_customer_ids: T.nilable(T::Array[String])
526
+ }
527
+ )
528
+ end
529
+ def to_hash
530
+ end
531
+
532
+ module Adjustment
533
+ extend Orb::Internal::Type::Union
534
+
535
+ Variants =
536
+ T.type_alias do
537
+ T.any(
538
+ Orb::MonetaryUsageDiscountAdjustment,
539
+ Orb::MonetaryAmountDiscountAdjustment,
540
+ Orb::MonetaryPercentageDiscountAdjustment,
541
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount,
542
+ Orb::MonetaryMinimumAdjustment,
543
+ Orb::MonetaryMaximumAdjustment
544
+ )
545
+ end
546
+
547
+ class TieredPercentageDiscount < Orb::Internal::Type::BaseModel
548
+ OrHash =
549
+ T.type_alias do
550
+ T.any(
551
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount,
552
+ Orb::Internal::AnyHash
553
+ )
554
+ end
555
+
556
+ sig { returns(String) }
557
+ attr_accessor :id
558
+
559
+ sig { returns(Symbol) }
560
+ attr_accessor :adjustment_type
561
+
562
+ # The value applied by an adjustment.
563
+ sig { returns(String) }
564
+ attr_accessor :amount
565
+
566
+ # The price IDs that this adjustment applies to.
567
+ sig { returns(T::Array[String]) }
568
+ attr_accessor :applies_to_price_ids
569
+
570
+ # The filters that determine which prices to apply this adjustment to.
571
+ sig do
572
+ returns(
573
+ T::Array[
574
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter
575
+ ]
576
+ )
577
+ end
578
+ attr_accessor :filters
579
+
580
+ # True for adjustments that apply to an entire invoice, false for adjustments that
581
+ # apply to only one price.
582
+ sig { returns(T::Boolean) }
583
+ attr_accessor :is_invoice_level
584
+
585
+ # The reason for the adjustment.
586
+ sig { returns(T.nilable(String)) }
587
+ attr_accessor :reason
588
+
589
+ # The adjustment id this adjustment replaces. This adjustment will take the place
590
+ # of the replaced adjustment in plan version migrations.
591
+ sig { returns(T.nilable(String)) }
592
+ attr_accessor :replaces_adjustment_id
593
+
594
+ # The ordered, contiguous bands of cumulative eligible spend, each discounted at
595
+ # its own percentage (progressive fill-a-tier), applied to the prices this
596
+ # adjustment covers in a given billing period.
597
+ sig do
598
+ returns(
599
+ T::Array[
600
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Tier
601
+ ]
602
+ )
603
+ end
604
+ attr_accessor :tiers
605
+
606
+ sig do
607
+ params(
608
+ id: String,
609
+ amount: String,
610
+ applies_to_price_ids: T::Array[String],
611
+ filters:
612
+ T::Array[
613
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::OrHash
614
+ ],
615
+ is_invoice_level: T::Boolean,
616
+ reason: T.nilable(String),
617
+ replaces_adjustment_id: T.nilable(String),
618
+ tiers:
619
+ T::Array[
620
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Tier::OrHash
621
+ ],
622
+ adjustment_type: Symbol
623
+ ).returns(T.attached_class)
624
+ end
625
+ def self.new(
626
+ id:,
627
+ # The value applied by an adjustment.
628
+ amount:,
629
+ # The price IDs that this adjustment applies to.
630
+ applies_to_price_ids:,
631
+ # The filters that determine which prices to apply this adjustment to.
632
+ filters:,
633
+ # True for adjustments that apply to an entire invoice, false for adjustments that
634
+ # apply to only one price.
635
+ is_invoice_level:,
636
+ # The reason for the adjustment.
637
+ reason:,
638
+ # The adjustment id this adjustment replaces. This adjustment will take the place
639
+ # of the replaced adjustment in plan version migrations.
640
+ replaces_adjustment_id:,
641
+ # The ordered, contiguous bands of cumulative eligible spend, each discounted at
642
+ # its own percentage (progressive fill-a-tier), applied to the prices this
643
+ # adjustment covers in a given billing period.
644
+ tiers:,
645
+ adjustment_type: :tiered_percentage_discount
646
+ )
647
+ end
648
+
649
+ sig do
650
+ override.returns(
651
+ {
652
+ id: String,
653
+ adjustment_type: Symbol,
654
+ amount: String,
655
+ applies_to_price_ids: T::Array[String],
656
+ filters:
657
+ T::Array[
658
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter
659
+ ],
660
+ is_invoice_level: T::Boolean,
661
+ reason: T.nilable(String),
662
+ replaces_adjustment_id: T.nilable(String),
663
+ tiers:
664
+ T::Array[
665
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Tier
666
+ ]
667
+ }
668
+ )
669
+ end
670
+ def to_hash
671
+ end
672
+
673
+ class Filter < Orb::Internal::Type::BaseModel
674
+ OrHash =
675
+ T.type_alias do
676
+ T.any(
677
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter,
678
+ Orb::Internal::AnyHash
679
+ )
680
+ end
681
+
682
+ # The property of the price to filter on.
683
+ sig do
684
+ returns(
685
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
686
+ )
687
+ end
688
+ attr_accessor :field
689
+
690
+ # Should prices that match the filter be included or excluded.
691
+ sig do
692
+ returns(
693
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator::TaggedSymbol
694
+ )
695
+ end
696
+ attr_accessor :operator
697
+
698
+ # The IDs or values that match this filter.
699
+ sig { returns(T::Array[String]) }
700
+ attr_accessor :values
701
+
702
+ sig do
703
+ params(
704
+ field:
705
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::OrSymbol,
706
+ operator:
707
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator::OrSymbol,
708
+ values: T::Array[String]
709
+ ).returns(T.attached_class)
710
+ end
711
+ def self.new(
712
+ # The property of the price to filter on.
713
+ field:,
714
+ # Should prices that match the filter be included or excluded.
715
+ operator:,
716
+ # The IDs or values that match this filter.
717
+ values:
718
+ )
719
+ end
720
+
721
+ sig do
722
+ override.returns(
723
+ {
724
+ field:
725
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol,
726
+ operator:
727
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator::TaggedSymbol,
728
+ values: T::Array[String]
729
+ }
730
+ )
731
+ end
732
+ def to_hash
733
+ end
734
+
735
+ # The property of the price to filter on.
736
+ module Field
737
+ extend Orb::Internal::Type::Enum
738
+
739
+ TaggedSymbol =
740
+ T.type_alias do
741
+ T.all(
742
+ Symbol,
743
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field
744
+ )
745
+ end
746
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
747
+
748
+ PRICE_ID =
749
+ T.let(
750
+ :price_id,
751
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
752
+ )
753
+ ITEM_ID =
754
+ T.let(
755
+ :item_id,
756
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
757
+ )
758
+ PRICE_TYPE =
759
+ T.let(
760
+ :price_type,
761
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
762
+ )
763
+ CURRENCY =
764
+ T.let(
765
+ :currency,
766
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
767
+ )
768
+ PRICING_UNIT_ID =
769
+ T.let(
770
+ :pricing_unit_id,
771
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
772
+ )
773
+
774
+ sig do
775
+ override.returns(
776
+ T::Array[
777
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
778
+ ]
779
+ )
780
+ end
781
+ def self.values
782
+ end
783
+ end
784
+
785
+ # Should prices that match the filter be included or excluded.
786
+ module Operator
787
+ extend Orb::Internal::Type::Enum
788
+
789
+ TaggedSymbol =
790
+ T.type_alias do
791
+ T.all(
792
+ Symbol,
793
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator
794
+ )
795
+ end
796
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
797
+
798
+ INCLUDES =
799
+ T.let(
800
+ :includes,
801
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator::TaggedSymbol
802
+ )
803
+ EXCLUDES =
804
+ T.let(
805
+ :excludes,
806
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator::TaggedSymbol
807
+ )
808
+
809
+ sig do
810
+ override.returns(
811
+ T::Array[
812
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator::TaggedSymbol
813
+ ]
814
+ )
815
+ end
816
+ def self.values
817
+ end
818
+ end
819
+ end
820
+
821
+ class Tier < Orb::Internal::Type::BaseModel
822
+ OrHash =
823
+ T.type_alias do
824
+ T.any(
825
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Tier,
826
+ Orb::Internal::AnyHash
827
+ )
828
+ end
829
+
830
+ # Exclusive lower bound of cumulative spend for this tier.
831
+ sig { returns(Float) }
832
+ attr_accessor :lower_bound
833
+
834
+ # The percentage (between 0 and 1) discounted from spend that falls within this
835
+ # tier.
836
+ sig { returns(Float) }
837
+ attr_accessor :percentage
838
+
839
+ # Inclusive upper bound of cumulative spend for this tier; null for the final
840
+ # open-ended tier.
841
+ sig { returns(T.nilable(Float)) }
842
+ attr_accessor :upper_bound
843
+
844
+ # One band of a tiered percentage discount. Bounds are denominated in the
845
+ # discount's currency. `lower_bound` is the exclusive start of the band and
846
+ # `upper_bound` is the inclusive end; `upper_bound` is null only for the
847
+ # open-ended final tier.
848
+ sig do
849
+ params(
850
+ lower_bound: Float,
851
+ percentage: Float,
852
+ upper_bound: T.nilable(Float)
853
+ ).returns(T.attached_class)
854
+ end
855
+ def self.new(
856
+ # Exclusive lower bound of cumulative spend for this tier.
857
+ lower_bound:,
858
+ # The percentage (between 0 and 1) discounted from spend that falls within this
859
+ # tier.
860
+ percentage:,
861
+ # Inclusive upper bound of cumulative spend for this tier; null for the final
862
+ # open-ended tier.
863
+ upper_bound: nil
864
+ )
865
+ end
866
+
867
+ sig do
868
+ override.returns(
869
+ {
870
+ lower_bound: Float,
871
+ percentage: Float,
872
+ upper_bound: T.nilable(Float)
873
+ }
874
+ )
875
+ end
876
+ def to_hash
877
+ end
878
+ end
879
+ end
880
+
881
+ sig do
882
+ override.returns(
883
+ T::Array[
884
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::Variants
885
+ ]
886
+ )
887
+ end
888
+ def self.variants
889
+ end
890
+ end
891
+
892
+ module SubLineItem
893
+ extend Orb::Internal::Type::Union
894
+
895
+ Variants =
896
+ T.type_alias do
897
+ T.any(
898
+ Orb::MatrixSubLineItem,
899
+ Orb::TierSubLineItem,
900
+ Orb::OtherSubLineItem
901
+ )
902
+ end
903
+
904
+ sig do
905
+ override.returns(
906
+ T::Array[
907
+ Orb::InvoiceEditedWebhookEvent::Properties::PreviousAttributes::LineItem::SubLineItem::Variants
908
+ ]
909
+ )
910
+ end
911
+ def self.variants
912
+ end
913
+ end
914
+ end
915
+ end
916
+ end
917
+
918
+ # The event this payload describes.
919
+ module Type
920
+ extend Orb::Internal::Type::Enum
921
+
922
+ TaggedSymbol =
923
+ T.type_alias { T.all(Symbol, Orb::InvoiceEditedWebhookEvent::Type) }
924
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
925
+
926
+ INVOICE_EDITED =
927
+ T.let(
928
+ :"invoice.edited",
929
+ Orb::InvoiceEditedWebhookEvent::Type::TaggedSymbol
930
+ )
931
+
932
+ sig do
933
+ override.returns(
934
+ T::Array[Orb::InvoiceEditedWebhookEvent::Type::TaggedSymbol]
935
+ )
936
+ end
937
+ def self.values
938
+ end
939
+ end
940
+ end
941
+ end
942
+ end