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