orb-billing 1.45.0 → 1.46.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 (264) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -1
  3. data/README.md +1 -1
  4. data/lib/orb/models/webhooks/backfill_reflected_standard_webhook_event.rb +206 -0
  5. data/lib/orb/models/webhooks/backfill_reverted_standard_webhook_event.rb +206 -0
  6. data/lib/orb/models/webhooks/billable_metric_edited_standard_webhook_event.rb +131 -0
  7. data/lib/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rb +537 -0
  8. data/lib/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rb +531 -0
  9. data/lib/orb/models/webhooks/credit_note_accounting_sync_failed_standard_webhook_event.rb +188 -0
  10. data/lib/orb/models/webhooks/credit_note_accounting_sync_succeeded_standard_webhook_event.rb +183 -0
  11. data/lib/orb/models/webhooks/credit_note_issued_standard_webhook_event.rb +90 -0
  12. data/lib/orb/models/webhooks/credit_note_marked_as_void_standard_webhook_event.rb +92 -0
  13. data/lib/orb/models/webhooks/customer_accounting_sync_failed_standard_webhook_event.rb +198 -0
  14. data/lib/orb/models/webhooks/customer_accounting_sync_succeeded_standard_webhook_event.rb +193 -0
  15. data/lib/orb/models/webhooks/customer_balance_transaction_created_standard_webhook_event.rb +240 -0
  16. data/lib/orb/models/webhooks/customer_created_standard_webhook_event.rb +106 -0
  17. data/lib/orb/models/webhooks/customer_credit_balance_depleted_standard_webhook_event.rb +597 -0
  18. data/lib/orb/models/webhooks/customer_credit_balance_dropped_standard_webhook_event.rb +603 -0
  19. data/lib/orb/models/webhooks/customer_credit_balance_recovered_standard_webhook_event.rb +597 -0
  20. data/lib/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rb +509 -0
  21. data/lib/orb/models/webhooks/customer_edited_standard_webhook_event.rb +371 -0
  22. data/lib/orb/models/webhooks/data_exports_transfer_error_standard_webhook_event.rb +130 -0
  23. data/lib/orb/models/webhooks/data_exports_transfer_success_standard_webhook_event.rb +124 -0
  24. data/lib/orb/models/webhooks/event_unmatched_event_standard_webhook_event.rb +134 -0
  25. data/lib/orb/models/webhooks/ingestion_unmatched_customer_ids_standard_webhook_event.rb +94 -0
  26. data/lib/orb/models/webhooks/invoice_accounting_sync_failed_standard_webhook_event.rb +972 -0
  27. data/lib/orb/models/webhooks/invoice_accounting_sync_succeeded_standard_webhook_event.rb +966 -0
  28. data/lib/orb/models/webhooks/invoice_automation_schedule_step_executed_standard_webhook_event.rb +367 -0
  29. data/lib/orb/models/webhooks/invoice_cost_data_exported_standard_webhook_event.rb +113 -0
  30. data/lib/orb/models/webhooks/invoice_due_date_recalculation_canceled_standard_webhook_event.rb +101 -0
  31. data/lib/orb/models/webhooks/invoice_due_date_recalculation_completed_standard_webhook_event.rb +101 -0
  32. data/lib/orb/models/webhooks/invoice_due_date_recalculation_started_standard_webhook_event.rb +95 -0
  33. data/lib/orb/models/webhooks/invoice_dunning_schedule_created_standard_webhook_event.rb +994 -0
  34. data/lib/orb/models/webhooks/invoice_dunning_schedule_ended_standard_webhook_event.rb +988 -0
  35. data/lib/orb/models/webhooks/invoice_dunning_schedule_reset_standard_webhook_event.rb +992 -0
  36. data/lib/orb/models/webhooks/invoice_dunning_schedule_step_executed_standard_webhook_event.rb +942 -0
  37. data/lib/orb/models/webhooks/invoice_edited_standard_webhook_event.rb +1365 -0
  38. data/lib/orb/models/webhooks/invoice_invoice_date_elapsed_standard_webhook_event.rb +151 -0
  39. data/lib/orb/models/webhooks/invoice_issue_failed_standard_webhook_event.rb +885 -0
  40. data/lib/orb/models/webhooks/invoice_issued_standard_webhook_event.rb +884 -0
  41. data/lib/orb/models/webhooks/invoice_issued_summary_standard_webhook_event.rb +887 -0
  42. data/lib/orb/models/webhooks/invoice_manually_marked_as_paid_standard_webhook_event.rb +899 -0
  43. data/lib/orb/models/webhooks/invoice_manually_marked_as_void_standard_webhook_event.rb +876 -0
  44. data/lib/orb/models/webhooks/invoice_payment_failed_standard_webhook_event.rb +899 -0
  45. data/lib/orb/models/webhooks/invoice_payment_processing_standard_webhook_event.rb +893 -0
  46. data/lib/orb/models/webhooks/invoice_payment_succeeded_standard_webhook_event.rb +908 -0
  47. data/lib/orb/models/webhooks/invoice_sync_failed_standard_webhook_event.rb +890 -0
  48. data/lib/orb/models/webhooks/invoice_sync_succeeded_standard_webhook_event.rb +892 -0
  49. data/lib/orb/models/webhooks/invoice_undo_mark_as_paid_standard_webhook_event.rb +875 -0
  50. data/lib/orb/models/webhooks/metric_events_dropped_by_watermark_standard_webhook_event.rb +125 -0
  51. data/lib/orb/models/webhooks/payment_method_created_standard_webhook_event.rb +184 -0
  52. data/lib/orb/models/webhooks/payment_method_deleted_standard_webhook_event.rb +184 -0
  53. data/lib/orb/models/webhooks/plan_created_standard_webhook_event.rb +119 -0
  54. data/lib/orb/models/webhooks/plan_default_version_set_standard_webhook_event.rb +139 -0
  55. data/lib/orb/models/webhooks/plan_edited_standard_webhook_event.rb +159 -0
  56. data/lib/orb/models/webhooks/plan_version_created_standard_webhook_event.rb +138 -0
  57. data/lib/orb/models/webhooks/price_edited_standard_webhook_event.rb +132 -0
  58. data/lib/orb/models/webhooks/resource_event_test_standard_webhook_event.rb +92 -0
  59. data/lib/orb/models/webhooks/sales_order_accounting_sync_failed_standard_webhook_event.rb +972 -0
  60. data/lib/orb/models/webhooks/sales_order_accounting_sync_succeeded_standard_webhook_event.rb +967 -0
  61. data/lib/orb/models/webhooks/standard_unwrap_standard_params.rb +16 -0
  62. data/lib/orb/models/webhooks/subscription_accounting_sync_failed_standard_webhook_event.rb +322 -0
  63. data/lib/orb/models/webhooks/subscription_accounting_sync_succeeded_standard_webhook_event.rb +316 -0
  64. data/lib/orb/models/webhooks/subscription_alert_disabled_standard_webhook_event.rb +667 -0
  65. data/lib/orb/models/webhooks/subscription_cancellation_scheduled_standard_webhook_event.rb +237 -0
  66. data/lib/orb/models/webhooks/subscription_cancellation_unscheduled_standard_webhook_event.rb +237 -0
  67. data/lib/orb/models/webhooks/subscription_cost_exceeded_standard_webhook_event.rb +692 -0
  68. data/lib/orb/models/webhooks/subscription_created_standard_webhook_event.rb +221 -0
  69. data/lib/orb/models/webhooks/subscription_edited_standard_webhook_event.rb +273 -0
  70. data/lib/orb/models/webhooks/subscription_ended_standard_webhook_event.rb +219 -0
  71. data/lib/orb/models/webhooks/subscription_fixed_fee_quantity_updated_standard_webhook_event.rb +255 -0
  72. data/lib/orb/models/webhooks/subscription_grouped_cost_exceeded_standard_webhook_event.rb +693 -0
  73. data/lib/orb/models/webhooks/subscription_invoicing_threshold_exceeded_standard_webhook_event.rb +222 -0
  74. data/lib/orb/models/webhooks/subscription_license_allocation_reset_standard_webhook_event.rb +244 -0
  75. data/lib/orb/models/webhooks/subscription_license_balance_threshold_reached_standard_webhook_event.rb +687 -0
  76. data/lib/orb/models/webhooks/subscription_plan_change_scheduled_standard_webhook_event.rb +249 -0
  77. data/lib/orb/models/webhooks/subscription_plan_changed_standard_webhook_event.rb +233 -0
  78. data/lib/orb/models/webhooks/subscription_plan_version_change_scheduled_standard_webhook_event.rb +250 -0
  79. data/lib/orb/models/webhooks/subscription_plan_version_changed_standard_webhook_event.rb +248 -0
  80. data/lib/orb/models/webhooks/subscription_spend_exceeded_standard_webhook_event.rb +693 -0
  81. data/lib/orb/models/webhooks/subscription_started_standard_webhook_event.rb +221 -0
  82. data/lib/orb/models/webhooks/subscription_trial_ended_standard_webhook_event.rb +222 -0
  83. data/lib/orb/models/webhooks/subscription_usage_exceeded_standard_webhook_event.rb +700 -0
  84. data/lib/orb/models/webhooks/transaction_accounting_sync_failed_standard_webhook_event.rb +270 -0
  85. data/lib/orb/models/webhooks/transaction_accounting_sync_succeeded_standard_webhook_event.rb +264 -0
  86. data/lib/orb/models/webhooks/unwrap_standard_webhook_event.rb +258 -0
  87. data/lib/orb/models.rb +2 -0
  88. data/lib/orb/resources/webhooks/standard.rb +24 -0
  89. data/lib/orb/resources/webhooks.rb +4 -0
  90. data/lib/orb/version.rb +1 -1
  91. data/lib/orb.rb +84 -0
  92. data/rbi/orb/models/webhooks/backfill_reflected_standard_webhook_event.rbi +349 -0
  93. data/rbi/orb/models/webhooks/backfill_reverted_standard_webhook_event.rbi +347 -0
  94. data/rbi/orb/models/webhooks/billable_metric_edited_standard_webhook_event.rbi +273 -0
  95. data/rbi/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rbi +1106 -0
  96. data/rbi/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rbi +1095 -0
  97. data/rbi/orb/models/webhooks/credit_note_accounting_sync_failed_standard_webhook_event.rbi +377 -0
  98. data/rbi/orb/models/webhooks/credit_note_accounting_sync_succeeded_standard_webhook_event.rbi +366 -0
  99. data/rbi/orb/models/webhooks/credit_note_issued_standard_webhook_event.rbi +166 -0
  100. data/rbi/orb/models/webhooks/credit_note_marked_as_void_standard_webhook_event.rbi +166 -0
  101. data/rbi/orb/models/webhooks/customer_accounting_sync_failed_standard_webhook_event.rbi +403 -0
  102. data/rbi/orb/models/webhooks/customer_accounting_sync_succeeded_standard_webhook_event.rbi +392 -0
  103. data/rbi/orb/models/webhooks/customer_balance_transaction_created_standard_webhook_event.rbi +493 -0
  104. data/rbi/orb/models/webhooks/customer_created_standard_webhook_event.rbi +198 -0
  105. data/rbi/orb/models/webhooks/customer_credit_balance_depleted_standard_webhook_event.rbi +1151 -0
  106. data/rbi/orb/models/webhooks/customer_credit_balance_dropped_standard_webhook_event.rbi +1158 -0
  107. data/rbi/orb/models/webhooks/customer_credit_balance_recovered_standard_webhook_event.rbi +1151 -0
  108. data/rbi/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rbi +1044 -0
  109. data/rbi/orb/models/webhooks/customer_edited_standard_webhook_event.rbi +678 -0
  110. data/rbi/orb/models/webhooks/data_exports_transfer_error_standard_webhook_event.rbi +236 -0
  111. data/rbi/orb/models/webhooks/data_exports_transfer_success_standard_webhook_event.rbi +230 -0
  112. data/rbi/orb/models/webhooks/event_unmatched_event_standard_webhook_event.rbi +275 -0
  113. data/rbi/orb/models/webhooks/ingestion_unmatched_customer_ids_standard_webhook_event.rbi +192 -0
  114. data/rbi/orb/models/webhooks/invoice_accounting_sync_failed_standard_webhook_event.rbi +1705 -0
  115. data/rbi/orb/models/webhooks/invoice_accounting_sync_succeeded_standard_webhook_event.rbi +1694 -0
  116. data/rbi/orb/models/webhooks/invoice_automation_schedule_step_executed_standard_webhook_event.rbi +670 -0
  117. data/rbi/orb/models/webhooks/invoice_cost_data_exported_standard_webhook_event.rbi +210 -0
  118. data/rbi/orb/models/webhooks/invoice_due_date_recalculation_canceled_standard_webhook_event.rbi +195 -0
  119. data/rbi/orb/models/webhooks/invoice_due_date_recalculation_completed_standard_webhook_event.rbi +195 -0
  120. data/rbi/orb/models/webhooks/invoice_due_date_recalculation_started_standard_webhook_event.rbi +188 -0
  121. data/rbi/orb/models/webhooks/invoice_dunning_schedule_created_standard_webhook_event.rbi +1713 -0
  122. data/rbi/orb/models/webhooks/invoice_dunning_schedule_ended_standard_webhook_event.rbi +1708 -0
  123. data/rbi/orb/models/webhooks/invoice_dunning_schedule_reset_standard_webhook_event.rbi +1713 -0
  124. data/rbi/orb/models/webhooks/invoice_dunning_schedule_step_executed_standard_webhook_event.rbi +1628 -0
  125. data/rbi/orb/models/webhooks/invoice_edited_standard_webhook_event.rbi +2337 -0
  126. data/rbi/orb/models/webhooks/invoice_invoice_date_elapsed_standard_webhook_event.rbi +324 -0
  127. data/rbi/orb/models/webhooks/invoice_issue_failed_standard_webhook_event.rbi +1529 -0
  128. data/rbi/orb/models/webhooks/invoice_issued_standard_webhook_event.rbi +1529 -0
  129. data/rbi/orb/models/webhooks/invoice_issued_summary_standard_webhook_event.rbi +1534 -0
  130. data/rbi/orb/models/webhooks/invoice_manually_marked_as_paid_standard_webhook_event.rbi +1549 -0
  131. data/rbi/orb/models/webhooks/invoice_manually_marked_as_void_standard_webhook_event.rbi +1494 -0
  132. data/rbi/orb/models/webhooks/invoice_payment_failed_standard_webhook_event.rbi +1554 -0
  133. data/rbi/orb/models/webhooks/invoice_payment_processing_standard_webhook_event.rbi +1547 -0
  134. data/rbi/orb/models/webhooks/invoice_payment_succeeded_standard_webhook_event.rbi +1563 -0
  135. data/rbi/orb/models/webhooks/invoice_sync_failed_standard_webhook_event.rbi +1542 -0
  136. data/rbi/orb/models/webhooks/invoice_sync_succeeded_standard_webhook_event.rbi +1544 -0
  137. data/rbi/orb/models/webhooks/invoice_undo_mark_as_paid_standard_webhook_event.rbi +1494 -0
  138. data/rbi/orb/models/webhooks/metric_events_dropped_by_watermark_standard_webhook_event.rbi +233 -0
  139. data/rbi/orb/models/webhooks/payment_method_created_standard_webhook_event.rbi +331 -0
  140. data/rbi/orb/models/webhooks/payment_method_deleted_standard_webhook_event.rbi +331 -0
  141. data/rbi/orb/models/webhooks/plan_created_standard_webhook_event.rbi +216 -0
  142. data/rbi/orb/models/webhooks/plan_default_version_set_standard_webhook_event.rbi +277 -0
  143. data/rbi/orb/models/webhooks/plan_edited_standard_webhook_event.rbi +337 -0
  144. data/rbi/orb/models/webhooks/plan_version_created_standard_webhook_event.rbi +271 -0
  145. data/rbi/orb/models/webhooks/price_edited_standard_webhook_event.rbi +311 -0
  146. data/rbi/orb/models/webhooks/resource_event_test_standard_webhook_event.rbi +191 -0
  147. data/rbi/orb/models/webhooks/sales_order_accounting_sync_failed_standard_webhook_event.rbi +1705 -0
  148. data/rbi/orb/models/webhooks/sales_order_accounting_sync_succeeded_standard_webhook_event.rbi +1694 -0
  149. data/rbi/orb/models/webhooks/standard_unwrap_standard_params.rbi +32 -0
  150. data/rbi/orb/models/webhooks/subscription_accounting_sync_failed_standard_webhook_event.rbi +609 -0
  151. data/rbi/orb/models/webhooks/subscription_accounting_sync_succeeded_standard_webhook_event.rbi +598 -0
  152. data/rbi/orb/models/webhooks/subscription_alert_disabled_standard_webhook_event.rbi +1302 -0
  153. data/rbi/orb/models/webhooks/subscription_cancellation_scheduled_standard_webhook_event.rbi +433 -0
  154. data/rbi/orb/models/webhooks/subscription_cancellation_unscheduled_standard_webhook_event.rbi +435 -0
  155. data/rbi/orb/models/webhooks/subscription_cost_exceeded_standard_webhook_event.rbi +1298 -0
  156. data/rbi/orb/models/webhooks/subscription_created_standard_webhook_event.rbi +398 -0
  157. data/rbi/orb/models/webhooks/subscription_edited_standard_webhook_event.rbi +520 -0
  158. data/rbi/orb/models/webhooks/subscription_ended_standard_webhook_event.rbi +398 -0
  159. data/rbi/orb/models/webhooks/subscription_fixed_fee_quantity_updated_standard_webhook_event.rbi +458 -0
  160. data/rbi/orb/models/webhooks/subscription_grouped_cost_exceeded_standard_webhook_event.rbi +1321 -0
  161. data/rbi/orb/models/webhooks/subscription_invoicing_threshold_exceeded_standard_webhook_event.rbi +428 -0
  162. data/rbi/orb/models/webhooks/subscription_license_allocation_reset_standard_webhook_event.rbi +477 -0
  163. data/rbi/orb/models/webhooks/subscription_license_balance_threshold_reached_standard_webhook_event.rbi +1319 -0
  164. data/rbi/orb/models/webhooks/subscription_plan_change_scheduled_standard_webhook_event.rbi +453 -0
  165. data/rbi/orb/models/webhooks/subscription_plan_changed_standard_webhook_event.rbi +433 -0
  166. data/rbi/orb/models/webhooks/subscription_plan_version_change_scheduled_standard_webhook_event.rbi +457 -0
  167. data/rbi/orb/models/webhooks/subscription_plan_version_changed_standard_webhook_event.rbi +457 -0
  168. data/rbi/orb/models/webhooks/subscription_spend_exceeded_standard_webhook_event.rbi +1299 -0
  169. data/rbi/orb/models/webhooks/subscription_started_standard_webhook_event.rbi +398 -0
  170. data/rbi/orb/models/webhooks/subscription_trial_ended_standard_webhook_event.rbi +398 -0
  171. data/rbi/orb/models/webhooks/subscription_usage_exceeded_standard_webhook_event.rbi +1305 -0
  172. data/rbi/orb/models/webhooks/transaction_accounting_sync_failed_standard_webhook_event.rbi +516 -0
  173. data/rbi/orb/models/webhooks/transaction_accounting_sync_succeeded_standard_webhook_event.rbi +505 -0
  174. data/rbi/orb/models/webhooks/unwrap_standard_webhook_event.rbi +107 -0
  175. data/rbi/orb/models.rbi +2 -0
  176. data/rbi/orb/resources/webhooks/standard.rbi +107 -0
  177. data/rbi/orb/resources/webhooks.rbi +3 -0
  178. data/sig/orb/models/webhooks/backfill_reflected_standard_webhook_event.rbs +148 -0
  179. data/sig/orb/models/webhooks/backfill_reverted_standard_webhook_event.rbs +148 -0
  180. data/sig/orb/models/webhooks/billable_metric_edited_standard_webhook_event.rbs +112 -0
  181. data/sig/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rbs +435 -0
  182. data/sig/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rbs +430 -0
  183. data/sig/orb/models/webhooks/credit_note_accounting_sync_failed_standard_webhook_event.rbs +165 -0
  184. data/sig/orb/models/webhooks/credit_note_accounting_sync_succeeded_standard_webhook_event.rbs +160 -0
  185. data/sig/orb/models/webhooks/credit_note_issued_standard_webhook_event.rbs +68 -0
  186. data/sig/orb/models/webhooks/credit_note_marked_as_void_standard_webhook_event.rbs +68 -0
  187. data/sig/orb/models/webhooks/customer_accounting_sync_failed_standard_webhook_event.rbs +160 -0
  188. data/sig/orb/models/webhooks/customer_accounting_sync_succeeded_standard_webhook_event.rbs +155 -0
  189. data/sig/orb/models/webhooks/customer_balance_transaction_created_standard_webhook_event.rbs +189 -0
  190. data/sig/orb/models/webhooks/customer_created_standard_webhook_event.rbs +68 -0
  191. data/sig/orb/models/webhooks/customer_credit_balance_depleted_standard_webhook_event.rbs +396 -0
  192. data/sig/orb/models/webhooks/customer_credit_balance_dropped_standard_webhook_event.rbs +401 -0
  193. data/sig/orb/models/webhooks/customer_credit_balance_recovered_standard_webhook_event.rbs +396 -0
  194. data/sig/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rbs +386 -0
  195. data/sig/orb/models/webhooks/customer_edited_standard_webhook_event.rbs +157 -0
  196. data/sig/orb/models/webhooks/data_exports_transfer_error_standard_webhook_event.rbs +110 -0
  197. data/sig/orb/models/webhooks/data_exports_transfer_success_standard_webhook_event.rbs +105 -0
  198. data/sig/orb/models/webhooks/event_unmatched_event_standard_webhook_event.rbs +122 -0
  199. data/sig/orb/models/webhooks/ingestion_unmatched_customer_ids_standard_webhook_event.rbs +73 -0
  200. data/sig/orb/models/webhooks/invoice_accounting_sync_failed_standard_webhook_event.rbs +614 -0
  201. data/sig/orb/models/webhooks/invoice_accounting_sync_succeeded_standard_webhook_event.rbs +609 -0
  202. data/sig/orb/models/webhooks/invoice_automation_schedule_step_executed_standard_webhook_event.rbs +331 -0
  203. data/sig/orb/models/webhooks/invoice_cost_data_exported_standard_webhook_event.rbs +91 -0
  204. data/sig/orb/models/webhooks/invoice_due_date_recalculation_canceled_standard_webhook_event.rbs +75 -0
  205. data/sig/orb/models/webhooks/invoice_due_date_recalculation_completed_standard_webhook_event.rbs +75 -0
  206. data/sig/orb/models/webhooks/invoice_due_date_recalculation_started_standard_webhook_event.rbs +73 -0
  207. data/sig/orb/models/webhooks/invoice_dunning_schedule_created_standard_webhook_event.rbs +638 -0
  208. data/sig/orb/models/webhooks/invoice_dunning_schedule_ended_standard_webhook_event.rbs +633 -0
  209. data/sig/orb/models/webhooks/invoice_dunning_schedule_reset_standard_webhook_event.rbs +623 -0
  210. data/sig/orb/models/webhooks/invoice_dunning_schedule_step_executed_standard_webhook_event.rbs +586 -0
  211. data/sig/orb/models/webhooks/invoice_edited_standard_webhook_event.rbs +859 -0
  212. data/sig/orb/models/webhooks/invoice_invoice_date_elapsed_standard_webhook_event.rbs +129 -0
  213. data/sig/orb/models/webhooks/invoice_issue_failed_standard_webhook_event.rbs +527 -0
  214. data/sig/orb/models/webhooks/invoice_issued_standard_webhook_event.rbs +527 -0
  215. data/sig/orb/models/webhooks/invoice_issued_summary_standard_webhook_event.rbs +527 -0
  216. data/sig/orb/models/webhooks/invoice_manually_marked_as_paid_standard_webhook_event.rbs +540 -0
  217. data/sig/orb/models/webhooks/invoice_manually_marked_as_void_standard_webhook_event.rbs +517 -0
  218. data/sig/orb/models/webhooks/invoice_payment_failed_standard_webhook_event.rbs +544 -0
  219. data/sig/orb/models/webhooks/invoice_payment_processing_standard_webhook_event.rbs +538 -0
  220. data/sig/orb/models/webhooks/invoice_payment_succeeded_standard_webhook_event.rbs +549 -0
  221. data/sig/orb/models/webhooks/invoice_sync_failed_standard_webhook_event.rbs +536 -0
  222. data/sig/orb/models/webhooks/invoice_sync_succeeded_standard_webhook_event.rbs +536 -0
  223. data/sig/orb/models/webhooks/invoice_undo_mark_as_paid_standard_webhook_event.rbs +517 -0
  224. data/sig/orb/models/webhooks/metric_events_dropped_by_watermark_standard_webhook_event.rbs +100 -0
  225. data/sig/orb/models/webhooks/payment_method_created_standard_webhook_event.rbs +130 -0
  226. data/sig/orb/models/webhooks/payment_method_deleted_standard_webhook_event.rbs +130 -0
  227. data/sig/orb/models/webhooks/plan_created_standard_webhook_event.rbs +90 -0
  228. data/sig/orb/models/webhooks/plan_default_version_set_standard_webhook_event.rbs +112 -0
  229. data/sig/orb/models/webhooks/plan_edited_standard_webhook_event.rbs +134 -0
  230. data/sig/orb/models/webhooks/plan_version_created_standard_webhook_event.rbs +109 -0
  231. data/sig/orb/models/webhooks/price_edited_standard_webhook_event.rbs +95 -0
  232. data/sig/orb/models/webhooks/resource_event_test_standard_webhook_event.rbs +75 -0
  233. data/sig/orb/models/webhooks/sales_order_accounting_sync_failed_standard_webhook_event.rbs +614 -0
  234. data/sig/orb/models/webhooks/sales_order_accounting_sync_succeeded_standard_webhook_event.rbs +609 -0
  235. data/sig/orb/models/webhooks/standard_unwrap_standard_params.rbs +17 -0
  236. data/sig/orb/models/webhooks/subscription_accounting_sync_failed_standard_webhook_event.rbs +256 -0
  237. data/sig/orb/models/webhooks/subscription_accounting_sync_succeeded_standard_webhook_event.rbs +251 -0
  238. data/sig/orb/models/webhooks/subscription_alert_disabled_standard_webhook_event.rbs +466 -0
  239. data/sig/orb/models/webhooks/subscription_cancellation_scheduled_standard_webhook_event.rbs +169 -0
  240. data/sig/orb/models/webhooks/subscription_cancellation_unscheduled_standard_webhook_event.rbs +169 -0
  241. data/sig/orb/models/webhooks/subscription_cost_exceeded_standard_webhook_event.rbs +475 -0
  242. data/sig/orb/models/webhooks/subscription_created_standard_webhook_event.rbs +159 -0
  243. data/sig/orb/models/webhooks/subscription_edited_standard_webhook_event.rbs +218 -0
  244. data/sig/orb/models/webhooks/subscription_ended_standard_webhook_event.rbs +159 -0
  245. data/sig/orb/models/webhooks/subscription_fixed_fee_quantity_updated_standard_webhook_event.rbs +191 -0
  246. data/sig/orb/models/webhooks/subscription_grouped_cost_exceeded_standard_webhook_event.rbs +487 -0
  247. data/sig/orb/models/webhooks/subscription_invoicing_threshold_exceeded_standard_webhook_event.rbs +176 -0
  248. data/sig/orb/models/webhooks/subscription_license_allocation_reset_standard_webhook_event.rbs +198 -0
  249. data/sig/orb/models/webhooks/subscription_license_balance_threshold_reached_standard_webhook_event.rbs +482 -0
  250. data/sig/orb/models/webhooks/subscription_plan_change_scheduled_standard_webhook_event.rbs +182 -0
  251. data/sig/orb/models/webhooks/subscription_plan_changed_standard_webhook_event.rbs +169 -0
  252. data/sig/orb/models/webhooks/subscription_plan_version_change_scheduled_standard_webhook_event.rbs +186 -0
  253. data/sig/orb/models/webhooks/subscription_plan_version_changed_standard_webhook_event.rbs +186 -0
  254. data/sig/orb/models/webhooks/subscription_spend_exceeded_standard_webhook_event.rbs +475 -0
  255. data/sig/orb/models/webhooks/subscription_started_standard_webhook_event.rbs +159 -0
  256. data/sig/orb/models/webhooks/subscription_trial_ended_standard_webhook_event.rbs +159 -0
  257. data/sig/orb/models/webhooks/subscription_usage_exceeded_standard_webhook_event.rbs +480 -0
  258. data/sig/orb/models/webhooks/transaction_accounting_sync_failed_standard_webhook_event.rbs +223 -0
  259. data/sig/orb/models/webhooks/transaction_accounting_sync_succeeded_standard_webhook_event.rbs +218 -0
  260. data/sig/orb/models/webhooks/unwrap_standard_webhook_event.rbs +94 -0
  261. data/sig/orb/models.rbs +2 -0
  262. data/sig/orb/resources/webhooks/standard.rbs +93 -0
  263. data/sig/orb/resources/webhooks.rbs +2 -0
  264. metadata +253 -1
@@ -0,0 +1,2337 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ module Webhooks
6
+ class InvoiceEditedStandardWebhookEvent < Orb::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent,
11
+ Orb::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # The ID of this webhook event.
16
+ sig { returns(String) }
17
+ attr_accessor :id
18
+
19
+ # The time at which this event was created, to the second.
20
+ sig { returns(Time) }
21
+ attr_accessor :created_at
22
+
23
+ # #InvoiceApiResourceWithoutLineItems
24
+ sig do
25
+ returns(Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice)
26
+ end
27
+ attr_reader :invoice
28
+
29
+ sig do
30
+ params(
31
+ invoice:
32
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::OrHash
33
+ ).void
34
+ end
35
+ attr_writer :invoice
36
+
37
+ # The serialization style this payload was rendered in, as configured on the
38
+ # endpoint.
39
+ sig do
40
+ returns(
41
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::PayloadStyle::TaggedSymbol
42
+ )
43
+ end
44
+ attr_accessor :payload_style
45
+
46
+ sig do
47
+ returns(Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties)
48
+ end
49
+ attr_reader :properties
50
+
51
+ sig do
52
+ params(
53
+ properties:
54
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::OrHash
55
+ ).void
56
+ end
57
+ attr_writer :properties
58
+
59
+ # The event this payload describes.
60
+ sig do
61
+ returns(
62
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Type::TaggedSymbol
63
+ )
64
+ end
65
+ attr_accessor :type
66
+
67
+ # Issued when a draft invoice has been edited.
68
+ sig do
69
+ params(
70
+ id: String,
71
+ created_at: Time,
72
+ invoice:
73
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::OrHash,
74
+ payload_style:
75
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::PayloadStyle::OrSymbol,
76
+ properties:
77
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::OrHash,
78
+ type:
79
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Type::OrSymbol
80
+ ).returns(T.attached_class)
81
+ end
82
+ def self.new(
83
+ # The ID of this webhook event.
84
+ id:,
85
+ # The time at which this event was created, to the second.
86
+ created_at:,
87
+ # #InvoiceApiResourceWithoutLineItems
88
+ invoice:,
89
+ # The serialization style this payload was rendered in, as configured on the
90
+ # endpoint.
91
+ payload_style:,
92
+ properties:,
93
+ # The event this payload describes.
94
+ type:
95
+ )
96
+ end
97
+
98
+ sig do
99
+ override.returns(
100
+ {
101
+ id: String,
102
+ created_at: Time,
103
+ invoice:
104
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice,
105
+ payload_style:
106
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::PayloadStyle::TaggedSymbol,
107
+ properties:
108
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties,
109
+ type:
110
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Type::TaggedSymbol
111
+ }
112
+ )
113
+ end
114
+ def to_hash
115
+ end
116
+
117
+ class Invoice < Orb::Internal::Type::BaseModel
118
+ OrHash =
119
+ T.type_alias do
120
+ T.any(
121
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice,
122
+ Orb::Internal::AnyHash
123
+ )
124
+ end
125
+
126
+ sig { returns(String) }
127
+ attr_accessor :id
128
+
129
+ # This is the final amount required to be charged to the customer and reflects the
130
+ # application of the customer balance to the `total` of the invoice.
131
+ sig { returns(String) }
132
+ attr_accessor :amount_due
133
+
134
+ sig do
135
+ returns(
136
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::AutoCollection
137
+ )
138
+ end
139
+ attr_reader :auto_collection
140
+
141
+ sig do
142
+ params(
143
+ auto_collection:
144
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::AutoCollection::OrHash
145
+ ).void
146
+ end
147
+ attr_writer :auto_collection
148
+
149
+ sig { returns(T.nilable(Orb::Address)) }
150
+ attr_reader :billing_address
151
+
152
+ sig { params(billing_address: T.nilable(Orb::Address::OrHash)).void }
153
+ attr_writer :billing_address
154
+
155
+ # The creation time of the resource in Orb.
156
+ sig { returns(Time) }
157
+ attr_accessor :created_at
158
+
159
+ # A list of credit notes associated with the invoice
160
+ sig do
161
+ returns(
162
+ T::Array[
163
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CreditNote
164
+ ]
165
+ )
166
+ end
167
+ attr_accessor :credit_notes
168
+
169
+ # An ISO 4217 currency string or `credits`
170
+ sig { returns(String) }
171
+ attr_accessor :currency
172
+
173
+ sig { returns(Orb::CustomerMinified) }
174
+ attr_reader :customer
175
+
176
+ sig { params(customer: Orb::CustomerMinified::OrHash).void }
177
+ attr_writer :customer
178
+
179
+ sig do
180
+ returns(
181
+ T::Array[
182
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction
183
+ ]
184
+ )
185
+ end
186
+ attr_accessor :customer_balance_transactions
187
+
188
+ # Tax IDs are commonly required to be displayed on customer invoices, which are
189
+ # added to the headers of invoices.
190
+ #
191
+ # ### Supported Tax ID Countries and Types
192
+ #
193
+ # | Country | Type | Description |
194
+ # | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
195
+ # | Albania | `al_tin` | Albania Tax Identification Number |
196
+ # | Andorra | `ad_nrt` | Andorran NRT Number |
197
+ # | Angola | `ao_tin` | Angola Tax Identification Number |
198
+ # | Argentina | `ar_cuit` | Argentinian Tax ID Number |
199
+ # | Armenia | `am_tin` | Armenia Tax Identification Number |
200
+ # | Aruba | `aw_tin` | Aruba Tax Identification Number |
201
+ # | Australia | `au_abn` | Australian Business Number (AU ABN) |
202
+ # | Australia | `au_arn` | Australian Taxation Office Reference Number |
203
+ # | Austria | `eu_vat` | European VAT Number |
204
+ # | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number |
205
+ # | Bahamas | `bs_tin` | Bahamas Tax Identification Number |
206
+ # | Bahrain | `bh_vat` | Bahraini VAT Number |
207
+ # | Bangladesh | `bd_bin` | Bangladesh Business Identification Number |
208
+ # | Barbados | `bb_tin` | Barbados Tax Identification Number |
209
+ # | Belarus | `by_tin` | Belarus TIN Number |
210
+ # | Belgium | `eu_vat` | European VAT Number |
211
+ # | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) |
212
+ # | Bolivia | `bo_tin` | Bolivian Tax ID |
213
+ # | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number |
214
+ # | Brazil | `br_cnpj` | Brazilian CNPJ Number |
215
+ # | Brazil | `br_cpf` | Brazilian CPF Number |
216
+ # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
217
+ # | Bulgaria | `eu_vat` | European VAT Number |
218
+ # | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) |
219
+ # | Cambodia | `kh_tin` | Cambodia Tax Identification Number |
220
+ # | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) |
221
+ # | Canada | `ca_bn` | Canadian BN |
222
+ # | Canada | `ca_gst_hst` | Canadian GST/HST Number |
223
+ # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
224
+ # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
225
+ # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
226
+ # | Canada | `ca_qst` | Canadian QST Number (Québec) |
227
+ # | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) |
228
+ # | Chile | `cl_tin` | Chilean TIN |
229
+ # | China | `cn_tin` | Chinese Tax ID |
230
+ # | Colombia | `co_nit` | Colombian NIT Number |
231
+ # | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) |
232
+ # | Costa Rica | `cr_tin` | Costa Rican Tax ID |
233
+ # | Croatia | `eu_vat` | European VAT Number |
234
+ # | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) |
235
+ # | Cyprus | `eu_vat` | European VAT Number |
236
+ # | Czech Republic | `eu_vat` | European VAT Number |
237
+ # | Denmark | `eu_vat` | European VAT Number |
238
+ # | Dominican Republic | `do_rcn` | Dominican RCN Number |
239
+ # | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
240
+ # | Egypt | `eg_tin` | Egyptian Tax Identification Number |
241
+ # | El Salvador | `sv_nit` | El Salvadorian NIT Number |
242
+ # | Estonia | `eu_vat` | European VAT Number |
243
+ # | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
244
+ # | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
245
+ # | Faroe Islands | `fo_vat` | Faroe Islands VAT Number |
246
+ # | Finland | `eu_vat` | European VAT Number |
247
+ # | France | `eu_vat` | European VAT Number |
248
+ # | Georgia | `ge_vat` | Georgian VAT |
249
+ # | Germany | `de_stn` | German Tax Number (Steuernummer) |
250
+ # | Germany | `eu_vat` | European VAT Number |
251
+ # | Gibraltar | `gi_tin` | Gibraltar Tax Identification Number |
252
+ # | Greece | `eu_vat` | European VAT Number |
253
+ # | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
254
+ # | Hong Kong | `hk_br` | Hong Kong BR Number |
255
+ # | Hungary | `eu_vat` | European VAT Number |
256
+ # | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
257
+ # | Iceland | `is_vat` | Icelandic VAT |
258
+ # | India | `in_gst` | Indian GST Number |
259
+ # | Indonesia | `id_npwp` | Indonesian NPWP Number |
260
+ # | Ireland | `eu_vat` | European VAT Number |
261
+ # | Israel | `il_vat` | Israel VAT |
262
+ # | Italy | `eu_vat` | European VAT Number |
263
+ # | Italy | `it_cf` | Italian Codice Fiscale Number |
264
+ # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
265
+ # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
266
+ # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
267
+ # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
268
+ # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
269
+ # | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number |
270
+ # | Laos | `la_tin` | Laos Tax Identification Number |
271
+ # | Latvia | `eu_vat` | European VAT Number |
272
+ # | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
273
+ # | Liechtenstein | `li_vat` | Liechtenstein VAT Number |
274
+ # | Lithuania | `eu_vat` | European VAT Number |
275
+ # | Luxembourg | `eu_vat` | European VAT Number |
276
+ # | Malaysia | `my_frp` | Malaysian FRP Number |
277
+ # | Malaysia | `my_itn` | Malaysian ITN |
278
+ # | Malaysia | `my_sst` | Malaysian SST Number |
279
+ # | Malta | `eu_vat` | European VAT Number |
280
+ # | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) |
281
+ # | Mexico | `mx_rfc` | Mexican RFC Number |
282
+ # | Moldova | `md_vat` | Moldova VAT Number |
283
+ # | Montenegro | `me_pib` | Montenegro PIB Number |
284
+ # | Morocco | `ma_vat` | Morocco VAT Number |
285
+ # | Nepal | `np_pan` | Nepal PAN Number |
286
+ # | Netherlands | `eu_vat` | European VAT Number |
287
+ # | New Zealand | `nz_gst` | New Zealand GST Number |
288
+ # | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
289
+ # | North Macedonia | `mk_vat` | North Macedonia VAT Number |
290
+ # | Northern Ireland | `eu_vat` | Northern Ireland VAT Number |
291
+ # | Norway | `no_vat` | Norwegian VAT Number |
292
+ # | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
293
+ # | Oman | `om_vat` | Omani VAT Number |
294
+ # | Paraguay | `py_ruc` | Paraguayan RUC Number |
295
+ # | Peru | `pe_ruc` | Peruvian RUC Number |
296
+ # | Philippines | `ph_tin` | Philippines Tax Identification Number |
297
+ # | Poland | `eu_vat` | European VAT Number |
298
+ # | Poland | `pl_nip` | Polish Tax ID Number |
299
+ # | Portugal | `eu_vat` | European VAT Number |
300
+ # | Romania | `eu_vat` | European VAT Number |
301
+ # | Romania | `ro_tin` | Romanian Tax ID Number |
302
+ # | Russia | `ru_inn` | Russian INN |
303
+ # | Russia | `ru_kpp` | Russian KPP |
304
+ # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
305
+ # | Senegal | `sn_ninea` | Senegal NINEA Number |
306
+ # | Serbia | `rs_pib` | Serbian PIB Number |
307
+ # | Singapore | `sg_gst` | Singaporean GST |
308
+ # | Singapore | `sg_uen` | Singaporean UEN |
309
+ # | Slovakia | `eu_vat` | European VAT Number |
310
+ # | Slovenia | `eu_vat` | European VAT Number |
311
+ # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
312
+ # | South Africa | `za_vat` | South African VAT Number |
313
+ # | South Korea | `kr_brn` | Korean BRN |
314
+ # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
315
+ # | Spain | `eu_vat` | European VAT Number |
316
+ # | Sri Lanka | `lk_vat` | Sri Lanka VAT Number |
317
+ # | Suriname | `sr_fin` | Suriname FIN Number |
318
+ # | Sweden | `eu_vat` | European VAT Number |
319
+ # | Switzerland | `ch_uid` | Switzerland UID Number |
320
+ # | Switzerland | `ch_vat` | Switzerland VAT Number |
321
+ # | Taiwan | `tw_vat` | Taiwanese VAT |
322
+ # | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number |
323
+ # | Tanzania | `tz_vat` | Tanzania VAT Number |
324
+ # | Thailand | `th_vat` | Thai VAT |
325
+ # | Turkey | `tr_tin` | Turkish Tax Identification Number |
326
+ # | Uganda | `ug_tin` | Uganda Tax Identification Number |
327
+ # | Ukraine | `ua_vat` | Ukrainian VAT |
328
+ # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
329
+ # | United Kingdom | `gb_vat` | United Kingdom VAT Number |
330
+ # | United States | `us_ein` | United States EIN |
331
+ # | Uruguay | `uy_ruc` | Uruguayan RUC Number |
332
+ # | Uzbekistan | `uz_tin` | Uzbekistan TIN Number |
333
+ # | Uzbekistan | `uz_vat` | Uzbekistan VAT Number |
334
+ # | Venezuela | `ve_rif` | Venezuelan RIF Number |
335
+ # | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
336
+ # | Zambia | `zm_tin` | Zambia Tax Identification Number |
337
+ # | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number |
338
+ sig { returns(T.nilable(Orb::CustomerTaxID)) }
339
+ attr_reader :customer_tax_id
340
+
341
+ sig do
342
+ params(customer_tax_id: T.nilable(Orb::CustomerTaxID::OrHash)).void
343
+ end
344
+ attr_writer :customer_tax_id
345
+
346
+ # When the invoice payment is due. The due date is null if the invoice is not yet
347
+ # finalized.
348
+ sig { returns(T.nilable(Time)) }
349
+ attr_accessor :due_date
350
+
351
+ # If the invoice has a status of `draft`, this will be the time that the invoice
352
+ # will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
353
+ # true, the invoice will automatically begin issuing at this time.
354
+ sig { returns(T.nilable(Time)) }
355
+ attr_accessor :eligible_to_issue_at
356
+
357
+ # A URL for the customer-facing invoice portal. This URL expires 60 days after the
358
+ # link is generated, or 30 days after the invoice's due date — whichever is later.
359
+ sig { returns(T.nilable(String)) }
360
+ attr_accessor :hosted_invoice_url
361
+
362
+ # The scheduled date of the invoice
363
+ sig { returns(Time) }
364
+ attr_accessor :invoice_date
365
+
366
+ # Automatically generated invoice number to help track and reconcile invoices.
367
+ # Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
368
+ # account or customer.
369
+ sig { returns(String) }
370
+ attr_accessor :invoice_number
371
+
372
+ # The link to download the PDF representation of the `Invoice`.
373
+ sig { returns(T.nilable(String)) }
374
+ attr_accessor :invoice_pdf
375
+
376
+ sig do
377
+ returns(
378
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::InvoiceSource::TaggedSymbol
379
+ )
380
+ end
381
+ attr_accessor :invoice_source
382
+
383
+ # If the invoice failed to issue, this will be the last time it failed to issue
384
+ # (even if it is now in a different state.)
385
+ sig { returns(T.nilable(Time)) }
386
+ attr_accessor :issue_failed_at
387
+
388
+ # If the invoice has been issued, this will be the time it transitioned to
389
+ # `issued` (even if it is now in a different state.)
390
+ sig { returns(T.nilable(Time)) }
391
+ attr_accessor :issued_at
392
+
393
+ # Free-form text which is available on the invoice PDF and the Orb invoice portal.
394
+ sig { returns(T.nilable(String)) }
395
+ attr_accessor :memo
396
+
397
+ # User specified key-value pairs for the resource. If not present, this defaults
398
+ # to an empty dictionary. Individual keys can be removed by setting the value to
399
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
400
+ # `null`.
401
+ sig { returns(T::Hash[Symbol, String]) }
402
+ attr_accessor :metadata
403
+
404
+ # If the invoice has a status of `paid`, this gives a timestamp when the invoice
405
+ # was paid.
406
+ sig { returns(T.nilable(Time)) }
407
+ attr_accessor :paid_at
408
+
409
+ # A list of payment attempts associated with the invoice
410
+ sig do
411
+ returns(
412
+ T::Array[
413
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::PaymentAttempt
414
+ ]
415
+ )
416
+ end
417
+ attr_accessor :payment_attempts
418
+
419
+ # If payment was attempted on this invoice but failed, this will be the time of
420
+ # the most recent attempt.
421
+ sig { returns(T.nilable(Time)) }
422
+ attr_accessor :payment_failed_at
423
+
424
+ # When payment for this invoice was received. For an invoice manually marked as
425
+ # paid, this is the `payment_received_date` that was supplied. For an invoice paid
426
+ # through a payment provider, this is the settlement time reported by that
427
+ # provider. It is `null` for an invoice that became `paid` without a payment, such
428
+ # as a $0 invoice or one fully covered by credit notes. By contrast, `paid_at` is
429
+ # when the invoice reached the `paid` status in Orb.
430
+ sig { returns(T.nilable(Time)) }
431
+ attr_accessor :payment_received_at
432
+
433
+ # If payment was attempted on this invoice, this will be the start time of the
434
+ # most recent attempt. This field is especially useful for delayed-notification
435
+ # payment mechanisms (like bank transfers), where payment can take 3 days or more.
436
+ sig { returns(T.nilable(Time)) }
437
+ attr_accessor :payment_started_at
438
+
439
+ # If the invoice is in draft, this timestamp will reflect when the invoice is
440
+ # scheduled to be issued.
441
+ sig { returns(T.nilable(Time)) }
442
+ attr_accessor :scheduled_issue_at
443
+
444
+ sig { returns(T.nilable(Orb::Address)) }
445
+ attr_reader :shipping_address
446
+
447
+ sig { params(shipping_address: T.nilable(Orb::Address::OrHash)).void }
448
+ attr_writer :shipping_address
449
+
450
+ sig do
451
+ returns(
452
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::Status::TaggedSymbol
453
+ )
454
+ end
455
+ attr_accessor :status
456
+
457
+ sig { returns(T.nilable(Orb::SubscriptionMinified)) }
458
+ attr_reader :subscription
459
+
460
+ sig do
461
+ params(
462
+ subscription: T.nilable(Orb::SubscriptionMinified::OrHash)
463
+ ).void
464
+ end
465
+ attr_writer :subscription
466
+
467
+ # If the invoice failed to sync, this will be the last time an external invoicing
468
+ # provider sync was attempted. This field will always be `null` for invoices using
469
+ # Orb Invoicing.
470
+ sig { returns(T.nilable(Time)) }
471
+ attr_accessor :sync_failed_at
472
+
473
+ # The total after any minimums and discounts have been applied.
474
+ sig { returns(String) }
475
+ attr_accessor :total
476
+
477
+ # If the invoice has a status of `void`, this gives a timestamp when the invoice
478
+ # was voided.
479
+ sig { returns(T.nilable(Time)) }
480
+ attr_accessor :voided_at
481
+
482
+ # This is true if the invoice will be automatically issued in the future, and
483
+ # false otherwise.
484
+ sig { returns(T::Boolean) }
485
+ attr_accessor :will_auto_issue
486
+
487
+ # #InvoiceApiResourceWithoutLineItems
488
+ sig do
489
+ params(
490
+ id: String,
491
+ amount_due: String,
492
+ auto_collection:
493
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::AutoCollection::OrHash,
494
+ billing_address: T.nilable(Orb::Address::OrHash),
495
+ created_at: Time,
496
+ credit_notes:
497
+ T::Array[
498
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CreditNote::OrHash
499
+ ],
500
+ currency: String,
501
+ customer: Orb::CustomerMinified::OrHash,
502
+ customer_balance_transactions:
503
+ T::Array[
504
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::OrHash
505
+ ],
506
+ customer_tax_id: T.nilable(Orb::CustomerTaxID::OrHash),
507
+ due_date: T.nilable(Time),
508
+ eligible_to_issue_at: T.nilable(Time),
509
+ hosted_invoice_url: T.nilable(String),
510
+ invoice_date: Time,
511
+ invoice_number: String,
512
+ invoice_pdf: T.nilable(String),
513
+ invoice_source:
514
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::InvoiceSource::OrSymbol,
515
+ issue_failed_at: T.nilable(Time),
516
+ issued_at: T.nilable(Time),
517
+ memo: T.nilable(String),
518
+ metadata: T::Hash[Symbol, String],
519
+ paid_at: T.nilable(Time),
520
+ payment_attempts:
521
+ T::Array[
522
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::PaymentAttempt::OrHash
523
+ ],
524
+ payment_failed_at: T.nilable(Time),
525
+ payment_received_at: T.nilable(Time),
526
+ payment_started_at: T.nilable(Time),
527
+ scheduled_issue_at: T.nilable(Time),
528
+ shipping_address: T.nilable(Orb::Address::OrHash),
529
+ status:
530
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::Status::OrSymbol,
531
+ subscription: T.nilable(Orb::SubscriptionMinified::OrHash),
532
+ sync_failed_at: T.nilable(Time),
533
+ total: String,
534
+ voided_at: T.nilable(Time),
535
+ will_auto_issue: T::Boolean
536
+ ).returns(T.attached_class)
537
+ end
538
+ def self.new(
539
+ id:,
540
+ # This is the final amount required to be charged to the customer and reflects the
541
+ # application of the customer balance to the `total` of the invoice.
542
+ amount_due:,
543
+ auto_collection:,
544
+ billing_address:,
545
+ # The creation time of the resource in Orb.
546
+ created_at:,
547
+ # A list of credit notes associated with the invoice
548
+ credit_notes:,
549
+ # An ISO 4217 currency string or `credits`
550
+ currency:,
551
+ customer:,
552
+ customer_balance_transactions:,
553
+ # Tax IDs are commonly required to be displayed on customer invoices, which are
554
+ # added to the headers of invoices.
555
+ #
556
+ # ### Supported Tax ID Countries and Types
557
+ #
558
+ # | Country | Type | Description |
559
+ # | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
560
+ # | Albania | `al_tin` | Albania Tax Identification Number |
561
+ # | Andorra | `ad_nrt` | Andorran NRT Number |
562
+ # | Angola | `ao_tin` | Angola Tax Identification Number |
563
+ # | Argentina | `ar_cuit` | Argentinian Tax ID Number |
564
+ # | Armenia | `am_tin` | Armenia Tax Identification Number |
565
+ # | Aruba | `aw_tin` | Aruba Tax Identification Number |
566
+ # | Australia | `au_abn` | Australian Business Number (AU ABN) |
567
+ # | Australia | `au_arn` | Australian Taxation Office Reference Number |
568
+ # | Austria | `eu_vat` | European VAT Number |
569
+ # | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number |
570
+ # | Bahamas | `bs_tin` | Bahamas Tax Identification Number |
571
+ # | Bahrain | `bh_vat` | Bahraini VAT Number |
572
+ # | Bangladesh | `bd_bin` | Bangladesh Business Identification Number |
573
+ # | Barbados | `bb_tin` | Barbados Tax Identification Number |
574
+ # | Belarus | `by_tin` | Belarus TIN Number |
575
+ # | Belgium | `eu_vat` | European VAT Number |
576
+ # | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) |
577
+ # | Bolivia | `bo_tin` | Bolivian Tax ID |
578
+ # | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number |
579
+ # | Brazil | `br_cnpj` | Brazilian CNPJ Number |
580
+ # | Brazil | `br_cpf` | Brazilian CPF Number |
581
+ # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
582
+ # | Bulgaria | `eu_vat` | European VAT Number |
583
+ # | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) |
584
+ # | Cambodia | `kh_tin` | Cambodia Tax Identification Number |
585
+ # | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) |
586
+ # | Canada | `ca_bn` | Canadian BN |
587
+ # | Canada | `ca_gst_hst` | Canadian GST/HST Number |
588
+ # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
589
+ # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
590
+ # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
591
+ # | Canada | `ca_qst` | Canadian QST Number (Québec) |
592
+ # | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) |
593
+ # | Chile | `cl_tin` | Chilean TIN |
594
+ # | China | `cn_tin` | Chinese Tax ID |
595
+ # | Colombia | `co_nit` | Colombian NIT Number |
596
+ # | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) |
597
+ # | Costa Rica | `cr_tin` | Costa Rican Tax ID |
598
+ # | Croatia | `eu_vat` | European VAT Number |
599
+ # | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) |
600
+ # | Cyprus | `eu_vat` | European VAT Number |
601
+ # | Czech Republic | `eu_vat` | European VAT Number |
602
+ # | Denmark | `eu_vat` | European VAT Number |
603
+ # | Dominican Republic | `do_rcn` | Dominican RCN Number |
604
+ # | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
605
+ # | Egypt | `eg_tin` | Egyptian Tax Identification Number |
606
+ # | El Salvador | `sv_nit` | El Salvadorian NIT Number |
607
+ # | Estonia | `eu_vat` | European VAT Number |
608
+ # | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
609
+ # | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
610
+ # | Faroe Islands | `fo_vat` | Faroe Islands VAT Number |
611
+ # | Finland | `eu_vat` | European VAT Number |
612
+ # | France | `eu_vat` | European VAT Number |
613
+ # | Georgia | `ge_vat` | Georgian VAT |
614
+ # | Germany | `de_stn` | German Tax Number (Steuernummer) |
615
+ # | Germany | `eu_vat` | European VAT Number |
616
+ # | Gibraltar | `gi_tin` | Gibraltar Tax Identification Number |
617
+ # | Greece | `eu_vat` | European VAT Number |
618
+ # | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
619
+ # | Hong Kong | `hk_br` | Hong Kong BR Number |
620
+ # | Hungary | `eu_vat` | European VAT Number |
621
+ # | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
622
+ # | Iceland | `is_vat` | Icelandic VAT |
623
+ # | India | `in_gst` | Indian GST Number |
624
+ # | Indonesia | `id_npwp` | Indonesian NPWP Number |
625
+ # | Ireland | `eu_vat` | European VAT Number |
626
+ # | Israel | `il_vat` | Israel VAT |
627
+ # | Italy | `eu_vat` | European VAT Number |
628
+ # | Italy | `it_cf` | Italian Codice Fiscale Number |
629
+ # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
630
+ # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
631
+ # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
632
+ # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
633
+ # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
634
+ # | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number |
635
+ # | Laos | `la_tin` | Laos Tax Identification Number |
636
+ # | Latvia | `eu_vat` | European VAT Number |
637
+ # | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
638
+ # | Liechtenstein | `li_vat` | Liechtenstein VAT Number |
639
+ # | Lithuania | `eu_vat` | European VAT Number |
640
+ # | Luxembourg | `eu_vat` | European VAT Number |
641
+ # | Malaysia | `my_frp` | Malaysian FRP Number |
642
+ # | Malaysia | `my_itn` | Malaysian ITN |
643
+ # | Malaysia | `my_sst` | Malaysian SST Number |
644
+ # | Malta | `eu_vat` | European VAT Number |
645
+ # | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) |
646
+ # | Mexico | `mx_rfc` | Mexican RFC Number |
647
+ # | Moldova | `md_vat` | Moldova VAT Number |
648
+ # | Montenegro | `me_pib` | Montenegro PIB Number |
649
+ # | Morocco | `ma_vat` | Morocco VAT Number |
650
+ # | Nepal | `np_pan` | Nepal PAN Number |
651
+ # | Netherlands | `eu_vat` | European VAT Number |
652
+ # | New Zealand | `nz_gst` | New Zealand GST Number |
653
+ # | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
654
+ # | North Macedonia | `mk_vat` | North Macedonia VAT Number |
655
+ # | Northern Ireland | `eu_vat` | Northern Ireland VAT Number |
656
+ # | Norway | `no_vat` | Norwegian VAT Number |
657
+ # | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
658
+ # | Oman | `om_vat` | Omani VAT Number |
659
+ # | Paraguay | `py_ruc` | Paraguayan RUC Number |
660
+ # | Peru | `pe_ruc` | Peruvian RUC Number |
661
+ # | Philippines | `ph_tin` | Philippines Tax Identification Number |
662
+ # | Poland | `eu_vat` | European VAT Number |
663
+ # | Poland | `pl_nip` | Polish Tax ID Number |
664
+ # | Portugal | `eu_vat` | European VAT Number |
665
+ # | Romania | `eu_vat` | European VAT Number |
666
+ # | Romania | `ro_tin` | Romanian Tax ID Number |
667
+ # | Russia | `ru_inn` | Russian INN |
668
+ # | Russia | `ru_kpp` | Russian KPP |
669
+ # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
670
+ # | Senegal | `sn_ninea` | Senegal NINEA Number |
671
+ # | Serbia | `rs_pib` | Serbian PIB Number |
672
+ # | Singapore | `sg_gst` | Singaporean GST |
673
+ # | Singapore | `sg_uen` | Singaporean UEN |
674
+ # | Slovakia | `eu_vat` | European VAT Number |
675
+ # | Slovenia | `eu_vat` | European VAT Number |
676
+ # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
677
+ # | South Africa | `za_vat` | South African VAT Number |
678
+ # | South Korea | `kr_brn` | Korean BRN |
679
+ # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
680
+ # | Spain | `eu_vat` | European VAT Number |
681
+ # | Sri Lanka | `lk_vat` | Sri Lanka VAT Number |
682
+ # | Suriname | `sr_fin` | Suriname FIN Number |
683
+ # | Sweden | `eu_vat` | European VAT Number |
684
+ # | Switzerland | `ch_uid` | Switzerland UID Number |
685
+ # | Switzerland | `ch_vat` | Switzerland VAT Number |
686
+ # | Taiwan | `tw_vat` | Taiwanese VAT |
687
+ # | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number |
688
+ # | Tanzania | `tz_vat` | Tanzania VAT Number |
689
+ # | Thailand | `th_vat` | Thai VAT |
690
+ # | Turkey | `tr_tin` | Turkish Tax Identification Number |
691
+ # | Uganda | `ug_tin` | Uganda Tax Identification Number |
692
+ # | Ukraine | `ua_vat` | Ukrainian VAT |
693
+ # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
694
+ # | United Kingdom | `gb_vat` | United Kingdom VAT Number |
695
+ # | United States | `us_ein` | United States EIN |
696
+ # | Uruguay | `uy_ruc` | Uruguayan RUC Number |
697
+ # | Uzbekistan | `uz_tin` | Uzbekistan TIN Number |
698
+ # | Uzbekistan | `uz_vat` | Uzbekistan VAT Number |
699
+ # | Venezuela | `ve_rif` | Venezuelan RIF Number |
700
+ # | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
701
+ # | Zambia | `zm_tin` | Zambia Tax Identification Number |
702
+ # | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number |
703
+ customer_tax_id:,
704
+ # When the invoice payment is due. The due date is null if the invoice is not yet
705
+ # finalized.
706
+ due_date:,
707
+ # If the invoice has a status of `draft`, this will be the time that the invoice
708
+ # will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
709
+ # true, the invoice will automatically begin issuing at this time.
710
+ eligible_to_issue_at:,
711
+ # A URL for the customer-facing invoice portal. This URL expires 60 days after the
712
+ # link is generated, or 30 days after the invoice's due date — whichever is later.
713
+ hosted_invoice_url:,
714
+ # The scheduled date of the invoice
715
+ invoice_date:,
716
+ # Automatically generated invoice number to help track and reconcile invoices.
717
+ # Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
718
+ # account or customer.
719
+ invoice_number:,
720
+ # The link to download the PDF representation of the `Invoice`.
721
+ invoice_pdf:,
722
+ invoice_source:,
723
+ # If the invoice failed to issue, this will be the last time it failed to issue
724
+ # (even if it is now in a different state.)
725
+ issue_failed_at:,
726
+ # If the invoice has been issued, this will be the time it transitioned to
727
+ # `issued` (even if it is now in a different state.)
728
+ issued_at:,
729
+ # Free-form text which is available on the invoice PDF and the Orb invoice portal.
730
+ memo:,
731
+ # User specified key-value pairs for the resource. If not present, this defaults
732
+ # to an empty dictionary. Individual keys can be removed by setting the value to
733
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
734
+ # `null`.
735
+ metadata:,
736
+ # If the invoice has a status of `paid`, this gives a timestamp when the invoice
737
+ # was paid.
738
+ paid_at:,
739
+ # A list of payment attempts associated with the invoice
740
+ payment_attempts:,
741
+ # If payment was attempted on this invoice but failed, this will be the time of
742
+ # the most recent attempt.
743
+ payment_failed_at:,
744
+ # When payment for this invoice was received. For an invoice manually marked as
745
+ # paid, this is the `payment_received_date` that was supplied. For an invoice paid
746
+ # through a payment provider, this is the settlement time reported by that
747
+ # provider. It is `null` for an invoice that became `paid` without a payment, such
748
+ # as a $0 invoice or one fully covered by credit notes. By contrast, `paid_at` is
749
+ # when the invoice reached the `paid` status in Orb.
750
+ payment_received_at:,
751
+ # If payment was attempted on this invoice, this will be the start time of the
752
+ # most recent attempt. This field is especially useful for delayed-notification
753
+ # payment mechanisms (like bank transfers), where payment can take 3 days or more.
754
+ payment_started_at:,
755
+ # If the invoice is in draft, this timestamp will reflect when the invoice is
756
+ # scheduled to be issued.
757
+ scheduled_issue_at:,
758
+ shipping_address:,
759
+ status:,
760
+ subscription:,
761
+ # If the invoice failed to sync, this will be the last time an external invoicing
762
+ # provider sync was attempted. This field will always be `null` for invoices using
763
+ # Orb Invoicing.
764
+ sync_failed_at:,
765
+ # The total after any minimums and discounts have been applied.
766
+ total:,
767
+ # If the invoice has a status of `void`, this gives a timestamp when the invoice
768
+ # was voided.
769
+ voided_at:,
770
+ # This is true if the invoice will be automatically issued in the future, and
771
+ # false otherwise.
772
+ will_auto_issue:
773
+ )
774
+ end
775
+
776
+ sig do
777
+ override.returns(
778
+ {
779
+ id: String,
780
+ amount_due: String,
781
+ auto_collection:
782
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::AutoCollection,
783
+ billing_address: T.nilable(Orb::Address),
784
+ created_at: Time,
785
+ credit_notes:
786
+ T::Array[
787
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CreditNote
788
+ ],
789
+ currency: String,
790
+ customer: Orb::CustomerMinified,
791
+ customer_balance_transactions:
792
+ T::Array[
793
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction
794
+ ],
795
+ customer_tax_id: T.nilable(Orb::CustomerTaxID),
796
+ due_date: T.nilable(Time),
797
+ eligible_to_issue_at: T.nilable(Time),
798
+ hosted_invoice_url: T.nilable(String),
799
+ invoice_date: Time,
800
+ invoice_number: String,
801
+ invoice_pdf: T.nilable(String),
802
+ invoice_source:
803
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::InvoiceSource::TaggedSymbol,
804
+ issue_failed_at: T.nilable(Time),
805
+ issued_at: T.nilable(Time),
806
+ memo: T.nilable(String),
807
+ metadata: T::Hash[Symbol, String],
808
+ paid_at: T.nilable(Time),
809
+ payment_attempts:
810
+ T::Array[
811
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::PaymentAttempt
812
+ ],
813
+ payment_failed_at: T.nilable(Time),
814
+ payment_received_at: T.nilable(Time),
815
+ payment_started_at: T.nilable(Time),
816
+ scheduled_issue_at: T.nilable(Time),
817
+ shipping_address: T.nilable(Orb::Address),
818
+ status:
819
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::Status::TaggedSymbol,
820
+ subscription: T.nilable(Orb::SubscriptionMinified),
821
+ sync_failed_at: T.nilable(Time),
822
+ total: String,
823
+ voided_at: T.nilable(Time),
824
+ will_auto_issue: T::Boolean
825
+ }
826
+ )
827
+ end
828
+ def to_hash
829
+ end
830
+
831
+ class AutoCollection < Orb::Internal::Type::BaseModel
832
+ OrHash =
833
+ T.type_alias do
834
+ T.any(
835
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::AutoCollection,
836
+ Orb::Internal::AnyHash
837
+ )
838
+ end
839
+
840
+ # True only if auto-collection is enabled for this invoice.
841
+ sig { returns(T.nilable(T::Boolean)) }
842
+ attr_accessor :enabled
843
+
844
+ # If the invoice is scheduled for auto-collection, this field will reflect when
845
+ # the next attempt will occur. If dunning has been exhausted, or auto-collection
846
+ # is not enabled for this invoice, this field will be `null`.
847
+ sig { returns(T.nilable(Time)) }
848
+ attr_accessor :next_attempt_at
849
+
850
+ # Number of auto-collection payment attempts.
851
+ sig { returns(T.nilable(Integer)) }
852
+ attr_accessor :num_attempts
853
+
854
+ # If Orb has ever attempted payment auto-collection for this invoice, this field
855
+ # will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
856
+ # this can be used to tell whether the invoice is currently in dunning (that is,
857
+ # `previously_attempted_at` is non-null, and `next_attempt_at` is non-null), or if
858
+ # dunning has been exhausted (`previously_attempted_at` is non-null, but
859
+ # `next_attempt_at` is null).
860
+ sig { returns(T.nilable(Time)) }
861
+ attr_accessor :previously_attempted_at
862
+
863
+ sig do
864
+ params(
865
+ enabled: T.nilable(T::Boolean),
866
+ next_attempt_at: T.nilable(Time),
867
+ num_attempts: T.nilable(Integer),
868
+ previously_attempted_at: T.nilable(Time)
869
+ ).returns(T.attached_class)
870
+ end
871
+ def self.new(
872
+ # True only if auto-collection is enabled for this invoice.
873
+ enabled:,
874
+ # If the invoice is scheduled for auto-collection, this field will reflect when
875
+ # the next attempt will occur. If dunning has been exhausted, or auto-collection
876
+ # is not enabled for this invoice, this field will be `null`.
877
+ next_attempt_at:,
878
+ # Number of auto-collection payment attempts.
879
+ num_attempts:,
880
+ # If Orb has ever attempted payment auto-collection for this invoice, this field
881
+ # will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
882
+ # this can be used to tell whether the invoice is currently in dunning (that is,
883
+ # `previously_attempted_at` is non-null, and `next_attempt_at` is non-null), or if
884
+ # dunning has been exhausted (`previously_attempted_at` is non-null, but
885
+ # `next_attempt_at` is null).
886
+ previously_attempted_at:
887
+ )
888
+ end
889
+
890
+ sig do
891
+ override.returns(
892
+ {
893
+ enabled: T.nilable(T::Boolean),
894
+ next_attempt_at: T.nilable(Time),
895
+ num_attempts: T.nilable(Integer),
896
+ previously_attempted_at: T.nilable(Time)
897
+ }
898
+ )
899
+ end
900
+ def to_hash
901
+ end
902
+ end
903
+
904
+ class CreditNote < Orb::Internal::Type::BaseModel
905
+ OrHash =
906
+ T.type_alias do
907
+ T.any(
908
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CreditNote,
909
+ Orb::Internal::AnyHash
910
+ )
911
+ end
912
+
913
+ sig { returns(String) }
914
+ attr_accessor :id
915
+
916
+ sig { returns(String) }
917
+ attr_accessor :credit_note_number
918
+
919
+ # An optional memo supplied on the credit note.
920
+ sig { returns(T.nilable(String)) }
921
+ attr_accessor :memo
922
+
923
+ sig { returns(String) }
924
+ attr_accessor :reason
925
+
926
+ sig { returns(String) }
927
+ attr_accessor :total
928
+
929
+ sig { returns(String) }
930
+ attr_accessor :type
931
+
932
+ # If the credit note has a status of `void`, this gives a timestamp when the
933
+ # credit note was voided.
934
+ sig { returns(T.nilable(Time)) }
935
+ attr_accessor :voided_at
936
+
937
+ sig do
938
+ params(
939
+ id: String,
940
+ credit_note_number: String,
941
+ memo: T.nilable(String),
942
+ reason: String,
943
+ total: String,
944
+ type: String,
945
+ voided_at: T.nilable(Time)
946
+ ).returns(T.attached_class)
947
+ end
948
+ def self.new(
949
+ id:,
950
+ credit_note_number:,
951
+ # An optional memo supplied on the credit note.
952
+ memo:,
953
+ reason:,
954
+ total:,
955
+ type:,
956
+ # If the credit note has a status of `void`, this gives a timestamp when the
957
+ # credit note was voided.
958
+ voided_at:
959
+ )
960
+ end
961
+
962
+ sig do
963
+ override.returns(
964
+ {
965
+ id: String,
966
+ credit_note_number: String,
967
+ memo: T.nilable(String),
968
+ reason: String,
969
+ total: String,
970
+ type: String,
971
+ voided_at: T.nilable(Time)
972
+ }
973
+ )
974
+ end
975
+ def to_hash
976
+ end
977
+ end
978
+
979
+ class CustomerBalanceTransaction < Orb::Internal::Type::BaseModel
980
+ OrHash =
981
+ T.type_alias do
982
+ T.any(
983
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction,
984
+ Orb::Internal::AnyHash
985
+ )
986
+ end
987
+
988
+ # A unique id for this transaction.
989
+ sig { returns(String) }
990
+ attr_accessor :id
991
+
992
+ sig do
993
+ returns(
994
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
995
+ )
996
+ end
997
+ attr_accessor :action
998
+
999
+ # The value of the amount changed in the transaction.
1000
+ sig { returns(String) }
1001
+ attr_accessor :amount
1002
+
1003
+ # The creation time of this transaction.
1004
+ sig { returns(Time) }
1005
+ attr_accessor :created_at
1006
+
1007
+ sig { returns(T.nilable(Orb::CreditNoteTiny)) }
1008
+ attr_reader :credit_note
1009
+
1010
+ sig do
1011
+ params(credit_note: T.nilable(Orb::CreditNoteTiny::OrHash)).void
1012
+ end
1013
+ attr_writer :credit_note
1014
+
1015
+ # An optional description provided for manual customer balance adjustments.
1016
+ sig { returns(T.nilable(String)) }
1017
+ attr_accessor :description
1018
+
1019
+ # The new value of the customer's balance prior to the transaction, in the
1020
+ # customer's currency.
1021
+ sig { returns(String) }
1022
+ attr_accessor :ending_balance
1023
+
1024
+ sig { returns(T.nilable(Orb::InvoiceTiny)) }
1025
+ attr_reader :invoice
1026
+
1027
+ sig { params(invoice: T.nilable(Orb::InvoiceTiny::OrHash)).void }
1028
+ attr_writer :invoice
1029
+
1030
+ # The original value of the customer's balance prior to the transaction, in the
1031
+ # customer's currency.
1032
+ sig { returns(String) }
1033
+ attr_accessor :starting_balance
1034
+
1035
+ sig do
1036
+ returns(
1037
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Type::TaggedSymbol
1038
+ )
1039
+ end
1040
+ attr_accessor :type
1041
+
1042
+ sig do
1043
+ params(
1044
+ id: String,
1045
+ action:
1046
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::OrSymbol,
1047
+ amount: String,
1048
+ created_at: Time,
1049
+ credit_note: T.nilable(Orb::CreditNoteTiny::OrHash),
1050
+ description: T.nilable(String),
1051
+ ending_balance: String,
1052
+ invoice: T.nilable(Orb::InvoiceTiny::OrHash),
1053
+ starting_balance: String,
1054
+ type:
1055
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Type::OrSymbol
1056
+ ).returns(T.attached_class)
1057
+ end
1058
+ def self.new(
1059
+ # A unique id for this transaction.
1060
+ id:,
1061
+ action:,
1062
+ # The value of the amount changed in the transaction.
1063
+ amount:,
1064
+ # The creation time of this transaction.
1065
+ created_at:,
1066
+ credit_note:,
1067
+ # An optional description provided for manual customer balance adjustments.
1068
+ description:,
1069
+ # The new value of the customer's balance prior to the transaction, in the
1070
+ # customer's currency.
1071
+ ending_balance:,
1072
+ invoice:,
1073
+ # The original value of the customer's balance prior to the transaction, in the
1074
+ # customer's currency.
1075
+ starting_balance:,
1076
+ type:
1077
+ )
1078
+ end
1079
+
1080
+ sig do
1081
+ override.returns(
1082
+ {
1083
+ id: String,
1084
+ action:
1085
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol,
1086
+ amount: String,
1087
+ created_at: Time,
1088
+ credit_note: T.nilable(Orb::CreditNoteTiny),
1089
+ description: T.nilable(String),
1090
+ ending_balance: String,
1091
+ invoice: T.nilable(Orb::InvoiceTiny),
1092
+ starting_balance: String,
1093
+ type:
1094
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Type::TaggedSymbol
1095
+ }
1096
+ )
1097
+ end
1098
+ def to_hash
1099
+ end
1100
+
1101
+ module Action
1102
+ extend Orb::Internal::Type::Enum
1103
+
1104
+ TaggedSymbol =
1105
+ T.type_alias do
1106
+ T.all(
1107
+ Symbol,
1108
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action
1109
+ )
1110
+ end
1111
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1112
+
1113
+ APPLIED_TO_INVOICE =
1114
+ T.let(
1115
+ :applied_to_invoice,
1116
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1117
+ )
1118
+ MANUAL_ADJUSTMENT =
1119
+ T.let(
1120
+ :manual_adjustment,
1121
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1122
+ )
1123
+ PRORATED_REFUND =
1124
+ T.let(
1125
+ :prorated_refund,
1126
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1127
+ )
1128
+ REVERT_PRORATED_REFUND =
1129
+ T.let(
1130
+ :revert_prorated_refund,
1131
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1132
+ )
1133
+ RETURN_FROM_VOIDING =
1134
+ T.let(
1135
+ :return_from_voiding,
1136
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1137
+ )
1138
+ CREDIT_NOTE_APPLIED =
1139
+ T.let(
1140
+ :credit_note_applied,
1141
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1142
+ )
1143
+ CREDIT_NOTE_VOIDED =
1144
+ T.let(
1145
+ :credit_note_voided,
1146
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1147
+ )
1148
+ OVERPAYMENT_REFUND =
1149
+ T.let(
1150
+ :overpayment_refund,
1151
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1152
+ )
1153
+ EXTERNAL_PAYMENT =
1154
+ T.let(
1155
+ :external_payment,
1156
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1157
+ )
1158
+ SMALL_INVOICE_CARRYOVER =
1159
+ T.let(
1160
+ :small_invoice_carryover,
1161
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1162
+ )
1163
+ PREPAID_COMMIT_CANCEL =
1164
+ T.let(
1165
+ :prepaid_commit_cancel,
1166
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1167
+ )
1168
+
1169
+ sig do
1170
+ override.returns(
1171
+ T::Array[
1172
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1173
+ ]
1174
+ )
1175
+ end
1176
+ def self.values
1177
+ end
1178
+ end
1179
+
1180
+ module Type
1181
+ extend Orb::Internal::Type::Enum
1182
+
1183
+ TaggedSymbol =
1184
+ T.type_alias do
1185
+ T.all(
1186
+ Symbol,
1187
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Type
1188
+ )
1189
+ end
1190
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1191
+
1192
+ INCREMENT =
1193
+ T.let(
1194
+ :increment,
1195
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Type::TaggedSymbol
1196
+ )
1197
+ DECREMENT =
1198
+ T.let(
1199
+ :decrement,
1200
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Type::TaggedSymbol
1201
+ )
1202
+
1203
+ sig do
1204
+ override.returns(
1205
+ T::Array[
1206
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::CustomerBalanceTransaction::Type::TaggedSymbol
1207
+ ]
1208
+ )
1209
+ end
1210
+ def self.values
1211
+ end
1212
+ end
1213
+ end
1214
+
1215
+ module InvoiceSource
1216
+ extend Orb::Internal::Type::Enum
1217
+
1218
+ TaggedSymbol =
1219
+ T.type_alias do
1220
+ T.all(
1221
+ Symbol,
1222
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::InvoiceSource
1223
+ )
1224
+ end
1225
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1226
+
1227
+ SUBSCRIPTION =
1228
+ T.let(
1229
+ :subscription,
1230
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::InvoiceSource::TaggedSymbol
1231
+ )
1232
+ PARTIAL =
1233
+ T.let(
1234
+ :partial,
1235
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::InvoiceSource::TaggedSymbol
1236
+ )
1237
+ ONE_OFF =
1238
+ T.let(
1239
+ :one_off,
1240
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::InvoiceSource::TaggedSymbol
1241
+ )
1242
+
1243
+ sig do
1244
+ override.returns(
1245
+ T::Array[
1246
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::InvoiceSource::TaggedSymbol
1247
+ ]
1248
+ )
1249
+ end
1250
+ def self.values
1251
+ end
1252
+ end
1253
+
1254
+ class PaymentAttempt < Orb::Internal::Type::BaseModel
1255
+ OrHash =
1256
+ T.type_alias do
1257
+ T.any(
1258
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::PaymentAttempt,
1259
+ Orb::Internal::AnyHash
1260
+ )
1261
+ end
1262
+
1263
+ # The ID of the payment attempt.
1264
+ sig { returns(String) }
1265
+ attr_accessor :id
1266
+
1267
+ # The amount of the payment attempt.
1268
+ sig { returns(String) }
1269
+ attr_accessor :amount
1270
+
1271
+ # The time at which the payment attempt was created.
1272
+ sig { returns(Time) }
1273
+ attr_accessor :created_at
1274
+
1275
+ # The payment provider that attempted to collect the payment.
1276
+ sig do
1277
+ returns(
1278
+ T.nilable(
1279
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::PaymentAttempt::PaymentProvider::TaggedSymbol
1280
+ )
1281
+ )
1282
+ end
1283
+ attr_accessor :payment_provider
1284
+
1285
+ # The ID of the payment attempt in the payment provider.
1286
+ sig { returns(T.nilable(String)) }
1287
+ attr_accessor :payment_provider_id
1288
+
1289
+ # URL to the downloadable PDF version of the receipt. This field will be `null`
1290
+ # for payment attempts that did not succeed.
1291
+ sig { returns(T.nilable(String)) }
1292
+ attr_accessor :receipt_pdf
1293
+
1294
+ # Whether the payment attempt succeeded.
1295
+ sig { returns(T::Boolean) }
1296
+ attr_accessor :succeeded
1297
+
1298
+ sig do
1299
+ params(
1300
+ id: String,
1301
+ amount: String,
1302
+ created_at: Time,
1303
+ payment_provider:
1304
+ T.nilable(
1305
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::PaymentAttempt::PaymentProvider::OrSymbol
1306
+ ),
1307
+ payment_provider_id: T.nilable(String),
1308
+ receipt_pdf: T.nilable(String),
1309
+ succeeded: T::Boolean
1310
+ ).returns(T.attached_class)
1311
+ end
1312
+ def self.new(
1313
+ # The ID of the payment attempt.
1314
+ id:,
1315
+ # The amount of the payment attempt.
1316
+ amount:,
1317
+ # The time at which the payment attempt was created.
1318
+ created_at:,
1319
+ # The payment provider that attempted to collect the payment.
1320
+ payment_provider:,
1321
+ # The ID of the payment attempt in the payment provider.
1322
+ payment_provider_id:,
1323
+ # URL to the downloadable PDF version of the receipt. This field will be `null`
1324
+ # for payment attempts that did not succeed.
1325
+ receipt_pdf:,
1326
+ # Whether the payment attempt succeeded.
1327
+ succeeded:
1328
+ )
1329
+ end
1330
+
1331
+ sig do
1332
+ override.returns(
1333
+ {
1334
+ id: String,
1335
+ amount: String,
1336
+ created_at: Time,
1337
+ payment_provider:
1338
+ T.nilable(
1339
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::PaymentAttempt::PaymentProvider::TaggedSymbol
1340
+ ),
1341
+ payment_provider_id: T.nilable(String),
1342
+ receipt_pdf: T.nilable(String),
1343
+ succeeded: T::Boolean
1344
+ }
1345
+ )
1346
+ end
1347
+ def to_hash
1348
+ end
1349
+
1350
+ # The payment provider that attempted to collect the payment.
1351
+ module PaymentProvider
1352
+ extend Orb::Internal::Type::Enum
1353
+
1354
+ TaggedSymbol =
1355
+ T.type_alias do
1356
+ T.all(
1357
+ Symbol,
1358
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::PaymentAttempt::PaymentProvider
1359
+ )
1360
+ end
1361
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1362
+
1363
+ STRIPE =
1364
+ T.let(
1365
+ :stripe,
1366
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::PaymentAttempt::PaymentProvider::TaggedSymbol
1367
+ )
1368
+ ADYEN =
1369
+ T.let(
1370
+ :adyen,
1371
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::PaymentAttempt::PaymentProvider::TaggedSymbol
1372
+ )
1373
+
1374
+ sig do
1375
+ override.returns(
1376
+ T::Array[
1377
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::PaymentAttempt::PaymentProvider::TaggedSymbol
1378
+ ]
1379
+ )
1380
+ end
1381
+ def self.values
1382
+ end
1383
+ end
1384
+ end
1385
+
1386
+ module Status
1387
+ extend Orb::Internal::Type::Enum
1388
+
1389
+ TaggedSymbol =
1390
+ T.type_alias do
1391
+ T.all(
1392
+ Symbol,
1393
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::Status
1394
+ )
1395
+ end
1396
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1397
+
1398
+ ISSUED =
1399
+ T.let(
1400
+ :issued,
1401
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::Status::TaggedSymbol
1402
+ )
1403
+ PAID =
1404
+ T.let(
1405
+ :paid,
1406
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::Status::TaggedSymbol
1407
+ )
1408
+ SYNCED =
1409
+ T.let(
1410
+ :synced,
1411
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::Status::TaggedSymbol
1412
+ )
1413
+ VOID =
1414
+ T.let(
1415
+ :void,
1416
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::Status::TaggedSymbol
1417
+ )
1418
+ DRAFT =
1419
+ T.let(
1420
+ :draft,
1421
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::Status::TaggedSymbol
1422
+ )
1423
+
1424
+ sig do
1425
+ override.returns(
1426
+ T::Array[
1427
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Invoice::Status::TaggedSymbol
1428
+ ]
1429
+ )
1430
+ end
1431
+ def self.values
1432
+ end
1433
+ end
1434
+ end
1435
+
1436
+ # The serialization style this payload was rendered in, as configured on the
1437
+ # endpoint.
1438
+ module PayloadStyle
1439
+ extend Orb::Internal::Type::Enum
1440
+
1441
+ TaggedSymbol =
1442
+ T.type_alias do
1443
+ T.all(
1444
+ Symbol,
1445
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::PayloadStyle
1446
+ )
1447
+ end
1448
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1449
+
1450
+ EXPANDED =
1451
+ T.let(
1452
+ :expanded,
1453
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::PayloadStyle::TaggedSymbol
1454
+ )
1455
+ STANDARD =
1456
+ T.let(
1457
+ :standard,
1458
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::PayloadStyle::TaggedSymbol
1459
+ )
1460
+
1461
+ sig do
1462
+ override.returns(
1463
+ T::Array[
1464
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::PayloadStyle::TaggedSymbol
1465
+ ]
1466
+ )
1467
+ end
1468
+ def self.values
1469
+ end
1470
+ end
1471
+
1472
+ class Properties < Orb::Internal::Type::BaseModel
1473
+ OrHash =
1474
+ T.type_alias do
1475
+ T.any(
1476
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties,
1477
+ Orb::Internal::AnyHash
1478
+ )
1479
+ end
1480
+
1481
+ # `due_date` is an ISO-8601 string rather than a datetime: the untyped message
1482
+ # called `.isoformat()` on it, so it keeps microseconds where the webhook JSON
1483
+ # provider would have truncated them.
1484
+ sig do
1485
+ returns(
1486
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes
1487
+ )
1488
+ end
1489
+ attr_reader :previous_attributes
1490
+
1491
+ sig do
1492
+ params(
1493
+ previous_attributes:
1494
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::OrHash
1495
+ ).void
1496
+ end
1497
+ attr_writer :previous_attributes
1498
+
1499
+ sig do
1500
+ params(
1501
+ previous_attributes:
1502
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::OrHash
1503
+ ).returns(T.attached_class)
1504
+ end
1505
+ def self.new(
1506
+ # `due_date` is an ISO-8601 string rather than a datetime: the untyped message
1507
+ # called `.isoformat()` on it, so it keeps microseconds where the webhook JSON
1508
+ # provider would have truncated them.
1509
+ previous_attributes:
1510
+ )
1511
+ end
1512
+
1513
+ sig do
1514
+ override.returns(
1515
+ {
1516
+ previous_attributes:
1517
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes
1518
+ }
1519
+ )
1520
+ end
1521
+ def to_hash
1522
+ end
1523
+
1524
+ class PreviousAttributes < Orb::Internal::Type::BaseModel
1525
+ OrHash =
1526
+ T.type_alias do
1527
+ T.any(
1528
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes,
1529
+ Orb::Internal::AnyHash
1530
+ )
1531
+ end
1532
+
1533
+ sig { returns(T.nilable(String)) }
1534
+ attr_accessor :amount_due
1535
+
1536
+ sig do
1537
+ returns(T.nilable(T::Array[Orb::InvoiceLevelDiscount::Variants]))
1538
+ end
1539
+ attr_accessor :discounts
1540
+
1541
+ sig { returns(T.nilable(String)) }
1542
+ attr_accessor :due_date
1543
+
1544
+ sig do
1545
+ returns(
1546
+ T.nilable(
1547
+ T::Array[
1548
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem
1549
+ ]
1550
+ )
1551
+ )
1552
+ end
1553
+ attr_accessor :line_items
1554
+
1555
+ sig { returns(T.nilable(Orb::Maximum)) }
1556
+ attr_reader :maximum
1557
+
1558
+ sig { params(maximum: T.nilable(Orb::Maximum::OrHash)).void }
1559
+ attr_writer :maximum
1560
+
1561
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
1562
+ attr_accessor :metadata
1563
+
1564
+ sig { returns(T.nilable(Orb::Minimum)) }
1565
+ attr_reader :minimum
1566
+
1567
+ sig { params(minimum: T.nilable(Orb::Minimum::OrHash)).void }
1568
+ attr_writer :minimum
1569
+
1570
+ sig { returns(T.nilable(Integer)) }
1571
+ attr_accessor :net_terms
1572
+
1573
+ sig { returns(T.nilable(String)) }
1574
+ attr_accessor :subtotal
1575
+
1576
+ sig { returns(T.nilable(String)) }
1577
+ attr_accessor :total
1578
+
1579
+ # `due_date` is an ISO-8601 string rather than a datetime: the untyped message
1580
+ # called `.isoformat()` on it, so it keeps microseconds where the webhook JSON
1581
+ # provider would have truncated them.
1582
+ sig do
1583
+ params(
1584
+ amount_due: T.nilable(String),
1585
+ discounts:
1586
+ T.nilable(
1587
+ T::Array[
1588
+ T.any(
1589
+ Orb::PercentageDiscount::OrHash,
1590
+ Orb::AmountDiscount::OrHash,
1591
+ Orb::TrialDiscount::OrHash,
1592
+ Orb::InvoiceLevelDiscount::TieredPercentage::OrHash
1593
+ )
1594
+ ]
1595
+ ),
1596
+ due_date: T.nilable(String),
1597
+ line_items:
1598
+ T.nilable(
1599
+ T::Array[
1600
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::OrHash
1601
+ ]
1602
+ ),
1603
+ maximum: T.nilable(Orb::Maximum::OrHash),
1604
+ metadata: T.nilable(T::Hash[Symbol, String]),
1605
+ minimum: T.nilable(Orb::Minimum::OrHash),
1606
+ net_terms: T.nilable(Integer),
1607
+ subtotal: T.nilable(String),
1608
+ total: T.nilable(String)
1609
+ ).returns(T.attached_class)
1610
+ end
1611
+ def self.new(
1612
+ amount_due: nil,
1613
+ discounts: nil,
1614
+ due_date: nil,
1615
+ line_items: nil,
1616
+ maximum: nil,
1617
+ metadata: nil,
1618
+ minimum: nil,
1619
+ net_terms: nil,
1620
+ subtotal: nil,
1621
+ total: nil
1622
+ )
1623
+ end
1624
+
1625
+ sig do
1626
+ override.returns(
1627
+ {
1628
+ amount_due: T.nilable(String),
1629
+ discounts:
1630
+ T.nilable(T::Array[Orb::InvoiceLevelDiscount::Variants]),
1631
+ due_date: T.nilable(String),
1632
+ line_items:
1633
+ T.nilable(
1634
+ T::Array[
1635
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem
1636
+ ]
1637
+ ),
1638
+ maximum: T.nilable(Orb::Maximum),
1639
+ metadata: T.nilable(T::Hash[Symbol, String]),
1640
+ minimum: T.nilable(Orb::Minimum),
1641
+ net_terms: T.nilable(Integer),
1642
+ subtotal: T.nilable(String),
1643
+ total: T.nilable(String)
1644
+ }
1645
+ )
1646
+ end
1647
+ def to_hash
1648
+ end
1649
+
1650
+ class LineItem < Orb::Internal::Type::BaseModel
1651
+ OrHash =
1652
+ T.type_alias do
1653
+ T.any(
1654
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem,
1655
+ Orb::Internal::AnyHash
1656
+ )
1657
+ end
1658
+
1659
+ # A unique ID for this line item.
1660
+ sig { returns(String) }
1661
+ attr_accessor :id
1662
+
1663
+ # The line amount after any adjustments and before overage conversion, credits and
1664
+ # partial invoicing.
1665
+ sig { returns(String) }
1666
+ attr_accessor :adjusted_subtotal
1667
+
1668
+ # All adjustments applied to the line item in the order they were applied based on
1669
+ # invoice calculations (ie. usage discounts -> amount discounts -> percentage
1670
+ # discounts -> minimums -> maximums).
1671
+ sig do
1672
+ returns(
1673
+ T::Array[
1674
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::Variants
1675
+ ]
1676
+ )
1677
+ end
1678
+ attr_accessor :adjustments
1679
+
1680
+ # The final amount for a line item after all adjustments and pre paid credits have
1681
+ # been applied.
1682
+ sig { returns(String) }
1683
+ attr_accessor :amount
1684
+
1685
+ # The number of prepaid credits applied.
1686
+ sig { returns(String) }
1687
+ attr_accessor :credits_applied
1688
+
1689
+ # The end date of the range of time applied for this line item's price.
1690
+ sig { returns(Time) }
1691
+ attr_accessor :end_date
1692
+
1693
+ # An additional filter that was used to calculate the usage for this line item.
1694
+ sig { returns(T.nilable(String)) }
1695
+ attr_accessor :filter
1696
+
1697
+ # [DEPRECATED] For configured prices that are split by a grouping key, this will
1698
+ # be populated with the key and a value. The `amount` and `subtotal` will be the
1699
+ # values for this particular grouping.
1700
+ sig { returns(T.nilable(String)) }
1701
+ attr_accessor :grouping
1702
+
1703
+ # The name of the price associated with this line item.
1704
+ sig { returns(String) }
1705
+ attr_accessor :name
1706
+
1707
+ # Any amount applied from a partial invoice
1708
+ sig { returns(String) }
1709
+ attr_accessor :partially_invoiced_amount
1710
+
1711
+ # The Price resource represents a price that can be billed on a subscription,
1712
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
1713
+ # take a quantity and determine an amount to bill.
1714
+ #
1715
+ # Orb supports a few different pricing models out of the box. Each of these models
1716
+ # is serialized differently in a given Price object. The model_type field
1717
+ # determines the key for the configuration object that is present.
1718
+ #
1719
+ # For more on the types of prices, see
1720
+ # [the core concepts documentation](/core-concepts#plan-and-price)
1721
+ sig { returns(Orb::Price::Variants) }
1722
+ attr_accessor :price
1723
+
1724
+ # Either the fixed fee quantity or the usage during the service period.
1725
+ sig { returns(Float) }
1726
+ attr_accessor :quantity
1727
+
1728
+ # The start date of the range of time applied for this line item's price.
1729
+ sig { returns(Time) }
1730
+ attr_accessor :start_date
1731
+
1732
+ # For complex pricing structures, the line item can be broken down further in
1733
+ # `sub_line_items`.
1734
+ sig do
1735
+ returns(
1736
+ T::Array[
1737
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::SubLineItem::Variants
1738
+ ]
1739
+ )
1740
+ end
1741
+ attr_accessor :sub_line_items
1742
+
1743
+ # The line amount before any adjustments.
1744
+ sig { returns(String) }
1745
+ attr_accessor :subtotal
1746
+
1747
+ # An array of tax rates and their incurred tax amounts. Empty if no tax
1748
+ # integration is configured.
1749
+ sig { returns(T::Array[Orb::TaxAmount]) }
1750
+ attr_accessor :tax_amounts
1751
+
1752
+ # A list of customer ids that were used to calculate the usage for this line item.
1753
+ sig { returns(T.nilable(T::Array[String])) }
1754
+ attr_accessor :usage_customer_ids
1755
+
1756
+ sig do
1757
+ params(
1758
+ id: String,
1759
+ adjusted_subtotal: String,
1760
+ adjustments:
1761
+ T::Array[
1762
+ T.any(
1763
+ Orb::MonetaryUsageDiscountAdjustment::OrHash,
1764
+ Orb::MonetaryAmountDiscountAdjustment::OrHash,
1765
+ Orb::MonetaryPercentageDiscountAdjustment::OrHash,
1766
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::OrHash,
1767
+ Orb::MonetaryMinimumAdjustment::OrHash,
1768
+ Orb::MonetaryMaximumAdjustment::OrHash
1769
+ )
1770
+ ],
1771
+ amount: String,
1772
+ credits_applied: String,
1773
+ end_date: Time,
1774
+ filter: T.nilable(String),
1775
+ grouping: T.nilable(String),
1776
+ name: String,
1777
+ partially_invoiced_amount: String,
1778
+ price:
1779
+ T.any(
1780
+ Orb::Price::Unit::OrHash,
1781
+ Orb::Price::Tiered::OrHash,
1782
+ Orb::Price::Bulk::OrHash,
1783
+ Orb::Price::BulkWithFilters::OrHash,
1784
+ Orb::Price::Package::OrHash,
1785
+ Orb::Price::Matrix::OrHash,
1786
+ Orb::Price::ThresholdTotalAmount::OrHash,
1787
+ Orb::Price::TieredPackage::OrHash,
1788
+ Orb::Price::TieredWithMinimum::OrHash,
1789
+ Orb::Price::GroupedTiered::OrHash,
1790
+ Orb::Price::GroupedTieredMatrix::OrHash,
1791
+ Orb::Price::TieredPackageWithMinimum::OrHash,
1792
+ Orb::Price::PackageWithAllocation::OrHash,
1793
+ Orb::Price::UnitWithPercent::OrHash,
1794
+ Orb::Price::MatrixWithAllocation::OrHash,
1795
+ Orb::Price::TieredMatrixWithAllocation::OrHash,
1796
+ Orb::Price::MatrixWithThresholdDiscounts::OrHash,
1797
+ Orb::Price::TieredWithProration::OrHash,
1798
+ Orb::Price::UnitWithProration::OrHash,
1799
+ Orb::Price::GroupedAllocation::OrHash,
1800
+ Orb::Price::BulkWithProration::OrHash,
1801
+ Orb::Price::GroupedWithProratedMinimum::OrHash,
1802
+ Orb::Price::GroupedWithMeteredMinimum::OrHash,
1803
+ Orb::Price::GroupedWithMinMaxThresholds::OrHash,
1804
+ Orb::Price::MatrixWithDisplayName::OrHash,
1805
+ Orb::Price::GroupedTieredPackage::OrHash,
1806
+ Orb::Price::MaxGroupTieredPackage::OrHash,
1807
+ Orb::Price::ScalableMatrixWithUnitPricing::OrHash,
1808
+ Orb::Price::ScalableMatrixWithTieredPricing::OrHash,
1809
+ Orb::Price::CumulativeGroupedBulk::OrHash,
1810
+ Orb::Price::CumulativeGroupedAllocation::OrHash,
1811
+ Orb::Price::DailyCreditAllowance::OrHash,
1812
+ Orb::Price::MeteredAllowance::OrHash,
1813
+ Orb::Price::MinimumComposite::OrHash,
1814
+ Orb::Price::Percent::OrHash,
1815
+ Orb::Price::EventOutput::OrHash
1816
+ ),
1817
+ quantity: Float,
1818
+ start_date: Time,
1819
+ sub_line_items:
1820
+ T::Array[
1821
+ T.any(
1822
+ Orb::MatrixSubLineItem::OrHash,
1823
+ Orb::TierSubLineItem::OrHash,
1824
+ Orb::OtherSubLineItem::OrHash
1825
+ )
1826
+ ],
1827
+ subtotal: String,
1828
+ tax_amounts: T::Array[Orb::TaxAmount::OrHash],
1829
+ usage_customer_ids: T.nilable(T::Array[String])
1830
+ ).returns(T.attached_class)
1831
+ end
1832
+ def self.new(
1833
+ # A unique ID for this line item.
1834
+ id:,
1835
+ # The line amount after any adjustments and before overage conversion, credits and
1836
+ # partial invoicing.
1837
+ adjusted_subtotal:,
1838
+ # All adjustments applied to the line item in the order they were applied based on
1839
+ # invoice calculations (ie. usage discounts -> amount discounts -> percentage
1840
+ # discounts -> minimums -> maximums).
1841
+ adjustments:,
1842
+ # The final amount for a line item after all adjustments and pre paid credits have
1843
+ # been applied.
1844
+ amount:,
1845
+ # The number of prepaid credits applied.
1846
+ credits_applied:,
1847
+ # The end date of the range of time applied for this line item's price.
1848
+ end_date:,
1849
+ # An additional filter that was used to calculate the usage for this line item.
1850
+ filter:,
1851
+ # [DEPRECATED] For configured prices that are split by a grouping key, this will
1852
+ # be populated with the key and a value. The `amount` and `subtotal` will be the
1853
+ # values for this particular grouping.
1854
+ grouping:,
1855
+ # The name of the price associated with this line item.
1856
+ name:,
1857
+ # Any amount applied from a partial invoice
1858
+ partially_invoiced_amount:,
1859
+ # The Price resource represents a price that can be billed on a subscription,
1860
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
1861
+ # take a quantity and determine an amount to bill.
1862
+ #
1863
+ # Orb supports a few different pricing models out of the box. Each of these models
1864
+ # is serialized differently in a given Price object. The model_type field
1865
+ # determines the key for the configuration object that is present.
1866
+ #
1867
+ # For more on the types of prices, see
1868
+ # [the core concepts documentation](/core-concepts#plan-and-price)
1869
+ price:,
1870
+ # Either the fixed fee quantity or the usage during the service period.
1871
+ quantity:,
1872
+ # The start date of the range of time applied for this line item's price.
1873
+ start_date:,
1874
+ # For complex pricing structures, the line item can be broken down further in
1875
+ # `sub_line_items`.
1876
+ sub_line_items:,
1877
+ # The line amount before any adjustments.
1878
+ subtotal:,
1879
+ # An array of tax rates and their incurred tax amounts. Empty if no tax
1880
+ # integration is configured.
1881
+ tax_amounts:,
1882
+ # A list of customer ids that were used to calculate the usage for this line item.
1883
+ usage_customer_ids:
1884
+ )
1885
+ end
1886
+
1887
+ sig do
1888
+ override.returns(
1889
+ {
1890
+ id: String,
1891
+ adjusted_subtotal: String,
1892
+ adjustments:
1893
+ T::Array[
1894
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::Variants
1895
+ ],
1896
+ amount: String,
1897
+ credits_applied: String,
1898
+ end_date: Time,
1899
+ filter: T.nilable(String),
1900
+ grouping: T.nilable(String),
1901
+ name: String,
1902
+ partially_invoiced_amount: String,
1903
+ price: Orb::Price::Variants,
1904
+ quantity: Float,
1905
+ start_date: Time,
1906
+ sub_line_items:
1907
+ T::Array[
1908
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::SubLineItem::Variants
1909
+ ],
1910
+ subtotal: String,
1911
+ tax_amounts: T::Array[Orb::TaxAmount],
1912
+ usage_customer_ids: T.nilable(T::Array[String])
1913
+ }
1914
+ )
1915
+ end
1916
+ def to_hash
1917
+ end
1918
+
1919
+ module Adjustment
1920
+ extend Orb::Internal::Type::Union
1921
+
1922
+ Variants =
1923
+ T.type_alias do
1924
+ T.any(
1925
+ Orb::MonetaryUsageDiscountAdjustment,
1926
+ Orb::MonetaryAmountDiscountAdjustment,
1927
+ Orb::MonetaryPercentageDiscountAdjustment,
1928
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount,
1929
+ Orb::MonetaryMinimumAdjustment,
1930
+ Orb::MonetaryMaximumAdjustment
1931
+ )
1932
+ end
1933
+
1934
+ class TieredPercentageDiscount < Orb::Internal::Type::BaseModel
1935
+ OrHash =
1936
+ T.type_alias do
1937
+ T.any(
1938
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount,
1939
+ Orb::Internal::AnyHash
1940
+ )
1941
+ end
1942
+
1943
+ sig { returns(String) }
1944
+ attr_accessor :id
1945
+
1946
+ sig { returns(Symbol) }
1947
+ attr_accessor :adjustment_type
1948
+
1949
+ # The value applied by an adjustment.
1950
+ sig { returns(String) }
1951
+ attr_accessor :amount
1952
+
1953
+ # The price IDs that this adjustment applies to.
1954
+ sig { returns(T::Array[String]) }
1955
+ attr_accessor :applies_to_price_ids
1956
+
1957
+ # The filters that determine which prices to apply this adjustment to.
1958
+ sig do
1959
+ returns(
1960
+ T::Array[
1961
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter
1962
+ ]
1963
+ )
1964
+ end
1965
+ attr_accessor :filters
1966
+
1967
+ # True for adjustments that apply to an entire invoice, false for adjustments that
1968
+ # apply to only one price.
1969
+ sig { returns(T::Boolean) }
1970
+ attr_accessor :is_invoice_level
1971
+
1972
+ # The reason for the adjustment.
1973
+ sig { returns(T.nilable(String)) }
1974
+ attr_accessor :reason
1975
+
1976
+ # The adjustment id this adjustment replaces. This adjustment will take the place
1977
+ # of the replaced adjustment in plan version migrations.
1978
+ sig { returns(T.nilable(String)) }
1979
+ attr_accessor :replaces_adjustment_id
1980
+
1981
+ # The ordered, contiguous bands of cumulative eligible spend, each discounted at
1982
+ # its own percentage (progressive fill-a-tier), applied to the prices this
1983
+ # adjustment covers in a given billing period.
1984
+ sig do
1985
+ returns(
1986
+ T::Array[
1987
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Tier
1988
+ ]
1989
+ )
1990
+ end
1991
+ attr_accessor :tiers
1992
+
1993
+ sig do
1994
+ params(
1995
+ id: String,
1996
+ amount: String,
1997
+ applies_to_price_ids: T::Array[String],
1998
+ filters:
1999
+ T::Array[
2000
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::OrHash
2001
+ ],
2002
+ is_invoice_level: T::Boolean,
2003
+ reason: T.nilable(String),
2004
+ replaces_adjustment_id: T.nilable(String),
2005
+ tiers:
2006
+ T::Array[
2007
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Tier::OrHash
2008
+ ],
2009
+ adjustment_type: Symbol
2010
+ ).returns(T.attached_class)
2011
+ end
2012
+ def self.new(
2013
+ id:,
2014
+ # The value applied by an adjustment.
2015
+ amount:,
2016
+ # The price IDs that this adjustment applies to.
2017
+ applies_to_price_ids:,
2018
+ # The filters that determine which prices to apply this adjustment to.
2019
+ filters:,
2020
+ # True for adjustments that apply to an entire invoice, false for adjustments that
2021
+ # apply to only one price.
2022
+ is_invoice_level:,
2023
+ # The reason for the adjustment.
2024
+ reason:,
2025
+ # The adjustment id this adjustment replaces. This adjustment will take the place
2026
+ # of the replaced adjustment in plan version migrations.
2027
+ replaces_adjustment_id:,
2028
+ # The ordered, contiguous bands of cumulative eligible spend, each discounted at
2029
+ # its own percentage (progressive fill-a-tier), applied to the prices this
2030
+ # adjustment covers in a given billing period.
2031
+ tiers:,
2032
+ adjustment_type: :tiered_percentage_discount
2033
+ )
2034
+ end
2035
+
2036
+ sig do
2037
+ override.returns(
2038
+ {
2039
+ id: String,
2040
+ adjustment_type: Symbol,
2041
+ amount: String,
2042
+ applies_to_price_ids: T::Array[String],
2043
+ filters:
2044
+ T::Array[
2045
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter
2046
+ ],
2047
+ is_invoice_level: T::Boolean,
2048
+ reason: T.nilable(String),
2049
+ replaces_adjustment_id: T.nilable(String),
2050
+ tiers:
2051
+ T::Array[
2052
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Tier
2053
+ ]
2054
+ }
2055
+ )
2056
+ end
2057
+ def to_hash
2058
+ end
2059
+
2060
+ class Filter < Orb::Internal::Type::BaseModel
2061
+ OrHash =
2062
+ T.type_alias do
2063
+ T.any(
2064
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter,
2065
+ Orb::Internal::AnyHash
2066
+ )
2067
+ end
2068
+
2069
+ # The property of the price to filter on.
2070
+ sig do
2071
+ returns(
2072
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
2073
+ )
2074
+ end
2075
+ attr_accessor :field
2076
+
2077
+ # Should prices that match the filter be included or excluded.
2078
+ sig do
2079
+ returns(
2080
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator::TaggedSymbol
2081
+ )
2082
+ end
2083
+ attr_accessor :operator
2084
+
2085
+ # The IDs or values that match this filter.
2086
+ sig { returns(T::Array[String]) }
2087
+ attr_accessor :values
2088
+
2089
+ sig do
2090
+ params(
2091
+ field:
2092
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::OrSymbol,
2093
+ operator:
2094
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator::OrSymbol,
2095
+ values: T::Array[String]
2096
+ ).returns(T.attached_class)
2097
+ end
2098
+ def self.new(
2099
+ # The property of the price to filter on.
2100
+ field:,
2101
+ # Should prices that match the filter be included or excluded.
2102
+ operator:,
2103
+ # The IDs or values that match this filter.
2104
+ values:
2105
+ )
2106
+ end
2107
+
2108
+ sig do
2109
+ override.returns(
2110
+ {
2111
+ field:
2112
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol,
2113
+ operator:
2114
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator::TaggedSymbol,
2115
+ values: T::Array[String]
2116
+ }
2117
+ )
2118
+ end
2119
+ def to_hash
2120
+ end
2121
+
2122
+ # The property of the price to filter on.
2123
+ module Field
2124
+ extend Orb::Internal::Type::Enum
2125
+
2126
+ TaggedSymbol =
2127
+ T.type_alias do
2128
+ T.all(
2129
+ Symbol,
2130
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field
2131
+ )
2132
+ end
2133
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2134
+
2135
+ PRICE_ID =
2136
+ T.let(
2137
+ :price_id,
2138
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
2139
+ )
2140
+ ITEM_ID =
2141
+ T.let(
2142
+ :item_id,
2143
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
2144
+ )
2145
+ PRICE_TYPE =
2146
+ T.let(
2147
+ :price_type,
2148
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
2149
+ )
2150
+ CURRENCY =
2151
+ T.let(
2152
+ :currency,
2153
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
2154
+ )
2155
+ PRICING_UNIT_ID =
2156
+ T.let(
2157
+ :pricing_unit_id,
2158
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
2159
+ )
2160
+
2161
+ sig do
2162
+ override.returns(
2163
+ T::Array[
2164
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Field::TaggedSymbol
2165
+ ]
2166
+ )
2167
+ end
2168
+ def self.values
2169
+ end
2170
+ end
2171
+
2172
+ # Should prices that match the filter be included or excluded.
2173
+ module Operator
2174
+ extend Orb::Internal::Type::Enum
2175
+
2176
+ TaggedSymbol =
2177
+ T.type_alias do
2178
+ T.all(
2179
+ Symbol,
2180
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator
2181
+ )
2182
+ end
2183
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2184
+
2185
+ INCLUDES =
2186
+ T.let(
2187
+ :includes,
2188
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator::TaggedSymbol
2189
+ )
2190
+ EXCLUDES =
2191
+ T.let(
2192
+ :excludes,
2193
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator::TaggedSymbol
2194
+ )
2195
+
2196
+ sig do
2197
+ override.returns(
2198
+ T::Array[
2199
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Filter::Operator::TaggedSymbol
2200
+ ]
2201
+ )
2202
+ end
2203
+ def self.values
2204
+ end
2205
+ end
2206
+ end
2207
+
2208
+ class Tier < Orb::Internal::Type::BaseModel
2209
+ OrHash =
2210
+ T.type_alias do
2211
+ T.any(
2212
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::TieredPercentageDiscount::Tier,
2213
+ Orb::Internal::AnyHash
2214
+ )
2215
+ end
2216
+
2217
+ # Exclusive lower bound of cumulative spend for this tier.
2218
+ sig { returns(Float) }
2219
+ attr_accessor :lower_bound
2220
+
2221
+ # The percentage (between 0 and 1) discounted from spend that falls within this
2222
+ # tier.
2223
+ sig { returns(Float) }
2224
+ attr_accessor :percentage
2225
+
2226
+ # Inclusive upper bound of cumulative spend for this tier; null for the final
2227
+ # open-ended tier.
2228
+ sig { returns(T.nilable(Float)) }
2229
+ attr_accessor :upper_bound
2230
+
2231
+ # One band of a tiered percentage discount. Bounds are denominated in the
2232
+ # discount's currency. `lower_bound` is the exclusive start of the band and
2233
+ # `upper_bound` is the inclusive end; `upper_bound` is null only for the
2234
+ # open-ended final tier.
2235
+ sig do
2236
+ params(
2237
+ lower_bound: Float,
2238
+ percentage: Float,
2239
+ upper_bound: T.nilable(Float)
2240
+ ).returns(T.attached_class)
2241
+ end
2242
+ def self.new(
2243
+ # Exclusive lower bound of cumulative spend for this tier.
2244
+ lower_bound:,
2245
+ # The percentage (between 0 and 1) discounted from spend that falls within this
2246
+ # tier.
2247
+ percentage:,
2248
+ # Inclusive upper bound of cumulative spend for this tier; null for the final
2249
+ # open-ended tier.
2250
+ upper_bound: nil
2251
+ )
2252
+ end
2253
+
2254
+ sig do
2255
+ override.returns(
2256
+ {
2257
+ lower_bound: Float,
2258
+ percentage: Float,
2259
+ upper_bound: T.nilable(Float)
2260
+ }
2261
+ )
2262
+ end
2263
+ def to_hash
2264
+ end
2265
+ end
2266
+ end
2267
+
2268
+ sig do
2269
+ override.returns(
2270
+ T::Array[
2271
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::Adjustment::Variants
2272
+ ]
2273
+ )
2274
+ end
2275
+ def self.variants
2276
+ end
2277
+ end
2278
+
2279
+ module SubLineItem
2280
+ extend Orb::Internal::Type::Union
2281
+
2282
+ Variants =
2283
+ T.type_alias do
2284
+ T.any(
2285
+ Orb::MatrixSubLineItem,
2286
+ Orb::TierSubLineItem,
2287
+ Orb::OtherSubLineItem
2288
+ )
2289
+ end
2290
+
2291
+ sig do
2292
+ override.returns(
2293
+ T::Array[
2294
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Properties::PreviousAttributes::LineItem::SubLineItem::Variants
2295
+ ]
2296
+ )
2297
+ end
2298
+ def self.variants
2299
+ end
2300
+ end
2301
+ end
2302
+ end
2303
+ end
2304
+
2305
+ # The event this payload describes.
2306
+ module Type
2307
+ extend Orb::Internal::Type::Enum
2308
+
2309
+ TaggedSymbol =
2310
+ T.type_alias do
2311
+ T.all(
2312
+ Symbol,
2313
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Type
2314
+ )
2315
+ end
2316
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2317
+
2318
+ INVOICE_EDITED =
2319
+ T.let(
2320
+ :"invoice.edited",
2321
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Type::TaggedSymbol
2322
+ )
2323
+
2324
+ sig do
2325
+ override.returns(
2326
+ T::Array[
2327
+ Orb::Webhooks::InvoiceEditedStandardWebhookEvent::Type::TaggedSymbol
2328
+ ]
2329
+ )
2330
+ end
2331
+ def self.values
2332
+ end
2333
+ end
2334
+ end
2335
+ end
2336
+ end
2337
+ end