orb-billing 1.35.0 → 1.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +4 -0
  5. data/lib/orb/models/backfill_reflected_webhook_event.rb +180 -0
  6. data/lib/orb/models/backfill_reverted_webhook_event.rb +180 -0
  7. data/lib/orb/models/billable_metric_edited_webhook_event.rb +104 -0
  8. data/lib/orb/models/credit_block_accounting_sync_failed_webhook_event.rb +499 -0
  9. data/lib/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rb +494 -0
  10. data/lib/orb/models/credit_note_accounting_sync_failed_webhook_event.rb +161 -0
  11. data/lib/orb/models/credit_note_accounting_sync_succeeded_webhook_event.rb +155 -0
  12. data/lib/orb/models/credit_note_issued_webhook_event.rb +65 -0
  13. data/lib/orb/models/credit_note_marked_as_void_webhook_event.rb +65 -0
  14. data/lib/orb/models/customer_accounting_sync_failed_webhook_event.rb +171 -0
  15. data/lib/orb/models/customer_accounting_sync_succeeded_webhook_event.rb +165 -0
  16. data/lib/orb/models/customer_balance_transaction_created_webhook_event.rb +212 -0
  17. data/lib/orb/models/customer_created_webhook_event.rb +81 -0
  18. data/lib/orb/models/customer_credit_balance_depleted_webhook_event.rb +560 -0
  19. data/lib/orb/models/customer_credit_balance_dropped_webhook_event.rb +566 -0
  20. data/lib/orb/models/customer_credit_balance_recovered_webhook_event.rb +560 -0
  21. data/lib/orb/models/customer_credit_ledger_incremented_webhook_event.rb +474 -0
  22. data/lib/orb/models/customer_edited_webhook_event.rb +344 -0
  23. data/lib/orb/models/data_exports_transfer_error_webhook_event.rb +100 -0
  24. data/lib/orb/models/data_exports_transfer_success_webhook_event.rb +94 -0
  25. data/lib/orb/models/event_unmatched_event_webhook_event.rb +105 -0
  26. data/lib/orb/models/ingestion_unmatched_customer_ids_webhook_event.rb +64 -0
  27. data/lib/orb/models/invoice_accounting_sync_failed_webhook_event.rb +164 -0
  28. data/lib/orb/models/invoice_accounting_sync_succeeded_webhook_event.rb +158 -0
  29. data/lib/orb/models/invoice_automation_schedule_step_executed_webhook_event.rb +338 -0
  30. data/lib/orb/models/invoice_cost_data_exported_webhook_event.rb +83 -0
  31. data/lib/orb/models/invoice_due_date_recalculation_canceled_webhook_event.rb +70 -0
  32. data/lib/orb/models/invoice_due_date_recalculation_completed_webhook_event.rb +70 -0
  33. data/lib/orb/models/invoice_due_date_recalculation_started_webhook_event.rb +64 -0
  34. data/lib/orb/models/invoice_dunning_schedule_created_webhook_event.rb +186 -0
  35. data/lib/orb/models/invoice_dunning_schedule_ended_webhook_event.rb +180 -0
  36. data/lib/orb/models/invoice_dunning_schedule_reset_webhook_event.rb +184 -0
  37. data/lib/orb/models/invoice_dunning_schedule_step_executed_webhook_event.rb +133 -0
  38. data/lib/orb/models/invoice_edited_webhook_event.rb +550 -0
  39. data/lib/orb/models/invoice_invoice_date_elapsed_webhook_event.rb +120 -0
  40. data/lib/orb/models/invoice_issue_failed_webhook_event.rb +79 -0
  41. data/lib/orb/models/invoice_issued_summary_webhook_event.rb +841 -0
  42. data/lib/orb/models/invoice_issued_webhook_event.rb +79 -0
  43. data/lib/orb/models/invoice_manually_marked_as_paid_webhook_event.rb +91 -0
  44. data/lib/orb/models/invoice_manually_marked_as_void_webhook_event.rb +68 -0
  45. data/lib/orb/models/invoice_payment_failed_webhook_event.rb +92 -0
  46. data/lib/orb/models/invoice_payment_processing_webhook_event.rb +85 -0
  47. data/lib/orb/models/invoice_payment_succeeded_webhook_event.rb +101 -0
  48. data/lib/orb/models/invoice_sync_failed_webhook_event.rb +85 -0
  49. data/lib/orb/models/invoice_sync_succeeded_webhook_event.rb +85 -0
  50. data/lib/orb/models/invoice_undo_mark_as_paid_webhook_event.rb +68 -0
  51. data/lib/orb/models/metric_events_dropped_by_watermark_webhook_event.rb +98 -0
  52. data/lib/orb/models/payment_method_created_webhook_event.rb +156 -0
  53. data/lib/orb/models/payment_method_deleted_webhook_event.rb +156 -0
  54. data/lib/orb/models/plan_default_version_set_webhook_event.rb +108 -0
  55. data/lib/orb/models/plan_version_created_webhook_event.rb +108 -0
  56. data/lib/orb/models/price_edited_webhook_event.rb +105 -0
  57. data/lib/orb/models/resource_event_test_webhook_event.rb +64 -0
  58. data/lib/orb/models/sales_order_accounting_sync_failed_webhook_event.rb +164 -0
  59. data/lib/orb/models/sales_order_accounting_sync_succeeded_webhook_event.rb +158 -0
  60. data/lib/orb/models/subscription_accounting_sync_failed_webhook_event.rb +178 -0
  61. data/lib/orb/models/subscription_accounting_sync_succeeded_webhook_event.rb +172 -0
  62. data/lib/orb/models/subscription_alert_disabled_webhook_event.rb +624 -0
  63. data/lib/orb/models/subscription_cancellation_scheduled_webhook_event.rb +93 -0
  64. data/lib/orb/models/subscription_cancellation_unscheduled_webhook_event.rb +93 -0
  65. data/lib/orb/models/subscription_cost_exceeded_webhook_event.rb +540 -0
  66. data/lib/orb/models/subscription_created_webhook_event.rb +82 -0
  67. data/lib/orb/models/subscription_edited_webhook_event.rb +134 -0
  68. data/lib/orb/models/subscription_ended_webhook_event.rb +82 -0
  69. data/lib/orb/models/subscription_fixed_fee_quantity_updated_webhook_event.rb +111 -0
  70. data/lib/orb/models/subscription_grouped_cost_exceeded_webhook_event.rb +655 -0
  71. data/lib/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rb +191 -0
  72. data/lib/orb/models/subscription_license_allocation_reset_webhook_event.rb +214 -0
  73. data/lib/orb/models/subscription_license_balance_threshold_reached_webhook_event.rb +652 -0
  74. data/lib/orb/models/subscription_plan_change_scheduled_webhook_event.rb +105 -0
  75. data/lib/orb/models/subscription_plan_changed_webhook_event.rb +93 -0
  76. data/lib/orb/models/subscription_plan_version_change_scheduled_webhook_event.rb +106 -0
  77. data/lib/orb/models/subscription_plan_version_changed_webhook_event.rb +105 -0
  78. data/lib/orb/models/subscription_spend_exceeded_webhook_event.rb +541 -0
  79. data/lib/orb/models/subscription_started_webhook_event.rb +82 -0
  80. data/lib/orb/models/subscription_trial_ended_webhook_event.rb +82 -0
  81. data/lib/orb/models/subscription_usage_exceeded_webhook_event.rb +548 -0
  82. data/lib/orb/models/transaction_accounting_sync_failed_webhook_event.rb +236 -0
  83. data/lib/orb/models/transaction_accounting_sync_succeeded_webhook_event.rb +232 -0
  84. data/lib/orb/models/unwrap_webhook_event.rb +250 -0
  85. data/lib/orb/models/webhook_unwrap_params.rb +14 -0
  86. data/lib/orb/models.rb +180 -0
  87. data/lib/orb/resources/webhooks.rb +22 -0
  88. data/lib/orb/version.rb +1 -1
  89. data/lib/orb.rb +82 -0
  90. data/rbi/orb/client.rbi +3 -0
  91. data/rbi/orb/models/backfill_reflected_webhook_event.rbi +274 -0
  92. data/rbi/orb/models/backfill_reverted_webhook_event.rbi +271 -0
  93. data/rbi/orb/models/billable_metric_edited_webhook_event.rbi +198 -0
  94. data/rbi/orb/models/credit_block_accounting_sync_failed_webhook_event.rbi +1039 -0
  95. data/rbi/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbi +1034 -0
  96. data/rbi/orb/models/credit_note_accounting_sync_failed_webhook_event.rbi +315 -0
  97. data/rbi/orb/models/credit_note_accounting_sync_succeeded_webhook_event.rbi +310 -0
  98. data/rbi/orb/models/credit_note_issued_webhook_event.rbi +98 -0
  99. data/rbi/orb/models/credit_note_marked_as_void_webhook_event.rbi +102 -0
  100. data/rbi/orb/models/customer_accounting_sync_failed_webhook_event.rbi +339 -0
  101. data/rbi/orb/models/customer_accounting_sync_succeeded_webhook_event.rbi +335 -0
  102. data/rbi/orb/models/customer_balance_transaction_created_webhook_event.rbi +437 -0
  103. data/rbi/orb/models/customer_created_webhook_event.rbi +128 -0
  104. data/rbi/orb/models/customer_credit_balance_depleted_webhook_event.rbi +1091 -0
  105. data/rbi/orb/models/customer_credit_balance_dropped_webhook_event.rbi +1096 -0
  106. data/rbi/orb/models/customer_credit_balance_recovered_webhook_event.rbi +1091 -0
  107. data/rbi/orb/models/customer_credit_ledger_incremented_webhook_event.rbi +987 -0
  108. data/rbi/orb/models/customer_edited_webhook_event.rbi +599 -0
  109. data/rbi/orb/models/data_exports_transfer_error_webhook_event.rbi +170 -0
  110. data/rbi/orb/models/data_exports_transfer_success_webhook_event.rbi +165 -0
  111. data/rbi/orb/models/event_unmatched_event_webhook_event.rbi +193 -0
  112. data/rbi/orb/models/ingestion_unmatched_customer_ids_webhook_event.rbi +132 -0
  113. data/rbi/orb/models/invoice_accounting_sync_failed_webhook_event.rbi +319 -0
  114. data/rbi/orb/models/invoice_accounting_sync_succeeded_webhook_event.rbi +312 -0
  115. data/rbi/orb/models/invoice_automation_schedule_step_executed_webhook_event.rbi +614 -0
  116. data/rbi/orb/models/invoice_cost_data_exported_webhook_event.rbi +144 -0
  117. data/rbi/orb/models/invoice_due_date_recalculation_canceled_webhook_event.rbi +139 -0
  118. data/rbi/orb/models/invoice_due_date_recalculation_completed_webhook_event.rbi +139 -0
  119. data/rbi/orb/models/invoice_due_date_recalculation_started_webhook_event.rbi +132 -0
  120. data/rbi/orb/models/invoice_dunning_schedule_created_webhook_event.rbi +331 -0
  121. data/rbi/orb/models/invoice_dunning_schedule_ended_webhook_event.rbi +324 -0
  122. data/rbi/orb/models/invoice_dunning_schedule_reset_webhook_event.rbi +329 -0
  123. data/rbi/orb/models/invoice_dunning_schedule_step_executed_webhook_event.rbi +250 -0
  124. data/rbi/orb/models/invoice_edited_webhook_event.rbi +942 -0
  125. data/rbi/orb/models/invoice_invoice_date_elapsed_webhook_event.rbi +251 -0
  126. data/rbi/orb/models/invoice_issue_failed_webhook_event.rbi +132 -0
  127. data/rbi/orb/models/invoice_issued_summary_webhook_event.rbi +1432 -0
  128. data/rbi/orb/models/invoice_issued_webhook_event.rbi +134 -0
  129. data/rbi/orb/models/invoice_manually_marked_as_paid_webhook_event.rbi +165 -0
  130. data/rbi/orb/models/invoice_manually_marked_as_void_webhook_event.rbi +114 -0
  131. data/rbi/orb/models/invoice_payment_failed_webhook_event.rbi +157 -0
  132. data/rbi/orb/models/invoice_payment_processing_webhook_event.rbi +156 -0
  133. data/rbi/orb/models/invoice_payment_succeeded_webhook_event.rbi +175 -0
  134. data/rbi/orb/models/invoice_sync_failed_webhook_event.rbi +147 -0
  135. data/rbi/orb/models/invoice_sync_succeeded_webhook_event.rbi +147 -0
  136. data/rbi/orb/models/invoice_undo_mark_as_paid_webhook_event.rbi +106 -0
  137. data/rbi/orb/models/metric_events_dropped_by_watermark_webhook_event.rbi +167 -0
  138. data/rbi/orb/models/payment_method_created_webhook_event.rbi +259 -0
  139. data/rbi/orb/models/payment_method_deleted_webhook_event.rbi +259 -0
  140. data/rbi/orb/models/plan_default_version_set_webhook_event.rbi +196 -0
  141. data/rbi/orb/models/plan_version_created_webhook_event.rbi +190 -0
  142. data/rbi/orb/models/price_edited_webhook_event.rbi +235 -0
  143. data/rbi/orb/models/resource_event_test_webhook_event.rbi +116 -0
  144. data/rbi/orb/models/sales_order_accounting_sync_failed_webhook_event.rbi +321 -0
  145. data/rbi/orb/models/sales_order_accounting_sync_succeeded_webhook_event.rbi +316 -0
  146. data/rbi/orb/models/subscription_accounting_sync_failed_webhook_event.rbi +353 -0
  147. data/rbi/orb/models/subscription_accounting_sync_succeeded_webhook_event.rbi +346 -0
  148. data/rbi/orb/models/subscription_alert_disabled_webhook_event.rbi +1232 -0
  149. data/rbi/orb/models/subscription_cancellation_scheduled_webhook_event.rbi +179 -0
  150. data/rbi/orb/models/subscription_cancellation_unscheduled_webhook_event.rbi +183 -0
  151. data/rbi/orb/models/subscription_cost_exceeded_webhook_event.rbi +1034 -0
  152. data/rbi/orb/models/subscription_created_webhook_event.rbi +132 -0
  153. data/rbi/orb/models/subscription_edited_webhook_event.rbi +247 -0
  154. data/rbi/orb/models/subscription_ended_webhook_event.rbi +132 -0
  155. data/rbi/orb/models/subscription_fixed_fee_quantity_updated_webhook_event.rbi +206 -0
  156. data/rbi/orb/models/subscription_grouped_cost_exceeded_webhook_event.rbi +1262 -0
  157. data/rbi/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rbi +374 -0
  158. data/rbi/orb/models/subscription_license_allocation_reset_webhook_event.rbi +421 -0
  159. data/rbi/orb/models/subscription_license_balance_threshold_reached_webhook_event.rbi +1265 -0
  160. data/rbi/orb/models/subscription_plan_change_scheduled_webhook_event.rbi +198 -0
  161. data/rbi/orb/models/subscription_plan_changed_webhook_event.rbi +169 -0
  162. data/rbi/orb/models/subscription_plan_version_change_scheduled_webhook_event.rbi +205 -0
  163. data/rbi/orb/models/subscription_plan_version_changed_webhook_event.rbi +199 -0
  164. data/rbi/orb/models/subscription_spend_exceeded_webhook_event.rbi +1035 -0
  165. data/rbi/orb/models/subscription_started_webhook_event.rbi +132 -0
  166. data/rbi/orb/models/subscription_trial_ended_webhook_event.rbi +136 -0
  167. data/rbi/orb/models/subscription_usage_exceeded_webhook_event.rbi +1041 -0
  168. data/rbi/orb/models/transaction_accounting_sync_failed_webhook_event.rbi +455 -0
  169. data/rbi/orb/models/transaction_accounting_sync_succeeded_webhook_event.rbi +449 -0
  170. data/rbi/orb/models/unwrap_webhook_event.rbi +99 -0
  171. data/rbi/orb/models/webhook_unwrap_params.rbi +25 -0
  172. data/rbi/orb/models.rbi +224 -0
  173. data/rbi/orb/resources/webhooks.rbi +103 -0
  174. data/sig/orb/client.rbs +2 -0
  175. data/sig/orb/models/backfill_reflected_webhook_event.rbs +130 -0
  176. data/sig/orb/models/backfill_reverted_webhook_event.rbs +130 -0
  177. data/sig/orb/models/billable_metric_edited_webhook_event.rbs +94 -0
  178. data/sig/orb/models/credit_block_accounting_sync_failed_webhook_event.rbs +412 -0
  179. data/sig/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbs +407 -0
  180. data/sig/orb/models/credit_note_accounting_sync_failed_webhook_event.rbs +147 -0
  181. data/sig/orb/models/credit_note_accounting_sync_succeeded_webhook_event.rbs +142 -0
  182. data/sig/orb/models/credit_note_issued_webhook_event.rbs +50 -0
  183. data/sig/orb/models/credit_note_marked_as_void_webhook_event.rbs +50 -0
  184. data/sig/orb/models/customer_accounting_sync_failed_webhook_event.rbs +142 -0
  185. data/sig/orb/models/customer_accounting_sync_succeeded_webhook_event.rbs +137 -0
  186. data/sig/orb/models/customer_balance_transaction_created_webhook_event.rbs +171 -0
  187. data/sig/orb/models/customer_created_webhook_event.rbs +50 -0
  188. data/sig/orb/models/customer_credit_balance_depleted_webhook_event.rbs +374 -0
  189. data/sig/orb/models/customer_credit_balance_dropped_webhook_event.rbs +379 -0
  190. data/sig/orb/models/customer_credit_balance_recovered_webhook_event.rbs +374 -0
  191. data/sig/orb/models/customer_credit_ledger_incremented_webhook_event.rbs +364 -0
  192. data/sig/orb/models/customer_edited_webhook_event.rbs +139 -0
  193. data/sig/orb/models/data_exports_transfer_error_webhook_event.rbs +92 -0
  194. data/sig/orb/models/data_exports_transfer_success_webhook_event.rbs +87 -0
  195. data/sig/orb/models/event_unmatched_event_webhook_event.rbs +102 -0
  196. data/sig/orb/models/ingestion_unmatched_customer_ids_webhook_event.rbs +55 -0
  197. data/sig/orb/models/invoice_accounting_sync_failed_webhook_event.rbs +147 -0
  198. data/sig/orb/models/invoice_accounting_sync_succeeded_webhook_event.rbs +142 -0
  199. data/sig/orb/models/invoice_automation_schedule_step_executed_webhook_event.rbs +313 -0
  200. data/sig/orb/models/invoice_cost_data_exported_webhook_event.rbs +73 -0
  201. data/sig/orb/models/invoice_due_date_recalculation_canceled_webhook_event.rbs +57 -0
  202. data/sig/orb/models/invoice_due_date_recalculation_completed_webhook_event.rbs +57 -0
  203. data/sig/orb/models/invoice_due_date_recalculation_started_webhook_event.rbs +55 -0
  204. data/sig/orb/models/invoice_dunning_schedule_created_webhook_event.rbs +171 -0
  205. data/sig/orb/models/invoice_dunning_schedule_ended_webhook_event.rbs +166 -0
  206. data/sig/orb/models/invoice_dunning_schedule_reset_webhook_event.rbs +156 -0
  207. data/sig/orb/models/invoice_dunning_schedule_step_executed_webhook_event.rbs +119 -0
  208. data/sig/orb/models/invoice_edited_webhook_event.rbs +388 -0
  209. data/sig/orb/models/invoice_invoice_date_elapsed_webhook_event.rbs +111 -0
  210. data/sig/orb/models/invoice_issue_failed_webhook_event.rbs +60 -0
  211. data/sig/orb/models/invoice_issued_summary_webhook_event.rbs +504 -0
  212. data/sig/orb/models/invoice_issued_webhook_event.rbs +60 -0
  213. data/sig/orb/models/invoice_manually_marked_as_paid_webhook_event.rbs +73 -0
  214. data/sig/orb/models/invoice_manually_marked_as_void_webhook_event.rbs +50 -0
  215. data/sig/orb/models/invoice_payment_failed_webhook_event.rbs +77 -0
  216. data/sig/orb/models/invoice_payment_processing_webhook_event.rbs +71 -0
  217. data/sig/orb/models/invoice_payment_succeeded_webhook_event.rbs +82 -0
  218. data/sig/orb/models/invoice_sync_failed_webhook_event.rbs +69 -0
  219. data/sig/orb/models/invoice_sync_succeeded_webhook_event.rbs +69 -0
  220. data/sig/orb/models/invoice_undo_mark_as_paid_webhook_event.rbs +50 -0
  221. data/sig/orb/models/metric_events_dropped_by_watermark_webhook_event.rbs +82 -0
  222. data/sig/orb/models/payment_method_created_webhook_event.rbs +112 -0
  223. data/sig/orb/models/payment_method_deleted_webhook_event.rbs +112 -0
  224. data/sig/orb/models/plan_default_version_set_webhook_event.rbs +94 -0
  225. data/sig/orb/models/plan_version_created_webhook_event.rbs +91 -0
  226. data/sig/orb/models/price_edited_webhook_event.rbs +77 -0
  227. data/sig/orb/models/resource_event_test_webhook_event.rbs +57 -0
  228. data/sig/orb/models/sales_order_accounting_sync_failed_webhook_event.rbs +147 -0
  229. data/sig/orb/models/sales_order_accounting_sync_succeeded_webhook_event.rbs +142 -0
  230. data/sig/orb/models/subscription_accounting_sync_failed_webhook_event.rbs +147 -0
  231. data/sig/orb/models/subscription_accounting_sync_succeeded_webhook_event.rbs +142 -0
  232. data/sig/orb/models/subscription_alert_disabled_webhook_event.rbs +444 -0
  233. data/sig/orb/models/subscription_cancellation_scheduled_webhook_event.rbs +60 -0
  234. data/sig/orb/models/subscription_cancellation_unscheduled_webhook_event.rbs +60 -0
  235. data/sig/orb/models/subscription_cost_exceeded_webhook_event.rbs +362 -0
  236. data/sig/orb/models/subscription_created_webhook_event.rbs +50 -0
  237. data/sig/orb/models/subscription_edited_webhook_event.rbs +109 -0
  238. data/sig/orb/models/subscription_ended_webhook_event.rbs +50 -0
  239. data/sig/orb/models/subscription_fixed_fee_quantity_updated_webhook_event.rbs +82 -0
  240. data/sig/orb/models/subscription_grouped_cost_exceeded_webhook_event.rbs +465 -0
  241. data/sig/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rbs +158 -0
  242. data/sig/orb/models/subscription_license_allocation_reset_webhook_event.rbs +180 -0
  243. data/sig/orb/models/subscription_license_balance_threshold_reached_webhook_event.rbs +460 -0
  244. data/sig/orb/models/subscription_plan_change_scheduled_webhook_event.rbs +73 -0
  245. data/sig/orb/models/subscription_plan_changed_webhook_event.rbs +60 -0
  246. data/sig/orb/models/subscription_plan_version_change_scheduled_webhook_event.rbs +77 -0
  247. data/sig/orb/models/subscription_plan_version_changed_webhook_event.rbs +77 -0
  248. data/sig/orb/models/subscription_spend_exceeded_webhook_event.rbs +362 -0
  249. data/sig/orb/models/subscription_started_webhook_event.rbs +50 -0
  250. data/sig/orb/models/subscription_trial_ended_webhook_event.rbs +50 -0
  251. data/sig/orb/models/subscription_usage_exceeded_webhook_event.rbs +367 -0
  252. data/sig/orb/models/transaction_accounting_sync_failed_webhook_event.rbs +205 -0
  253. data/sig/orb/models/transaction_accounting_sync_succeeded_webhook_event.rbs +200 -0
  254. data/sig/orb/models/unwrap_webhook_event.rbs +90 -0
  255. data/sig/orb/models/webhook_unwrap_params.rbs +14 -0
  256. data/sig/orb/models.rbs +162 -0
  257. data/sig/orb/resources/webhooks.rbs +89 -0
  258. metadata +247 -1
@@ -0,0 +1,1035 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ class SubscriptionSpendExceededWebhookEvent < Orb::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Orb::SubscriptionSpendExceededWebhookEvent,
10
+ Orb::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The ID of this webhook event.
15
+ sig { returns(String) }
16
+ attr_accessor :id
17
+
18
+ # The time at which this event was created, to the second.
19
+ sig { returns(Time) }
20
+ attr_accessor :created_at
21
+
22
+ sig { returns(Orb::SubscriptionSpendExceededWebhookEvent::Properties) }
23
+ attr_reader :properties
24
+
25
+ sig do
26
+ params(
27
+ properties:
28
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::OrHash
29
+ ).void
30
+ end
31
+ attr_writer :properties
32
+
33
+ # A [subscription](/core-concepts#subscription) represents the purchase of a plan
34
+ # by a customer.
35
+ #
36
+ # By default, subscriptions begin on the day that they're created and renew
37
+ # automatically for each billing cycle at the cadence that's configured in the
38
+ # plan definition.
39
+ #
40
+ # Subscriptions also default to **beginning of month alignment**, which means the
41
+ # first invoice issued for the subscription will have pro-rated charges between
42
+ # the `start_date` and the first of the following month. Subsequent billing
43
+ # periods will always start and end on a month boundary (e.g. subsequent month
44
+ # starts for monthly billing).
45
+ #
46
+ # Depending on the plan configuration, any _flat_ recurring fees will be billed
47
+ # either at the beginning (in-advance) or end (in-arrears) of each billing cycle.
48
+ # Plans default to **in-advance billing**. Usage-based fees are billed in arrears
49
+ # as usage is accumulated. In the normal course of events, you can expect an
50
+ # invoice to contain usage-based charges for the previous period, and a recurring
51
+ # fee for the following period.
52
+ sig { returns(Orb::Subscription) }
53
+ attr_reader :subscription
54
+
55
+ sig { params(subscription: Orb::Subscription::OrHash).void }
56
+ attr_writer :subscription
57
+
58
+ # The event this payload describes.
59
+ sig do
60
+ returns(Orb::SubscriptionSpendExceededWebhookEvent::Type::TaggedSymbol)
61
+ end
62
+ attr_accessor :type
63
+
64
+ # Issued when a subscription's rated spend, before credits and adjustments,
65
+ # exceeds a pre-configured amount threshold.
66
+ sig do
67
+ params(
68
+ id: String,
69
+ created_at: Time,
70
+ properties:
71
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::OrHash,
72
+ subscription: Orb::Subscription::OrHash,
73
+ type: Orb::SubscriptionSpendExceededWebhookEvent::Type::OrSymbol
74
+ ).returns(T.attached_class)
75
+ end
76
+ def self.new(
77
+ # The ID of this webhook event.
78
+ id:,
79
+ # The time at which this event was created, to the second.
80
+ created_at:,
81
+ properties:,
82
+ # A [subscription](/core-concepts#subscription) represents the purchase of a plan
83
+ # by a customer.
84
+ #
85
+ # By default, subscriptions begin on the day that they're created and renew
86
+ # automatically for each billing cycle at the cadence that's configured in the
87
+ # plan definition.
88
+ #
89
+ # Subscriptions also default to **beginning of month alignment**, which means the
90
+ # first invoice issued for the subscription will have pro-rated charges between
91
+ # the `start_date` and the first of the following month. Subsequent billing
92
+ # periods will always start and end on a month boundary (e.g. subsequent month
93
+ # starts for monthly billing).
94
+ #
95
+ # Depending on the plan configuration, any _flat_ recurring fees will be billed
96
+ # either at the beginning (in-advance) or end (in-arrears) of each billing cycle.
97
+ # Plans default to **in-advance billing**. Usage-based fees are billed in arrears
98
+ # as usage is accumulated. In the normal course of events, you can expect an
99
+ # invoice to contain usage-based charges for the previous period, and a recurring
100
+ # fee for the following period.
101
+ subscription:,
102
+ # The event this payload describes.
103
+ type:
104
+ )
105
+ end
106
+
107
+ sig do
108
+ override.returns(
109
+ {
110
+ id: String,
111
+ created_at: Time,
112
+ properties: Orb::SubscriptionSpendExceededWebhookEvent::Properties,
113
+ subscription: Orb::Subscription,
114
+ type: Orb::SubscriptionSpendExceededWebhookEvent::Type::TaggedSymbol
115
+ }
116
+ )
117
+ end
118
+ def to_hash
119
+ end
120
+
121
+ class Properties < Orb::Internal::Type::BaseModel
122
+ OrHash =
123
+ T.type_alias do
124
+ T.any(
125
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties,
126
+ Orb::Internal::AnyHash
127
+ )
128
+ end
129
+
130
+ # [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
131
+ # usage, or credit balance and trigger webhooks when a threshold is exceeded.
132
+ #
133
+ # Alerts created through the API can be scoped to either customers or
134
+ # subscriptions.
135
+ sig do
136
+ returns(
137
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration
138
+ )
139
+ end
140
+ attr_reader :alert_configuration
141
+
142
+ sig do
143
+ params(
144
+ alert_configuration:
145
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::OrHash
146
+ ).void
147
+ end
148
+ attr_writer :alert_configuration
149
+
150
+ sig { returns(T.nilable(String)) }
151
+ attr_accessor :amount_threshold
152
+
153
+ sig { returns(T.nilable(String)) }
154
+ attr_accessor :evaluated_amount
155
+
156
+ sig { returns(Time) }
157
+ attr_accessor :timeframe_end
158
+
159
+ sig { returns(Time) }
160
+ attr_accessor :timeframe_start
161
+
162
+ sig do
163
+ params(
164
+ alert_configuration:
165
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::OrHash,
166
+ amount_threshold: T.nilable(String),
167
+ evaluated_amount: T.nilable(String),
168
+ timeframe_end: Time,
169
+ timeframe_start: Time
170
+ ).returns(T.attached_class)
171
+ end
172
+ def self.new(
173
+ # [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
174
+ # usage, or credit balance and trigger webhooks when a threshold is exceeded.
175
+ #
176
+ # Alerts created through the API can be scoped to either customers or
177
+ # subscriptions.
178
+ alert_configuration:,
179
+ amount_threshold:,
180
+ evaluated_amount:,
181
+ timeframe_end:,
182
+ timeframe_start:
183
+ )
184
+ end
185
+
186
+ sig do
187
+ override.returns(
188
+ {
189
+ alert_configuration:
190
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration,
191
+ amount_threshold: T.nilable(String),
192
+ evaluated_amount: T.nilable(String),
193
+ timeframe_end: Time,
194
+ timeframe_start: Time
195
+ }
196
+ )
197
+ end
198
+ def to_hash
199
+ end
200
+
201
+ class AlertConfiguration < Orb::Internal::Type::BaseModel
202
+ OrHash =
203
+ T.type_alias do
204
+ T.any(
205
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration,
206
+ Orb::Internal::AnyHash
207
+ )
208
+ end
209
+
210
+ # Also referred to as alert_id in this documentation.
211
+ sig { returns(String) }
212
+ attr_accessor :id
213
+
214
+ # The creation time of the resource in Orb.
215
+ sig { returns(Time) }
216
+ attr_accessor :created_at
217
+
218
+ # The name of the currency the credit balance or invoice cost is denominated in.
219
+ sig { returns(T.nilable(String)) }
220
+ attr_accessor :currency
221
+
222
+ # The customer the alert applies to.
223
+ sig { returns(T.nilable(Orb::CustomerMinified)) }
224
+ attr_reader :customer
225
+
226
+ sig do
227
+ params(customer: T.nilable(Orb::CustomerMinified::OrHash)).void
228
+ end
229
+ attr_writer :customer
230
+
231
+ # Whether the alert is enabled or disabled.
232
+ sig { returns(T::Boolean) }
233
+ attr_accessor :enabled
234
+
235
+ # The metric the alert applies to.
236
+ sig do
237
+ returns(
238
+ T.nilable(
239
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Metric
240
+ )
241
+ )
242
+ end
243
+ attr_reader :metric
244
+
245
+ sig do
246
+ params(
247
+ metric:
248
+ T.nilable(
249
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Metric::OrHash
250
+ )
251
+ ).void
252
+ end
253
+ attr_writer :metric
254
+
255
+ # The plan the alert applies to.
256
+ sig do
257
+ returns(
258
+ T.nilable(
259
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Plan
260
+ )
261
+ )
262
+ end
263
+ attr_reader :plan
264
+
265
+ sig do
266
+ params(
267
+ plan:
268
+ T.nilable(
269
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Plan::OrHash
270
+ )
271
+ ).void
272
+ end
273
+ attr_writer :plan
274
+
275
+ # The subscription the alert applies to.
276
+ sig { returns(T.nilable(Orb::SubscriptionMinified)) }
277
+ attr_reader :subscription
278
+
279
+ sig do
280
+ params(
281
+ subscription: T.nilable(Orb::SubscriptionMinified::OrHash)
282
+ ).void
283
+ end
284
+ attr_writer :subscription
285
+
286
+ # The thresholds that define the conditions under which the alert will be
287
+ # triggered.
288
+ sig do
289
+ returns(
290
+ T.nilable(
291
+ T::Array[
292
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Threshold
293
+ ]
294
+ )
295
+ )
296
+ end
297
+ attr_accessor :thresholds
298
+
299
+ # The type of alert. This must be a valid alert type.
300
+ sig do
301
+ returns(
302
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
303
+ )
304
+ end
305
+ attr_accessor :type
306
+
307
+ # The current status of the alert. This field is only present for credit balance
308
+ # alerts.
309
+ sig do
310
+ returns(
311
+ T.nilable(
312
+ T::Array[
313
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::BalanceAlertStatus
314
+ ]
315
+ )
316
+ )
317
+ end
318
+ attr_accessor :balance_alert_status
319
+
320
+ # The property keys to group cost alerts by. Only present for cost alerts with
321
+ # grouping enabled.
322
+ sig { returns(T.nilable(T::Array[String])) }
323
+ attr_accessor :grouping_keys
324
+
325
+ # Minified license type for alert serialization.
326
+ sig do
327
+ returns(
328
+ T.nilable(
329
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::LicenseType
330
+ )
331
+ )
332
+ end
333
+ attr_reader :license_type
334
+
335
+ sig do
336
+ params(
337
+ license_type:
338
+ T.nilable(
339
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::LicenseType::OrHash
340
+ )
341
+ ).void
342
+ end
343
+ attr_writer :license_type
344
+
345
+ # Filters scoping which prices are included in spend and grouped cost alert
346
+ # evaluation. Alerts use the price_id, item_id, and price_type fields only; the
347
+ # alert's pricing unit is reported by currency.
348
+ sig do
349
+ returns(
350
+ T.nilable(
351
+ T::Array[
352
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter
353
+ ]
354
+ )
355
+ )
356
+ end
357
+ attr_accessor :price_filters
358
+
359
+ # Per-group threshold overrides. Each override maps a specific combination of
360
+ # grouping_keys values to a replacement threshold list. Only present for grouped
361
+ # cost alerts that have at least one override.
362
+ sig do
363
+ returns(
364
+ T.nilable(
365
+ T::Array[
366
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::ThresholdOverride
367
+ ]
368
+ )
369
+ )
370
+ end
371
+ attr_accessor :threshold_overrides
372
+
373
+ # [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
374
+ # usage, or credit balance and trigger webhooks when a threshold is exceeded.
375
+ #
376
+ # Alerts created through the API can be scoped to either customers or
377
+ # subscriptions.
378
+ sig do
379
+ params(
380
+ id: String,
381
+ created_at: Time,
382
+ currency: T.nilable(String),
383
+ customer: T.nilable(Orb::CustomerMinified::OrHash),
384
+ enabled: T::Boolean,
385
+ metric:
386
+ T.nilable(
387
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Metric::OrHash
388
+ ),
389
+ plan:
390
+ T.nilable(
391
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Plan::OrHash
392
+ ),
393
+ subscription: T.nilable(Orb::SubscriptionMinified::OrHash),
394
+ thresholds:
395
+ T.nilable(
396
+ T::Array[
397
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Threshold::OrHash
398
+ ]
399
+ ),
400
+ type:
401
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Type::OrSymbol,
402
+ balance_alert_status:
403
+ T.nilable(
404
+ T::Array[
405
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::BalanceAlertStatus::OrHash
406
+ ]
407
+ ),
408
+ grouping_keys: T.nilable(T::Array[String]),
409
+ license_type:
410
+ T.nilable(
411
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::LicenseType::OrHash
412
+ ),
413
+ price_filters:
414
+ T.nilable(
415
+ T::Array[
416
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::OrHash
417
+ ]
418
+ ),
419
+ threshold_overrides:
420
+ T.nilable(
421
+ T::Array[
422
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::ThresholdOverride::OrHash
423
+ ]
424
+ )
425
+ ).returns(T.attached_class)
426
+ end
427
+ def self.new(
428
+ # Also referred to as alert_id in this documentation.
429
+ id:,
430
+ # The creation time of the resource in Orb.
431
+ created_at:,
432
+ # The name of the currency the credit balance or invoice cost is denominated in.
433
+ currency:,
434
+ # The customer the alert applies to.
435
+ customer:,
436
+ # Whether the alert is enabled or disabled.
437
+ enabled:,
438
+ # The metric the alert applies to.
439
+ metric:,
440
+ # The plan the alert applies to.
441
+ plan:,
442
+ # The subscription the alert applies to.
443
+ subscription:,
444
+ # The thresholds that define the conditions under which the alert will be
445
+ # triggered.
446
+ thresholds:,
447
+ # The type of alert. This must be a valid alert type.
448
+ type:,
449
+ # The current status of the alert. This field is only present for credit balance
450
+ # alerts.
451
+ balance_alert_status: nil,
452
+ # The property keys to group cost alerts by. Only present for cost alerts with
453
+ # grouping enabled.
454
+ grouping_keys: nil,
455
+ # Minified license type for alert serialization.
456
+ license_type: nil,
457
+ # Filters scoping which prices are included in spend and grouped cost alert
458
+ # evaluation. Alerts use the price_id, item_id, and price_type fields only; the
459
+ # alert's pricing unit is reported by currency.
460
+ price_filters: nil,
461
+ # Per-group threshold overrides. Each override maps a specific combination of
462
+ # grouping_keys values to a replacement threshold list. Only present for grouped
463
+ # cost alerts that have at least one override.
464
+ threshold_overrides: nil
465
+ )
466
+ end
467
+
468
+ sig do
469
+ override.returns(
470
+ {
471
+ id: String,
472
+ created_at: Time,
473
+ currency: T.nilable(String),
474
+ customer: T.nilable(Orb::CustomerMinified),
475
+ enabled: T::Boolean,
476
+ metric:
477
+ T.nilable(
478
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Metric
479
+ ),
480
+ plan:
481
+ T.nilable(
482
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Plan
483
+ ),
484
+ subscription: T.nilable(Orb::SubscriptionMinified),
485
+ thresholds:
486
+ T.nilable(
487
+ T::Array[
488
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Threshold
489
+ ]
490
+ ),
491
+ type:
492
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol,
493
+ balance_alert_status:
494
+ T.nilable(
495
+ T::Array[
496
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::BalanceAlertStatus
497
+ ]
498
+ ),
499
+ grouping_keys: T.nilable(T::Array[String]),
500
+ license_type:
501
+ T.nilable(
502
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::LicenseType
503
+ ),
504
+ price_filters:
505
+ T.nilable(
506
+ T::Array[
507
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter
508
+ ]
509
+ ),
510
+ threshold_overrides:
511
+ T.nilable(
512
+ T::Array[
513
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::ThresholdOverride
514
+ ]
515
+ )
516
+ }
517
+ )
518
+ end
519
+ def to_hash
520
+ end
521
+
522
+ class Metric < Orb::Internal::Type::BaseModel
523
+ OrHash =
524
+ T.type_alias do
525
+ T.any(
526
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Metric,
527
+ Orb::Internal::AnyHash
528
+ )
529
+ end
530
+
531
+ sig { returns(String) }
532
+ attr_accessor :id
533
+
534
+ # The metric the alert applies to.
535
+ sig { params(id: String).returns(T.attached_class) }
536
+ def self.new(id:)
537
+ end
538
+
539
+ sig { override.returns({ id: String }) }
540
+ def to_hash
541
+ end
542
+ end
543
+
544
+ class Plan < Orb::Internal::Type::BaseModel
545
+ OrHash =
546
+ T.type_alias do
547
+ T.any(
548
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Plan,
549
+ Orb::Internal::AnyHash
550
+ )
551
+ end
552
+
553
+ sig { returns(T.nilable(String)) }
554
+ attr_accessor :id
555
+
556
+ # An optional user-defined ID for this plan resource, used throughout the system
557
+ # as an alias for this Plan. Use this field to identify a plan by an existing
558
+ # identifier in your system.
559
+ sig { returns(T.nilable(String)) }
560
+ attr_accessor :external_plan_id
561
+
562
+ sig { returns(T.nilable(String)) }
563
+ attr_accessor :name
564
+
565
+ sig { returns(String) }
566
+ attr_accessor :plan_version
567
+
568
+ # The plan the alert applies to.
569
+ sig do
570
+ params(
571
+ id: T.nilable(String),
572
+ external_plan_id: T.nilable(String),
573
+ name: T.nilable(String),
574
+ plan_version: String
575
+ ).returns(T.attached_class)
576
+ end
577
+ def self.new(
578
+ id:,
579
+ # An optional user-defined ID for this plan resource, used throughout the system
580
+ # as an alias for this Plan. Use this field to identify a plan by an existing
581
+ # identifier in your system.
582
+ external_plan_id:,
583
+ name:,
584
+ plan_version:
585
+ )
586
+ end
587
+
588
+ sig do
589
+ override.returns(
590
+ {
591
+ id: T.nilable(String),
592
+ external_plan_id: T.nilable(String),
593
+ name: T.nilable(String),
594
+ plan_version: String
595
+ }
596
+ )
597
+ end
598
+ def to_hash
599
+ end
600
+ end
601
+
602
+ class Threshold < Orb::Internal::Type::BaseModel
603
+ OrHash =
604
+ T.type_alias do
605
+ T.any(
606
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Threshold,
607
+ Orb::Internal::AnyHash
608
+ )
609
+ end
610
+
611
+ # The value at which an alert will fire. For credit balance alerts, the alert will
612
+ # fire at or below this value. For usage and cost alerts, the alert will fire at
613
+ # or above this value.
614
+ sig { returns(String) }
615
+ attr_accessor :value
616
+
617
+ # Thresholds are used to define the conditions under which an alert will be
618
+ # triggered.
619
+ sig { params(value: String).returns(T.attached_class) }
620
+ def self.new(
621
+ # The value at which an alert will fire. For credit balance alerts, the alert will
622
+ # fire at or below this value. For usage and cost alerts, the alert will fire at
623
+ # or above this value.
624
+ value:
625
+ )
626
+ end
627
+
628
+ sig { override.returns({ value: String }) }
629
+ def to_hash
630
+ end
631
+ end
632
+
633
+ # The type of alert. This must be a valid alert type.
634
+ module Type
635
+ extend Orb::Internal::Type::Enum
636
+
637
+ TaggedSymbol =
638
+ T.type_alias do
639
+ T.all(
640
+ Symbol,
641
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Type
642
+ )
643
+ end
644
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
645
+
646
+ CREDIT_BALANCE_DEPLETED =
647
+ T.let(
648
+ :credit_balance_depleted,
649
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
650
+ )
651
+ CREDIT_BALANCE_DROPPED =
652
+ T.let(
653
+ :credit_balance_dropped,
654
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
655
+ )
656
+ CREDIT_BALANCE_RECOVERED =
657
+ T.let(
658
+ :credit_balance_recovered,
659
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
660
+ )
661
+ USAGE_EXCEEDED =
662
+ T.let(
663
+ :usage_exceeded,
664
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
665
+ )
666
+ COST_EXCEEDED =
667
+ T.let(
668
+ :cost_exceeded,
669
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
670
+ )
671
+ SPEND_EXCEEDED =
672
+ T.let(
673
+ :spend_exceeded,
674
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
675
+ )
676
+ LICENSE_BALANCE_THRESHOLD_REACHED =
677
+ T.let(
678
+ :license_balance_threshold_reached,
679
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
680
+ )
681
+
682
+ sig do
683
+ override.returns(
684
+ T::Array[
685
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::Type::TaggedSymbol
686
+ ]
687
+ )
688
+ end
689
+ def self.values
690
+ end
691
+ end
692
+
693
+ class BalanceAlertStatus < Orb::Internal::Type::BaseModel
694
+ OrHash =
695
+ T.type_alias do
696
+ T.any(
697
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::BalanceAlertStatus,
698
+ Orb::Internal::AnyHash
699
+ )
700
+ end
701
+
702
+ # Whether the alert is currently in-alert or not.
703
+ sig { returns(T::Boolean) }
704
+ attr_accessor :in_alert
705
+
706
+ # The value of the threshold that defines the alert status.
707
+ sig { returns(String) }
708
+ attr_accessor :threshold_value
709
+
710
+ # Alert status is used to determine if an alert is currently in-alert or not.
711
+ sig do
712
+ params(in_alert: T::Boolean, threshold_value: String).returns(
713
+ T.attached_class
714
+ )
715
+ end
716
+ def self.new(
717
+ # Whether the alert is currently in-alert or not.
718
+ in_alert:,
719
+ # The value of the threshold that defines the alert status.
720
+ threshold_value:
721
+ )
722
+ end
723
+
724
+ sig do
725
+ override.returns(
726
+ { in_alert: T::Boolean, threshold_value: String }
727
+ )
728
+ end
729
+ def to_hash
730
+ end
731
+ end
732
+
733
+ class LicenseType < Orb::Internal::Type::BaseModel
734
+ OrHash =
735
+ T.type_alias do
736
+ T.any(
737
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::LicenseType,
738
+ Orb::Internal::AnyHash
739
+ )
740
+ end
741
+
742
+ sig { returns(String) }
743
+ attr_accessor :id
744
+
745
+ # Minified license type for alert serialization.
746
+ sig { params(id: String).returns(T.attached_class) }
747
+ def self.new(id:)
748
+ end
749
+
750
+ sig { override.returns({ id: String }) }
751
+ def to_hash
752
+ end
753
+ end
754
+
755
+ class PriceFilter < Orb::Internal::Type::BaseModel
756
+ OrHash =
757
+ T.type_alias do
758
+ T.any(
759
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter,
760
+ Orb::Internal::AnyHash
761
+ )
762
+ end
763
+
764
+ # The property of the price to filter on.
765
+ sig do
766
+ returns(
767
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
768
+ )
769
+ end
770
+ attr_accessor :field
771
+
772
+ # Should prices that match the filter be included or excluded.
773
+ sig do
774
+ returns(
775
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator::TaggedSymbol
776
+ )
777
+ end
778
+ attr_accessor :operator
779
+
780
+ # The IDs or values that match this filter.
781
+ sig { returns(T::Array[String]) }
782
+ attr_accessor :values
783
+
784
+ sig do
785
+ params(
786
+ field:
787
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::OrSymbol,
788
+ operator:
789
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator::OrSymbol,
790
+ values: T::Array[String]
791
+ ).returns(T.attached_class)
792
+ end
793
+ def self.new(
794
+ # The property of the price to filter on.
795
+ field:,
796
+ # Should prices that match the filter be included or excluded.
797
+ operator:,
798
+ # The IDs or values that match this filter.
799
+ values:
800
+ )
801
+ end
802
+
803
+ sig do
804
+ override.returns(
805
+ {
806
+ field:
807
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol,
808
+ operator:
809
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator::TaggedSymbol,
810
+ values: T::Array[String]
811
+ }
812
+ )
813
+ end
814
+ def to_hash
815
+ end
816
+
817
+ # The property of the price to filter on.
818
+ module Field
819
+ extend Orb::Internal::Type::Enum
820
+
821
+ TaggedSymbol =
822
+ T.type_alias do
823
+ T.all(
824
+ Symbol,
825
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field
826
+ )
827
+ end
828
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
829
+
830
+ PRICE_ID =
831
+ T.let(
832
+ :price_id,
833
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
834
+ )
835
+ ITEM_ID =
836
+ T.let(
837
+ :item_id,
838
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
839
+ )
840
+ PRICE_TYPE =
841
+ T.let(
842
+ :price_type,
843
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
844
+ )
845
+ CURRENCY =
846
+ T.let(
847
+ :currency,
848
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
849
+ )
850
+ PRICING_UNIT_ID =
851
+ T.let(
852
+ :pricing_unit_id,
853
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
854
+ )
855
+
856
+ sig do
857
+ override.returns(
858
+ T::Array[
859
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Field::TaggedSymbol
860
+ ]
861
+ )
862
+ end
863
+ def self.values
864
+ end
865
+ end
866
+
867
+ # Should prices that match the filter be included or excluded.
868
+ module Operator
869
+ extend Orb::Internal::Type::Enum
870
+
871
+ TaggedSymbol =
872
+ T.type_alias do
873
+ T.all(
874
+ Symbol,
875
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator
876
+ )
877
+ end
878
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
879
+
880
+ INCLUDES =
881
+ T.let(
882
+ :includes,
883
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator::TaggedSymbol
884
+ )
885
+ EXCLUDES =
886
+ T.let(
887
+ :excludes,
888
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator::TaggedSymbol
889
+ )
890
+
891
+ sig do
892
+ override.returns(
893
+ T::Array[
894
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::PriceFilter::Operator::TaggedSymbol
895
+ ]
896
+ )
897
+ end
898
+ def self.values
899
+ end
900
+ end
901
+ end
902
+
903
+ class ThresholdOverride < Orb::Internal::Type::BaseModel
904
+ OrHash =
905
+ T.type_alias do
906
+ T.any(
907
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::ThresholdOverride,
908
+ Orb::Internal::AnyHash
909
+ )
910
+ end
911
+
912
+ # The values identifying this group, ordered to match group_keys when set and the
913
+ # alert's grouping_keys otherwise.
914
+ sig { returns(T::Array[String]) }
915
+ attr_accessor :group_values
916
+
917
+ # The thresholds applied to this group. An empty list means the group is silenced.
918
+ sig do
919
+ returns(
920
+ T::Array[
921
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::ThresholdOverride::Threshold
922
+ ]
923
+ )
924
+ end
925
+ attr_accessor :thresholds
926
+
927
+ # The subset of the alert's grouping_keys this override binds. Null when the
928
+ # override targets one exact group across every grouping key.
929
+ sig { returns(T.nilable(T::Array[String])) }
930
+ attr_accessor :group_keys
931
+
932
+ # A per-group threshold override on a grouped cost alert.
933
+ #
934
+ # An empty `thresholds` list means the group is silenced (never fires). A
935
+ # non-empty list fully replaces the default thresholds for that group.
936
+ sig do
937
+ params(
938
+ group_values: T::Array[String],
939
+ thresholds:
940
+ T::Array[
941
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::ThresholdOverride::Threshold::OrHash
942
+ ],
943
+ group_keys: T.nilable(T::Array[String])
944
+ ).returns(T.attached_class)
945
+ end
946
+ def self.new(
947
+ # The values identifying this group, ordered to match group_keys when set and the
948
+ # alert's grouping_keys otherwise.
949
+ group_values:,
950
+ # The thresholds applied to this group. An empty list means the group is silenced.
951
+ thresholds:,
952
+ # The subset of the alert's grouping_keys this override binds. Null when the
953
+ # override targets one exact group across every grouping key.
954
+ group_keys: nil
955
+ )
956
+ end
957
+
958
+ sig do
959
+ override.returns(
960
+ {
961
+ group_values: T::Array[String],
962
+ thresholds:
963
+ T::Array[
964
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::ThresholdOverride::Threshold
965
+ ],
966
+ group_keys: T.nilable(T::Array[String])
967
+ }
968
+ )
969
+ end
970
+ def to_hash
971
+ end
972
+
973
+ class Threshold < Orb::Internal::Type::BaseModel
974
+ OrHash =
975
+ T.type_alias do
976
+ T.any(
977
+ Orb::SubscriptionSpendExceededWebhookEvent::Properties::AlertConfiguration::ThresholdOverride::Threshold,
978
+ Orb::Internal::AnyHash
979
+ )
980
+ end
981
+
982
+ # The value at which an alert will fire. For credit balance alerts, the alert will
983
+ # fire at or below this value. For usage and cost alerts, the alert will fire at
984
+ # or above this value.
985
+ sig { returns(String) }
986
+ attr_accessor :value
987
+
988
+ # Thresholds are used to define the conditions under which an alert will be
989
+ # triggered.
990
+ sig { params(value: String).returns(T.attached_class) }
991
+ def self.new(
992
+ # The value at which an alert will fire. For credit balance alerts, the alert will
993
+ # fire at or below this value. For usage and cost alerts, the alert will fire at
994
+ # or above this value.
995
+ value:
996
+ )
997
+ end
998
+
999
+ sig { override.returns({ value: String }) }
1000
+ def to_hash
1001
+ end
1002
+ end
1003
+ end
1004
+ end
1005
+ end
1006
+
1007
+ # The event this payload describes.
1008
+ module Type
1009
+ extend Orb::Internal::Type::Enum
1010
+
1011
+ TaggedSymbol =
1012
+ T.type_alias do
1013
+ T.all(Symbol, Orb::SubscriptionSpendExceededWebhookEvent::Type)
1014
+ end
1015
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1016
+
1017
+ SUBSCRIPTION_SPEND_EXCEEDED =
1018
+ T.let(
1019
+ :"subscription.spend_exceeded",
1020
+ Orb::SubscriptionSpendExceededWebhookEvent::Type::TaggedSymbol
1021
+ )
1022
+
1023
+ sig do
1024
+ override.returns(
1025
+ T::Array[
1026
+ Orb::SubscriptionSpendExceededWebhookEvent::Type::TaggedSymbol
1027
+ ]
1028
+ )
1029
+ end
1030
+ def self.values
1031
+ end
1032
+ end
1033
+ end
1034
+ end
1035
+ end