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,1298 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ module Webhooks
6
+ class SubscriptionCostExceededStandardWebhookEvent < Orb::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent,
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
+ # The serialization style this payload was rendered in, as configured on the
24
+ # endpoint.
25
+ sig do
26
+ returns(
27
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::PayloadStyle::TaggedSymbol
28
+ )
29
+ end
30
+ attr_accessor :payload_style
31
+
32
+ sig do
33
+ returns(
34
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties
35
+ )
36
+ end
37
+ attr_reader :properties
38
+
39
+ sig do
40
+ params(
41
+ properties:
42
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::OrHash
43
+ ).void
44
+ end
45
+ attr_writer :properties
46
+
47
+ # The subscription in a standard webhook payload: its own fields, with its plan
48
+ # and customer as references. Fetch the subscription for its price intervals,
49
+ # billing periods, plan phases and other derived fields.
50
+ sig do
51
+ returns(
52
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription
53
+ )
54
+ end
55
+ attr_reader :subscription
56
+
57
+ sig do
58
+ params(
59
+ subscription:
60
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::OrHash
61
+ ).void
62
+ end
63
+ attr_writer :subscription
64
+
65
+ # The event this payload describes.
66
+ sig do
67
+ returns(
68
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Type::TaggedSymbol
69
+ )
70
+ end
71
+ attr_accessor :type
72
+
73
+ # Issued when a subscription's cost exceeds a pre-configured amount threshold.
74
+ sig do
75
+ params(
76
+ id: String,
77
+ created_at: Time,
78
+ payload_style:
79
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::PayloadStyle::OrSymbol,
80
+ properties:
81
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::OrHash,
82
+ subscription:
83
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::OrHash,
84
+ type:
85
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Type::OrSymbol
86
+ ).returns(T.attached_class)
87
+ end
88
+ def self.new(
89
+ # The ID of this webhook event.
90
+ id:,
91
+ # The time at which this event was created, to the second.
92
+ created_at:,
93
+ # The serialization style this payload was rendered in, as configured on the
94
+ # endpoint.
95
+ payload_style:,
96
+ properties:,
97
+ # The subscription in a standard webhook payload: its own fields, with its plan
98
+ # and customer as references. Fetch the subscription for its price intervals,
99
+ # billing periods, plan phases and other derived fields.
100
+ subscription:,
101
+ # The event this payload describes.
102
+ type:
103
+ )
104
+ end
105
+
106
+ sig do
107
+ override.returns(
108
+ {
109
+ id: String,
110
+ created_at: Time,
111
+ payload_style:
112
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::PayloadStyle::TaggedSymbol,
113
+ properties:
114
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties,
115
+ subscription:
116
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription,
117
+ type:
118
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Type::TaggedSymbol
119
+ }
120
+ )
121
+ end
122
+ def to_hash
123
+ end
124
+
125
+ # The serialization style this payload was rendered in, as configured on the
126
+ # endpoint.
127
+ module PayloadStyle
128
+ extend Orb::Internal::Type::Enum
129
+
130
+ TaggedSymbol =
131
+ T.type_alias do
132
+ T.all(
133
+ Symbol,
134
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::PayloadStyle
135
+ )
136
+ end
137
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
138
+
139
+ EXPANDED =
140
+ T.let(
141
+ :expanded,
142
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::PayloadStyle::TaggedSymbol
143
+ )
144
+ STANDARD =
145
+ T.let(
146
+ :standard,
147
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::PayloadStyle::TaggedSymbol
148
+ )
149
+
150
+ sig do
151
+ override.returns(
152
+ T::Array[
153
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::PayloadStyle::TaggedSymbol
154
+ ]
155
+ )
156
+ end
157
+ def self.values
158
+ end
159
+ end
160
+
161
+ class Properties < Orb::Internal::Type::BaseModel
162
+ OrHash =
163
+ T.type_alias do
164
+ T.any(
165
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties,
166
+ Orb::Internal::AnyHash
167
+ )
168
+ end
169
+
170
+ # [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
171
+ # usage, or credit balance and trigger webhooks when a threshold is exceeded.
172
+ #
173
+ # Alerts created through the API can be scoped to either customers or
174
+ # subscriptions.
175
+ sig do
176
+ returns(
177
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration
178
+ )
179
+ end
180
+ attr_reader :alert_configuration
181
+
182
+ sig do
183
+ params(
184
+ alert_configuration:
185
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::OrHash
186
+ ).void
187
+ end
188
+ attr_writer :alert_configuration
189
+
190
+ sig { returns(T.nilable(String)) }
191
+ attr_accessor :amount_threshold
192
+
193
+ sig { returns(T.nilable(String)) }
194
+ attr_accessor :evaluated_amount
195
+
196
+ sig { returns(Time) }
197
+ attr_accessor :timeframe_end
198
+
199
+ sig { returns(Time) }
200
+ attr_accessor :timeframe_start
201
+
202
+ sig do
203
+ params(
204
+ alert_configuration:
205
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::OrHash,
206
+ amount_threshold: T.nilable(String),
207
+ evaluated_amount: T.nilable(String),
208
+ timeframe_end: Time,
209
+ timeframe_start: Time
210
+ ).returns(T.attached_class)
211
+ end
212
+ def self.new(
213
+ # [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
214
+ # usage, or credit balance and trigger webhooks when a threshold is exceeded.
215
+ #
216
+ # Alerts created through the API can be scoped to either customers or
217
+ # subscriptions.
218
+ alert_configuration:,
219
+ amount_threshold:,
220
+ evaluated_amount:,
221
+ timeframe_end:,
222
+ timeframe_start:
223
+ )
224
+ end
225
+
226
+ sig do
227
+ override.returns(
228
+ {
229
+ alert_configuration:
230
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration,
231
+ amount_threshold: T.nilable(String),
232
+ evaluated_amount: T.nilable(String),
233
+ timeframe_end: Time,
234
+ timeframe_start: Time
235
+ }
236
+ )
237
+ end
238
+ def to_hash
239
+ end
240
+
241
+ class AlertConfiguration < Orb::Internal::Type::BaseModel
242
+ OrHash =
243
+ T.type_alias do
244
+ T.any(
245
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration,
246
+ Orb::Internal::AnyHash
247
+ )
248
+ end
249
+
250
+ # Also referred to as alert_id in this documentation.
251
+ sig { returns(String) }
252
+ attr_accessor :id
253
+
254
+ # The creation time of the resource in Orb.
255
+ sig { returns(Time) }
256
+ attr_accessor :created_at
257
+
258
+ # The name of the currency the credit balance or invoice cost is denominated in.
259
+ sig { returns(T.nilable(String)) }
260
+ attr_accessor :currency
261
+
262
+ # The customer the alert applies to.
263
+ sig { returns(T.nilable(Orb::CustomerMinified)) }
264
+ attr_reader :customer
265
+
266
+ sig do
267
+ params(customer: T.nilable(Orb::CustomerMinified::OrHash)).void
268
+ end
269
+ attr_writer :customer
270
+
271
+ # Whether the alert is enabled or disabled.
272
+ sig { returns(T::Boolean) }
273
+ attr_accessor :enabled
274
+
275
+ # The metric the alert applies to.
276
+ sig do
277
+ returns(
278
+ T.nilable(
279
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Metric
280
+ )
281
+ )
282
+ end
283
+ attr_reader :metric
284
+
285
+ sig do
286
+ params(
287
+ metric:
288
+ T.nilable(
289
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Metric::OrHash
290
+ )
291
+ ).void
292
+ end
293
+ attr_writer :metric
294
+
295
+ # The plan the alert applies to.
296
+ sig do
297
+ returns(
298
+ T.nilable(
299
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Plan
300
+ )
301
+ )
302
+ end
303
+ attr_reader :plan
304
+
305
+ sig do
306
+ params(
307
+ plan:
308
+ T.nilable(
309
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Plan::OrHash
310
+ )
311
+ ).void
312
+ end
313
+ attr_writer :plan
314
+
315
+ # The subscription the alert applies to.
316
+ sig { returns(T.nilable(Orb::SubscriptionMinified)) }
317
+ attr_reader :subscription
318
+
319
+ sig do
320
+ params(
321
+ subscription: T.nilable(Orb::SubscriptionMinified::OrHash)
322
+ ).void
323
+ end
324
+ attr_writer :subscription
325
+
326
+ # The thresholds that define the conditions under which the alert will be
327
+ # triggered.
328
+ sig do
329
+ returns(
330
+ T.nilable(
331
+ T::Array[
332
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Threshold
333
+ ]
334
+ )
335
+ )
336
+ end
337
+ attr_accessor :thresholds
338
+
339
+ # The type of alert. This must be a valid alert type.
340
+ sig do
341
+ returns(
342
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
343
+ )
344
+ end
345
+ attr_accessor :type
346
+
347
+ # The current status of the alert. This field is only present for credit balance
348
+ # alerts.
349
+ sig do
350
+ returns(
351
+ T.nilable(
352
+ T::Array[
353
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::BalanceAlertStatus
354
+ ]
355
+ )
356
+ )
357
+ end
358
+ attr_accessor :balance_alert_status
359
+
360
+ # The property keys to group cost alerts by. Only present for cost alerts with
361
+ # grouping enabled.
362
+ sig { returns(T.nilable(T::Array[String])) }
363
+ attr_accessor :grouping_keys
364
+
365
+ # Minified license type for alert serialization.
366
+ sig do
367
+ returns(
368
+ T.nilable(
369
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::LicenseType
370
+ )
371
+ )
372
+ end
373
+ attr_reader :license_type
374
+
375
+ sig do
376
+ params(
377
+ license_type:
378
+ T.nilable(
379
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::LicenseType::OrHash
380
+ )
381
+ ).void
382
+ end
383
+ attr_writer :license_type
384
+
385
+ # Filters scoping which prices are included in spend and grouped cost alert
386
+ # evaluation. Alerts use the price_id, item_id, and price_type fields only; the
387
+ # alert's pricing unit is reported by currency.
388
+ sig do
389
+ returns(
390
+ T.nilable(
391
+ T::Array[
392
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter
393
+ ]
394
+ )
395
+ )
396
+ end
397
+ attr_accessor :price_filters
398
+
399
+ # Per-group threshold overrides. Each override maps a specific combination of
400
+ # grouping_keys values to a replacement threshold list. Only present for grouped
401
+ # cost alerts that have at least one override.
402
+ sig do
403
+ returns(
404
+ T.nilable(
405
+ T::Array[
406
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::ThresholdOverride
407
+ ]
408
+ )
409
+ )
410
+ end
411
+ attr_accessor :threshold_overrides
412
+
413
+ # [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
414
+ # usage, or credit balance and trigger webhooks when a threshold is exceeded.
415
+ #
416
+ # Alerts created through the API can be scoped to either customers or
417
+ # subscriptions.
418
+ sig do
419
+ params(
420
+ id: String,
421
+ created_at: Time,
422
+ currency: T.nilable(String),
423
+ customer: T.nilable(Orb::CustomerMinified::OrHash),
424
+ enabled: T::Boolean,
425
+ metric:
426
+ T.nilable(
427
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Metric::OrHash
428
+ ),
429
+ plan:
430
+ T.nilable(
431
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Plan::OrHash
432
+ ),
433
+ subscription: T.nilable(Orb::SubscriptionMinified::OrHash),
434
+ thresholds:
435
+ T.nilable(
436
+ T::Array[
437
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Threshold::OrHash
438
+ ]
439
+ ),
440
+ type:
441
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Type::OrSymbol,
442
+ balance_alert_status:
443
+ T.nilable(
444
+ T::Array[
445
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::BalanceAlertStatus::OrHash
446
+ ]
447
+ ),
448
+ grouping_keys: T.nilable(T::Array[String]),
449
+ license_type:
450
+ T.nilable(
451
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::LicenseType::OrHash
452
+ ),
453
+ price_filters:
454
+ T.nilable(
455
+ T::Array[
456
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::OrHash
457
+ ]
458
+ ),
459
+ threshold_overrides:
460
+ T.nilable(
461
+ T::Array[
462
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::ThresholdOverride::OrHash
463
+ ]
464
+ )
465
+ ).returns(T.attached_class)
466
+ end
467
+ def self.new(
468
+ # Also referred to as alert_id in this documentation.
469
+ id:,
470
+ # The creation time of the resource in Orb.
471
+ created_at:,
472
+ # The name of the currency the credit balance or invoice cost is denominated in.
473
+ currency:,
474
+ # The customer the alert applies to.
475
+ customer:,
476
+ # Whether the alert is enabled or disabled.
477
+ enabled:,
478
+ # The metric the alert applies to.
479
+ metric:,
480
+ # The plan the alert applies to.
481
+ plan:,
482
+ # The subscription the alert applies to.
483
+ subscription:,
484
+ # The thresholds that define the conditions under which the alert will be
485
+ # triggered.
486
+ thresholds:,
487
+ # The type of alert. This must be a valid alert type.
488
+ type:,
489
+ # The current status of the alert. This field is only present for credit balance
490
+ # alerts.
491
+ balance_alert_status: nil,
492
+ # The property keys to group cost alerts by. Only present for cost alerts with
493
+ # grouping enabled.
494
+ grouping_keys: nil,
495
+ # Minified license type for alert serialization.
496
+ license_type: nil,
497
+ # Filters scoping which prices are included in spend and grouped cost alert
498
+ # evaluation. Alerts use the price_id, item_id, and price_type fields only; the
499
+ # alert's pricing unit is reported by currency.
500
+ price_filters: nil,
501
+ # Per-group threshold overrides. Each override maps a specific combination of
502
+ # grouping_keys values to a replacement threshold list. Only present for grouped
503
+ # cost alerts that have at least one override.
504
+ threshold_overrides: nil
505
+ )
506
+ end
507
+
508
+ sig do
509
+ override.returns(
510
+ {
511
+ id: String,
512
+ created_at: Time,
513
+ currency: T.nilable(String),
514
+ customer: T.nilable(Orb::CustomerMinified),
515
+ enabled: T::Boolean,
516
+ metric:
517
+ T.nilable(
518
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Metric
519
+ ),
520
+ plan:
521
+ T.nilable(
522
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Plan
523
+ ),
524
+ subscription: T.nilable(Orb::SubscriptionMinified),
525
+ thresholds:
526
+ T.nilable(
527
+ T::Array[
528
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Threshold
529
+ ]
530
+ ),
531
+ type:
532
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol,
533
+ balance_alert_status:
534
+ T.nilable(
535
+ T::Array[
536
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::BalanceAlertStatus
537
+ ]
538
+ ),
539
+ grouping_keys: T.nilable(T::Array[String]),
540
+ license_type:
541
+ T.nilable(
542
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::LicenseType
543
+ ),
544
+ price_filters:
545
+ T.nilable(
546
+ T::Array[
547
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter
548
+ ]
549
+ ),
550
+ threshold_overrides:
551
+ T.nilable(
552
+ T::Array[
553
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::ThresholdOverride
554
+ ]
555
+ )
556
+ }
557
+ )
558
+ end
559
+ def to_hash
560
+ end
561
+
562
+ class Metric < Orb::Internal::Type::BaseModel
563
+ OrHash =
564
+ T.type_alias do
565
+ T.any(
566
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Metric,
567
+ Orb::Internal::AnyHash
568
+ )
569
+ end
570
+
571
+ sig { returns(String) }
572
+ attr_accessor :id
573
+
574
+ # The metric the alert applies to.
575
+ sig { params(id: String).returns(T.attached_class) }
576
+ def self.new(id:)
577
+ end
578
+
579
+ sig { override.returns({ id: String }) }
580
+ def to_hash
581
+ end
582
+ end
583
+
584
+ class Plan < Orb::Internal::Type::BaseModel
585
+ OrHash =
586
+ T.type_alias do
587
+ T.any(
588
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Plan,
589
+ Orb::Internal::AnyHash
590
+ )
591
+ end
592
+
593
+ sig { returns(T.nilable(String)) }
594
+ attr_accessor :id
595
+
596
+ # An optional user-defined ID for this plan resource, used throughout the system
597
+ # as an alias for this Plan. Use this field to identify a plan by an existing
598
+ # identifier in your system.
599
+ sig { returns(T.nilable(String)) }
600
+ attr_accessor :external_plan_id
601
+
602
+ sig { returns(T.nilable(String)) }
603
+ attr_accessor :name
604
+
605
+ sig { returns(String) }
606
+ attr_accessor :plan_version
607
+
608
+ # The plan the alert applies to.
609
+ sig do
610
+ params(
611
+ id: T.nilable(String),
612
+ external_plan_id: T.nilable(String),
613
+ name: T.nilable(String),
614
+ plan_version: String
615
+ ).returns(T.attached_class)
616
+ end
617
+ def self.new(
618
+ id:,
619
+ # An optional user-defined ID for this plan resource, used throughout the system
620
+ # as an alias for this Plan. Use this field to identify a plan by an existing
621
+ # identifier in your system.
622
+ external_plan_id:,
623
+ name:,
624
+ plan_version:
625
+ )
626
+ end
627
+
628
+ sig do
629
+ override.returns(
630
+ {
631
+ id: T.nilable(String),
632
+ external_plan_id: T.nilable(String),
633
+ name: T.nilable(String),
634
+ plan_version: String
635
+ }
636
+ )
637
+ end
638
+ def to_hash
639
+ end
640
+ end
641
+
642
+ class Threshold < Orb::Internal::Type::BaseModel
643
+ OrHash =
644
+ T.type_alias do
645
+ T.any(
646
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Threshold,
647
+ Orb::Internal::AnyHash
648
+ )
649
+ end
650
+
651
+ # The value at which an alert will fire. For credit balance alerts, the alert will
652
+ # fire at or below this value. For usage and cost alerts, the alert will fire at
653
+ # or above this value.
654
+ sig { returns(String) }
655
+ attr_accessor :value
656
+
657
+ # Thresholds are used to define the conditions under which an alert will be
658
+ # triggered.
659
+ sig { params(value: String).returns(T.attached_class) }
660
+ def self.new(
661
+ # The value at which an alert will fire. For credit balance alerts, the alert will
662
+ # fire at or below this value. For usage and cost alerts, the alert will fire at
663
+ # or above this value.
664
+ value:
665
+ )
666
+ end
667
+
668
+ sig { override.returns({ value: String }) }
669
+ def to_hash
670
+ end
671
+ end
672
+
673
+ # The type of alert. This must be a valid alert type.
674
+ module Type
675
+ extend Orb::Internal::Type::Enum
676
+
677
+ TaggedSymbol =
678
+ T.type_alias do
679
+ T.all(
680
+ Symbol,
681
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Type
682
+ )
683
+ end
684
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
685
+
686
+ CREDIT_BALANCE_DEPLETED =
687
+ T.let(
688
+ :credit_balance_depleted,
689
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
690
+ )
691
+ CREDIT_BALANCE_DROPPED =
692
+ T.let(
693
+ :credit_balance_dropped,
694
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
695
+ )
696
+ CREDIT_BALANCE_RECOVERED =
697
+ T.let(
698
+ :credit_balance_recovered,
699
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
700
+ )
701
+ USAGE_EXCEEDED =
702
+ T.let(
703
+ :usage_exceeded,
704
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
705
+ )
706
+ COST_EXCEEDED =
707
+ T.let(
708
+ :cost_exceeded,
709
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
710
+ )
711
+ SPEND_EXCEEDED =
712
+ T.let(
713
+ :spend_exceeded,
714
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
715
+ )
716
+ LICENSE_BALANCE_THRESHOLD_REACHED =
717
+ T.let(
718
+ :license_balance_threshold_reached,
719
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
720
+ )
721
+
722
+ sig do
723
+ override.returns(
724
+ T::Array[
725
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
726
+ ]
727
+ )
728
+ end
729
+ def self.values
730
+ end
731
+ end
732
+
733
+ class BalanceAlertStatus < Orb::Internal::Type::BaseModel
734
+ OrHash =
735
+ T.type_alias do
736
+ T.any(
737
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::BalanceAlertStatus,
738
+ Orb::Internal::AnyHash
739
+ )
740
+ end
741
+
742
+ # Whether the alert is currently in-alert or not.
743
+ sig { returns(T::Boolean) }
744
+ attr_accessor :in_alert
745
+
746
+ # The value of the threshold that defines the alert status.
747
+ sig { returns(String) }
748
+ attr_accessor :threshold_value
749
+
750
+ # Alert status is used to determine if an alert is currently in-alert or not.
751
+ sig do
752
+ params(in_alert: T::Boolean, threshold_value: String).returns(
753
+ T.attached_class
754
+ )
755
+ end
756
+ def self.new(
757
+ # Whether the alert is currently in-alert or not.
758
+ in_alert:,
759
+ # The value of the threshold that defines the alert status.
760
+ threshold_value:
761
+ )
762
+ end
763
+
764
+ sig do
765
+ override.returns(
766
+ { in_alert: T::Boolean, threshold_value: String }
767
+ )
768
+ end
769
+ def to_hash
770
+ end
771
+ end
772
+
773
+ class LicenseType < Orb::Internal::Type::BaseModel
774
+ OrHash =
775
+ T.type_alias do
776
+ T.any(
777
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::LicenseType,
778
+ Orb::Internal::AnyHash
779
+ )
780
+ end
781
+
782
+ sig { returns(String) }
783
+ attr_accessor :id
784
+
785
+ # Minified license type for alert serialization.
786
+ sig { params(id: String).returns(T.attached_class) }
787
+ def self.new(id:)
788
+ end
789
+
790
+ sig { override.returns({ id: String }) }
791
+ def to_hash
792
+ end
793
+ end
794
+
795
+ class PriceFilter < Orb::Internal::Type::BaseModel
796
+ OrHash =
797
+ T.type_alias do
798
+ T.any(
799
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter,
800
+ Orb::Internal::AnyHash
801
+ )
802
+ end
803
+
804
+ # The property of the price to filter on.
805
+ sig do
806
+ returns(
807
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
808
+ )
809
+ end
810
+ attr_accessor :field
811
+
812
+ # Should prices that match the filter be included or excluded.
813
+ sig do
814
+ returns(
815
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator::TaggedSymbol
816
+ )
817
+ end
818
+ attr_accessor :operator
819
+
820
+ # The IDs or values that match this filter.
821
+ sig { returns(T::Array[String]) }
822
+ attr_accessor :values
823
+
824
+ sig do
825
+ params(
826
+ field:
827
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::OrSymbol,
828
+ operator:
829
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator::OrSymbol,
830
+ values: T::Array[String]
831
+ ).returns(T.attached_class)
832
+ end
833
+ def self.new(
834
+ # The property of the price to filter on.
835
+ field:,
836
+ # Should prices that match the filter be included or excluded.
837
+ operator:,
838
+ # The IDs or values that match this filter.
839
+ values:
840
+ )
841
+ end
842
+
843
+ sig do
844
+ override.returns(
845
+ {
846
+ field:
847
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol,
848
+ operator:
849
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator::TaggedSymbol,
850
+ values: T::Array[String]
851
+ }
852
+ )
853
+ end
854
+ def to_hash
855
+ end
856
+
857
+ # The property of the price to filter on.
858
+ module Field
859
+ extend Orb::Internal::Type::Enum
860
+
861
+ TaggedSymbol =
862
+ T.type_alias do
863
+ T.all(
864
+ Symbol,
865
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field
866
+ )
867
+ end
868
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
869
+
870
+ PRICE_ID =
871
+ T.let(
872
+ :price_id,
873
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
874
+ )
875
+ ITEM_ID =
876
+ T.let(
877
+ :item_id,
878
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
879
+ )
880
+ PRICE_TYPE =
881
+ T.let(
882
+ :price_type,
883
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
884
+ )
885
+ CURRENCY =
886
+ T.let(
887
+ :currency,
888
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
889
+ )
890
+ PRICING_UNIT_ID =
891
+ T.let(
892
+ :pricing_unit_id,
893
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
894
+ )
895
+
896
+ sig do
897
+ override.returns(
898
+ T::Array[
899
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
900
+ ]
901
+ )
902
+ end
903
+ def self.values
904
+ end
905
+ end
906
+
907
+ # Should prices that match the filter be included or excluded.
908
+ module Operator
909
+ extend Orb::Internal::Type::Enum
910
+
911
+ TaggedSymbol =
912
+ T.type_alias do
913
+ T.all(
914
+ Symbol,
915
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator
916
+ )
917
+ end
918
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
919
+
920
+ INCLUDES =
921
+ T.let(
922
+ :includes,
923
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator::TaggedSymbol
924
+ )
925
+ EXCLUDES =
926
+ T.let(
927
+ :excludes,
928
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator::TaggedSymbol
929
+ )
930
+
931
+ sig do
932
+ override.returns(
933
+ T::Array[
934
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator::TaggedSymbol
935
+ ]
936
+ )
937
+ end
938
+ def self.values
939
+ end
940
+ end
941
+ end
942
+
943
+ class ThresholdOverride < Orb::Internal::Type::BaseModel
944
+ OrHash =
945
+ T.type_alias do
946
+ T.any(
947
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::ThresholdOverride,
948
+ Orb::Internal::AnyHash
949
+ )
950
+ end
951
+
952
+ # The values identifying this group, ordered to match group_keys when set and the
953
+ # alert's grouping_keys otherwise.
954
+ sig { returns(T::Array[String]) }
955
+ attr_accessor :group_values
956
+
957
+ # The thresholds applied to this group. An empty list means the group is silenced.
958
+ sig do
959
+ returns(
960
+ T::Array[
961
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::ThresholdOverride::Threshold
962
+ ]
963
+ )
964
+ end
965
+ attr_accessor :thresholds
966
+
967
+ # The subset of the alert's grouping_keys this override binds. Null when the
968
+ # override targets one exact group across every grouping key.
969
+ sig { returns(T.nilable(T::Array[String])) }
970
+ attr_accessor :group_keys
971
+
972
+ # A per-group threshold override on a grouped cost alert.
973
+ #
974
+ # An empty `thresholds` list means the group is silenced (never fires). A
975
+ # non-empty list fully replaces the default thresholds for that group.
976
+ sig do
977
+ params(
978
+ group_values: T::Array[String],
979
+ thresholds:
980
+ T::Array[
981
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::ThresholdOverride::Threshold::OrHash
982
+ ],
983
+ group_keys: T.nilable(T::Array[String])
984
+ ).returns(T.attached_class)
985
+ end
986
+ def self.new(
987
+ # The values identifying this group, ordered to match group_keys when set and the
988
+ # alert's grouping_keys otherwise.
989
+ group_values:,
990
+ # The thresholds applied to this group. An empty list means the group is silenced.
991
+ thresholds:,
992
+ # The subset of the alert's grouping_keys this override binds. Null when the
993
+ # override targets one exact group across every grouping key.
994
+ group_keys: nil
995
+ )
996
+ end
997
+
998
+ sig do
999
+ override.returns(
1000
+ {
1001
+ group_values: T::Array[String],
1002
+ thresholds:
1003
+ T::Array[
1004
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::ThresholdOverride::Threshold
1005
+ ],
1006
+ group_keys: T.nilable(T::Array[String])
1007
+ }
1008
+ )
1009
+ end
1010
+ def to_hash
1011
+ end
1012
+
1013
+ class Threshold < Orb::Internal::Type::BaseModel
1014
+ OrHash =
1015
+ T.type_alias do
1016
+ T.any(
1017
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Properties::AlertConfiguration::ThresholdOverride::Threshold,
1018
+ Orb::Internal::AnyHash
1019
+ )
1020
+ end
1021
+
1022
+ # The value at which an alert will fire. For credit balance alerts, the alert will
1023
+ # fire at or below this value. For usage and cost alerts, the alert will fire at
1024
+ # or above this value.
1025
+ sig { returns(String) }
1026
+ attr_accessor :value
1027
+
1028
+ # Thresholds are used to define the conditions under which an alert will be
1029
+ # triggered.
1030
+ sig { params(value: String).returns(T.attached_class) }
1031
+ def self.new(
1032
+ # The value at which an alert will fire. For credit balance alerts, the alert will
1033
+ # fire at or below this value. For usage and cost alerts, the alert will fire at
1034
+ # or above this value.
1035
+ value:
1036
+ )
1037
+ end
1038
+
1039
+ sig { override.returns({ value: String }) }
1040
+ def to_hash
1041
+ end
1042
+ end
1043
+ end
1044
+ end
1045
+ end
1046
+
1047
+ class Subscription < Orb::Internal::Type::BaseModel
1048
+ OrHash =
1049
+ T.type_alias do
1050
+ T.any(
1051
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription,
1052
+ Orb::Internal::AnyHash
1053
+ )
1054
+ end
1055
+
1056
+ sig { returns(String) }
1057
+ attr_accessor :id
1058
+
1059
+ sig { returns(Time) }
1060
+ attr_accessor :created_at
1061
+
1062
+ sig { returns(Orb::CustomerMinified) }
1063
+ attr_reader :customer
1064
+
1065
+ sig { params(customer: Orb::CustomerMinified::OrHash).void }
1066
+ attr_writer :customer
1067
+
1068
+ # The date Orb stops billing for this subscription.
1069
+ sig { returns(T.nilable(Time)) }
1070
+ attr_accessor :end_date
1071
+
1072
+ # User specified key-value pairs for the resource. If not present, this defaults
1073
+ # to an empty dictionary. Individual keys can be removed by setting the value to
1074
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
1075
+ # `null`.
1076
+ sig { returns(T::Hash[Symbol, String]) }
1077
+ attr_accessor :metadata
1078
+
1079
+ # The name of the subscription.
1080
+ sig { returns(String) }
1081
+ attr_accessor :name
1082
+
1083
+ sig do
1084
+ returns(
1085
+ T.nilable(
1086
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::Plan
1087
+ )
1088
+ )
1089
+ end
1090
+ attr_reader :plan
1091
+
1092
+ sig do
1093
+ params(
1094
+ plan:
1095
+ T.nilable(
1096
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::Plan::OrHash
1097
+ )
1098
+ ).void
1099
+ end
1100
+ attr_writer :plan
1101
+
1102
+ # The date Orb starts billing for this subscription.
1103
+ sig { returns(Time) }
1104
+ attr_accessor :start_date
1105
+
1106
+ sig do
1107
+ returns(
1108
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::Status::TaggedSymbol
1109
+ )
1110
+ end
1111
+ attr_accessor :status
1112
+
1113
+ # The subscription in a standard webhook payload: its own fields, with its plan
1114
+ # and customer as references. Fetch the subscription for its price intervals,
1115
+ # billing periods, plan phases and other derived fields.
1116
+ sig do
1117
+ params(
1118
+ id: String,
1119
+ created_at: Time,
1120
+ customer: Orb::CustomerMinified::OrHash,
1121
+ end_date: T.nilable(Time),
1122
+ metadata: T::Hash[Symbol, String],
1123
+ name: String,
1124
+ plan:
1125
+ T.nilable(
1126
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::Plan::OrHash
1127
+ ),
1128
+ start_date: Time,
1129
+ status:
1130
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::Status::OrSymbol
1131
+ ).returns(T.attached_class)
1132
+ end
1133
+ def self.new(
1134
+ id:,
1135
+ created_at:,
1136
+ customer:,
1137
+ # The date Orb stops billing for this subscription.
1138
+ end_date:,
1139
+ # User specified key-value pairs for the resource. If not present, this defaults
1140
+ # to an empty dictionary. Individual keys can be removed by setting the value to
1141
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
1142
+ # `null`.
1143
+ metadata:,
1144
+ # The name of the subscription.
1145
+ name:,
1146
+ plan:,
1147
+ # The date Orb starts billing for this subscription.
1148
+ start_date:,
1149
+ status:
1150
+ )
1151
+ end
1152
+
1153
+ sig do
1154
+ override.returns(
1155
+ {
1156
+ id: String,
1157
+ created_at: Time,
1158
+ customer: Orb::CustomerMinified,
1159
+ end_date: T.nilable(Time),
1160
+ metadata: T::Hash[Symbol, String],
1161
+ name: String,
1162
+ plan:
1163
+ T.nilable(
1164
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::Plan
1165
+ ),
1166
+ start_date: Time,
1167
+ status:
1168
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::Status::TaggedSymbol
1169
+ }
1170
+ )
1171
+ end
1172
+ def to_hash
1173
+ end
1174
+
1175
+ class Plan < Orb::Internal::Type::BaseModel
1176
+ OrHash =
1177
+ T.type_alias do
1178
+ T.any(
1179
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::Plan,
1180
+ Orb::Internal::AnyHash
1181
+ )
1182
+ end
1183
+
1184
+ sig { returns(T.nilable(String)) }
1185
+ attr_accessor :id
1186
+
1187
+ # An optional user-defined ID for this plan resource, used throughout the system
1188
+ # as an alias for this Plan. Use this field to identify a plan by an existing
1189
+ # identifier in your system.
1190
+ sig { returns(T.nilable(String)) }
1191
+ attr_accessor :external_plan_id
1192
+
1193
+ sig { returns(T.nilable(String)) }
1194
+ attr_accessor :name
1195
+
1196
+ sig do
1197
+ params(
1198
+ id: T.nilable(String),
1199
+ external_plan_id: T.nilable(String),
1200
+ name: T.nilable(String)
1201
+ ).returns(T.attached_class)
1202
+ end
1203
+ def self.new(
1204
+ id:,
1205
+ # An optional user-defined ID for this plan resource, used throughout the system
1206
+ # as an alias for this Plan. Use this field to identify a plan by an existing
1207
+ # identifier in your system.
1208
+ external_plan_id:,
1209
+ name:
1210
+ )
1211
+ end
1212
+
1213
+ sig do
1214
+ override.returns(
1215
+ {
1216
+ id: T.nilable(String),
1217
+ external_plan_id: T.nilable(String),
1218
+ name: T.nilable(String)
1219
+ }
1220
+ )
1221
+ end
1222
+ def to_hash
1223
+ end
1224
+ end
1225
+
1226
+ module Status
1227
+ extend Orb::Internal::Type::Enum
1228
+
1229
+ TaggedSymbol =
1230
+ T.type_alias do
1231
+ T.all(
1232
+ Symbol,
1233
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::Status
1234
+ )
1235
+ end
1236
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1237
+
1238
+ ACTIVE =
1239
+ T.let(
1240
+ :active,
1241
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::Status::TaggedSymbol
1242
+ )
1243
+ ENDED =
1244
+ T.let(
1245
+ :ended,
1246
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::Status::TaggedSymbol
1247
+ )
1248
+ UPCOMING =
1249
+ T.let(
1250
+ :upcoming,
1251
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::Status::TaggedSymbol
1252
+ )
1253
+
1254
+ sig do
1255
+ override.returns(
1256
+ T::Array[
1257
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Subscription::Status::TaggedSymbol
1258
+ ]
1259
+ )
1260
+ end
1261
+ def self.values
1262
+ end
1263
+ end
1264
+ end
1265
+
1266
+ # The event this payload describes.
1267
+ module Type
1268
+ extend Orb::Internal::Type::Enum
1269
+
1270
+ TaggedSymbol =
1271
+ T.type_alias do
1272
+ T.all(
1273
+ Symbol,
1274
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Type
1275
+ )
1276
+ end
1277
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1278
+
1279
+ SUBSCRIPTION_COST_EXCEEDED =
1280
+ T.let(
1281
+ :"subscription.cost_exceeded",
1282
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Type::TaggedSymbol
1283
+ )
1284
+
1285
+ sig do
1286
+ override.returns(
1287
+ T::Array[
1288
+ Orb::Webhooks::SubscriptionCostExceededStandardWebhookEvent::Type::TaggedSymbol
1289
+ ]
1290
+ )
1291
+ end
1292
+ def self.values
1293
+ end
1294
+ end
1295
+ end
1296
+ end
1297
+ end
1298
+ end