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