orb-billing 1.46.0 → 1.48.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 (160) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -1
  3. data/README.md +1 -1
  4. data/lib/orb/models/credit_block_update_params.rb +34 -0
  5. data/lib/orb/models/credit_block_update_response.rb +332 -0
  6. data/lib/orb/models/invoice_issue_summary_response.rb +2 -1
  7. data/lib/orb/models/invoice_issued_summary_webhook_event.rb +5 -3
  8. data/lib/orb/models/invoice_list_summary_response.rb +2 -1
  9. data/lib/orb/models/metric_archive_params.rb +20 -0
  10. data/lib/orb/models/metric_list_params.rb +21 -1
  11. data/lib/orb/models/metric_unarchive_params.rb +20 -0
  12. data/lib/orb/models/metric_update_params.rb +17 -1
  13. data/lib/orb/models/plan_update_params.rb +9 -1
  14. data/lib/orb/models/plans/external_plan_id_update_params.rb +9 -1
  15. data/lib/orb/models/subscription_alert_disabled_webhook_event.rb +5 -9
  16. data/lib/orb/models/subscription_grouped_cost_exceeded_webhook_event.rb +5 -9
  17. data/lib/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rb +5 -9
  18. data/lib/orb/models/subscription_license_allocation_reset_webhook_event.rb +5 -9
  19. data/lib/orb/models/subscription_license_balance_threshold_reached_webhook_event.rb +5 -9
  20. data/lib/orb/models/webhook_endpoint.rb +28 -1
  21. data/lib/orb/models/webhook_endpoint_create_params.rb +22 -1
  22. data/lib/orb/models/webhook_endpoint_update_params.rb +22 -1
  23. data/lib/orb/models/webhook_endpoint_with_secret.rb +28 -1
  24. data/lib/orb/models/webhooks/invoice_accounting_sync_failed_standard_webhook_event.rb +5 -3
  25. data/lib/orb/models/webhooks/invoice_accounting_sync_succeeded_standard_webhook_event.rb +5 -3
  26. data/lib/orb/models/webhooks/invoice_dunning_schedule_created_standard_webhook_event.rb +5 -3
  27. data/lib/orb/models/webhooks/invoice_dunning_schedule_ended_standard_webhook_event.rb +5 -3
  28. data/lib/orb/models/webhooks/invoice_dunning_schedule_reset_standard_webhook_event.rb +5 -3
  29. data/lib/orb/models/webhooks/invoice_dunning_schedule_step_executed_standard_webhook_event.rb +5 -3
  30. data/lib/orb/models/webhooks/invoice_edited_standard_webhook_event.rb +5 -3
  31. data/lib/orb/models/webhooks/invoice_issue_failed_standard_webhook_event.rb +5 -3
  32. data/lib/orb/models/webhooks/invoice_issued_standard_webhook_event.rb +5 -3
  33. data/lib/orb/models/webhooks/invoice_issued_summary_standard_webhook_event.rb +5 -3
  34. data/lib/orb/models/webhooks/invoice_manually_marked_as_paid_standard_webhook_event.rb +5 -3
  35. data/lib/orb/models/webhooks/invoice_manually_marked_as_void_standard_webhook_event.rb +5 -3
  36. data/lib/orb/models/webhooks/invoice_payment_failed_standard_webhook_event.rb +5 -3
  37. data/lib/orb/models/webhooks/invoice_payment_processing_standard_webhook_event.rb +5 -3
  38. data/lib/orb/models/webhooks/invoice_payment_succeeded_standard_webhook_event.rb +5 -3
  39. data/lib/orb/models/webhooks/invoice_sync_failed_standard_webhook_event.rb +5 -3
  40. data/lib/orb/models/webhooks/invoice_sync_succeeded_standard_webhook_event.rb +5 -3
  41. data/lib/orb/models/webhooks/invoice_undo_mark_as_paid_standard_webhook_event.rb +5 -3
  42. data/lib/orb/models/webhooks/sales_order_accounting_sync_failed_standard_webhook_event.rb +5 -3
  43. data/lib/orb/models/webhooks/sales_order_accounting_sync_succeeded_standard_webhook_event.rb +5 -3
  44. data/lib/orb/models/webhooks/subscription_accounting_sync_failed_standard_webhook_event.rb +9 -7
  45. data/lib/orb/models/webhooks/subscription_accounting_sync_succeeded_standard_webhook_event.rb +9 -7
  46. data/lib/orb/models/webhooks/subscription_alert_disabled_standard_webhook_event.rb +5 -9
  47. data/lib/orb/models/webhooks/subscription_cancellation_scheduled_standard_webhook_event.rb +9 -7
  48. data/lib/orb/models/webhooks/subscription_cancellation_unscheduled_standard_webhook_event.rb +9 -7
  49. data/lib/orb/models/webhooks/subscription_cost_exceeded_standard_webhook_event.rb +9 -7
  50. data/lib/orb/models/webhooks/subscription_created_standard_webhook_event.rb +9 -7
  51. data/lib/orb/models/webhooks/subscription_edited_standard_webhook_event.rb +9 -7
  52. data/lib/orb/models/webhooks/subscription_ended_standard_webhook_event.rb +9 -7
  53. data/lib/orb/models/webhooks/subscription_fixed_fee_quantity_updated_standard_webhook_event.rb +9 -7
  54. data/lib/orb/models/webhooks/subscription_grouped_cost_exceeded_standard_webhook_event.rb +5 -9
  55. data/lib/orb/models/webhooks/subscription_invoicing_threshold_exceeded_standard_webhook_event.rb +5 -9
  56. data/lib/orb/models/webhooks/subscription_license_allocation_reset_standard_webhook_event.rb +5 -9
  57. data/lib/orb/models/webhooks/subscription_license_balance_threshold_reached_standard_webhook_event.rb +5 -9
  58. data/lib/orb/models/webhooks/subscription_plan_change_scheduled_standard_webhook_event.rb +9 -7
  59. data/lib/orb/models/webhooks/subscription_plan_changed_standard_webhook_event.rb +9 -7
  60. data/lib/orb/models/webhooks/subscription_plan_version_change_scheduled_standard_webhook_event.rb +9 -7
  61. data/lib/orb/models/webhooks/subscription_plan_version_changed_standard_webhook_event.rb +9 -7
  62. data/lib/orb/models/webhooks/subscription_spend_exceeded_standard_webhook_event.rb +9 -7
  63. data/lib/orb/models/webhooks/subscription_started_standard_webhook_event.rb +9 -7
  64. data/lib/orb/models/webhooks/subscription_trial_ended_standard_webhook_event.rb +9 -7
  65. data/lib/orb/models/webhooks/subscription_usage_exceeded_standard_webhook_event.rb +9 -7
  66. data/lib/orb/models.rb +6 -0
  67. data/lib/orb/resources/credit_blocks.rb +35 -0
  68. data/lib/orb/resources/metrics.rb +61 -5
  69. data/lib/orb/resources/plans/external_plan_id.rb +6 -3
  70. data/lib/orb/resources/plans.rb +6 -3
  71. data/lib/orb/resources/webhook_endpoints.rb +6 -2
  72. data/lib/orb/version.rb +1 -1
  73. data/lib/orb.rb +4 -0
  74. data/rbi/orb/models/credit_block_update_params.rbi +53 -0
  75. data/rbi/orb/models/credit_block_update_response.rbi +693 -0
  76. data/rbi/orb/models/invoice_issue_summary_response.rbi +2 -1
  77. data/rbi/orb/models/invoice_issued_summary_webhook_event.rbi +6 -3
  78. data/rbi/orb/models/invoice_list_summary_response.rbi +2 -1
  79. data/rbi/orb/models/metric_archive_params.rbi +33 -0
  80. data/rbi/orb/models/metric_list_params.rbi +29 -0
  81. data/rbi/orb/models/metric_unarchive_params.rbi +35 -0
  82. data/rbi/orb/models/metric_update_params.rbi +16 -0
  83. data/rbi/orb/models/plan_update_params.rbi +8 -0
  84. data/rbi/orb/models/plans/external_plan_id_update_params.rbi +8 -0
  85. data/rbi/orb/models/subscription_alert_disabled_webhook_event.rbi +6 -12
  86. data/rbi/orb/models/subscription_grouped_cost_exceeded_webhook_event.rbi +6 -12
  87. data/rbi/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rbi +6 -12
  88. data/rbi/orb/models/subscription_license_allocation_reset_webhook_event.rbi +6 -12
  89. data/rbi/orb/models/subscription_license_balance_threshold_reached_webhook_event.rbi +6 -12
  90. data/rbi/orb/models/webhook_endpoint.rbi +39 -0
  91. data/rbi/orb/models/webhook_endpoint_create_params.rbi +51 -0
  92. data/rbi/orb/models/webhook_endpoint_update_params.rbi +51 -0
  93. data/rbi/orb/models/webhook_endpoint_with_secret.rbi +50 -0
  94. data/rbi/orb/models/webhooks/invoice_accounting_sync_failed_standard_webhook_event.rbi +6 -3
  95. data/rbi/orb/models/webhooks/invoice_accounting_sync_succeeded_standard_webhook_event.rbi +6 -3
  96. data/rbi/orb/models/webhooks/invoice_dunning_schedule_created_standard_webhook_event.rbi +6 -3
  97. data/rbi/orb/models/webhooks/invoice_dunning_schedule_ended_standard_webhook_event.rbi +6 -3
  98. data/rbi/orb/models/webhooks/invoice_dunning_schedule_reset_standard_webhook_event.rbi +6 -3
  99. data/rbi/orb/models/webhooks/invoice_dunning_schedule_step_executed_standard_webhook_event.rbi +6 -3
  100. data/rbi/orb/models/webhooks/invoice_edited_standard_webhook_event.rbi +6 -3
  101. data/rbi/orb/models/webhooks/invoice_issue_failed_standard_webhook_event.rbi +6 -3
  102. data/rbi/orb/models/webhooks/invoice_issued_standard_webhook_event.rbi +6 -3
  103. data/rbi/orb/models/webhooks/invoice_issued_summary_standard_webhook_event.rbi +6 -3
  104. data/rbi/orb/models/webhooks/invoice_manually_marked_as_paid_standard_webhook_event.rbi +6 -3
  105. data/rbi/orb/models/webhooks/invoice_manually_marked_as_void_standard_webhook_event.rbi +6 -3
  106. data/rbi/orb/models/webhooks/invoice_payment_failed_standard_webhook_event.rbi +6 -3
  107. data/rbi/orb/models/webhooks/invoice_payment_processing_standard_webhook_event.rbi +6 -3
  108. data/rbi/orb/models/webhooks/invoice_payment_succeeded_standard_webhook_event.rbi +6 -3
  109. data/rbi/orb/models/webhooks/invoice_sync_failed_standard_webhook_event.rbi +6 -3
  110. data/rbi/orb/models/webhooks/invoice_sync_succeeded_standard_webhook_event.rbi +6 -3
  111. data/rbi/orb/models/webhooks/invoice_undo_mark_as_paid_standard_webhook_event.rbi +6 -3
  112. data/rbi/orb/models/webhooks/sales_order_accounting_sync_failed_standard_webhook_event.rbi +6 -3
  113. data/rbi/orb/models/webhooks/sales_order_accounting_sync_succeeded_standard_webhook_event.rbi +6 -3
  114. data/rbi/orb/models/webhooks/subscription_accounting_sync_failed_standard_webhook_event.rbi +12 -9
  115. data/rbi/orb/models/webhooks/subscription_accounting_sync_succeeded_standard_webhook_event.rbi +12 -9
  116. data/rbi/orb/models/webhooks/subscription_alert_disabled_standard_webhook_event.rbi +6 -12
  117. data/rbi/orb/models/webhooks/subscription_cancellation_scheduled_standard_webhook_event.rbi +12 -9
  118. data/rbi/orb/models/webhooks/subscription_cancellation_unscheduled_standard_webhook_event.rbi +12 -9
  119. data/rbi/orb/models/webhooks/subscription_cost_exceeded_standard_webhook_event.rbi +12 -9
  120. data/rbi/orb/models/webhooks/subscription_created_standard_webhook_event.rbi +12 -9
  121. data/rbi/orb/models/webhooks/subscription_edited_standard_webhook_event.rbi +12 -9
  122. data/rbi/orb/models/webhooks/subscription_ended_standard_webhook_event.rbi +12 -9
  123. data/rbi/orb/models/webhooks/subscription_fixed_fee_quantity_updated_standard_webhook_event.rbi +12 -9
  124. data/rbi/orb/models/webhooks/subscription_grouped_cost_exceeded_standard_webhook_event.rbi +6 -12
  125. data/rbi/orb/models/webhooks/subscription_invoicing_threshold_exceeded_standard_webhook_event.rbi +6 -12
  126. data/rbi/orb/models/webhooks/subscription_license_allocation_reset_standard_webhook_event.rbi +6 -12
  127. data/rbi/orb/models/webhooks/subscription_license_balance_threshold_reached_standard_webhook_event.rbi +6 -12
  128. data/rbi/orb/models/webhooks/subscription_plan_change_scheduled_standard_webhook_event.rbi +12 -9
  129. data/rbi/orb/models/webhooks/subscription_plan_changed_standard_webhook_event.rbi +12 -9
  130. data/rbi/orb/models/webhooks/subscription_plan_version_change_scheduled_standard_webhook_event.rbi +12 -9
  131. data/rbi/orb/models/webhooks/subscription_plan_version_changed_standard_webhook_event.rbi +12 -9
  132. data/rbi/orb/models/webhooks/subscription_spend_exceeded_standard_webhook_event.rbi +12 -9
  133. data/rbi/orb/models/webhooks/subscription_started_standard_webhook_event.rbi +12 -9
  134. data/rbi/orb/models/webhooks/subscription_trial_ended_standard_webhook_event.rbi +12 -9
  135. data/rbi/orb/models/webhooks/subscription_usage_exceeded_standard_webhook_event.rbi +12 -9
  136. data/rbi/orb/models.rbi +6 -0
  137. data/rbi/orb/resources/credit_blocks.rbi +26 -0
  138. data/rbi/orb/resources/metrics.rbi +44 -3
  139. data/rbi/orb/resources/plans/external_plan_id.rbi +6 -2
  140. data/rbi/orb/resources/plans.rbi +6 -2
  141. data/rbi/orb/resources/webhook_endpoints.rbi +10 -0
  142. data/sig/orb/models/credit_block_update_params.rbs +28 -0
  143. data/sig/orb/models/credit_block_update_response.rbs +263 -0
  144. data/sig/orb/models/metric_archive_params.rbs +23 -0
  145. data/sig/orb/models/metric_list_params.rbs +18 -1
  146. data/sig/orb/models/metric_unarchive_params.rbs +23 -0
  147. data/sig/orb/models/metric_update_params.rbs +14 -1
  148. data/sig/orb/models/plan_update_params.rbs +6 -1
  149. data/sig/orb/models/plans/external_plan_id_update_params.rbs +6 -1
  150. data/sig/orb/models/webhook_endpoint.rbs +16 -0
  151. data/sig/orb/models/webhook_endpoint_create_params.rbs +20 -1
  152. data/sig/orb/models/webhook_endpoint_update_params.rbs +16 -0
  153. data/sig/orb/models/webhook_endpoint_with_secret.rbs +16 -0
  154. data/sig/orb/models.rbs +6 -0
  155. data/sig/orb/resources/credit_blocks.rbs +6 -0
  156. data/sig/orb/resources/metrics.rbs +13 -0
  157. data/sig/orb/resources/plans/external_plan_id.rbs +1 -0
  158. data/sig/orb/resources/plans.rbs +1 -0
  159. data/sig/orb/resources/webhook_endpoints.rbs +2 -0
  160. metadata +13 -1
@@ -16,7 +16,8 @@ module Orb
16
16
  sig { returns(Time) }
17
17
  attr_accessor :created_at
18
18
 
19
- # #InvoiceApiResourceWithoutLineItems
19
+ # An invoice without its line items, subtotal, discounts, minimums or maximums.
20
+ # Fetch the invoice for those.
20
21
  sig { returns(Orb::InvoiceIssuedSummaryWebhookEvent::Invoice) }
21
22
  attr_reader :invoice
22
23
 
@@ -68,7 +69,8 @@ module Orb
68
69
  id:,
69
70
  # The time at which this event was created, to the second.
70
71
  created_at:,
71
- # #InvoiceApiResourceWithoutLineItems
72
+ # An invoice without its line items, subtotal, discounts, minimums or maximums.
73
+ # Fetch the invoice for those.
72
74
  invoice:,
73
75
  # The serialization style this payload was rendered in, as configured on the
74
76
  # endpoint.
@@ -463,7 +465,8 @@ module Orb
463
465
  sig { returns(T::Boolean) }
464
466
  attr_accessor :will_auto_issue
465
467
 
466
- # #InvoiceApiResourceWithoutLineItems
468
+ # An invoice without its line items, subtotal, discounts, minimums or maximums.
469
+ # Fetch the invoice for those.
467
470
  sig do
468
471
  params(
469
472
  id: String,
@@ -355,7 +355,8 @@ module Orb
355
355
  sig { returns(T::Boolean) }
356
356
  attr_accessor :will_auto_issue
357
357
 
358
- # #InvoiceApiResourceWithoutLineItems
358
+ # An invoice without its line items, subtotal, discounts, minimums or maximums.
359
+ # Fetch the invoice for those.
359
360
  sig do
360
361
  params(
361
362
  id: String,
@@ -0,0 +1,33 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ class MetricArchiveParams < Orb::Internal::Type::BaseModel
6
+ extend Orb::Internal::Type::RequestParameters::Converter
7
+ include Orb::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias { T.any(Orb::MetricArchiveParams, Orb::Internal::AnyHash) }
11
+
12
+ sig { returns(String) }
13
+ attr_accessor :metric_id
14
+
15
+ sig do
16
+ params(
17
+ metric_id: String,
18
+ request_options: Orb::RequestOptions::OrHash
19
+ ).returns(T.attached_class)
20
+ end
21
+ def self.new(metric_id:, request_options: {})
22
+ end
23
+
24
+ sig do
25
+ override.returns(
26
+ { metric_id: String, request_options: Orb::RequestOptions }
27
+ )
28
+ end
29
+ def to_hash
30
+ end
31
+ end
32
+ end
33
+ end
@@ -33,6 +33,10 @@ module Orb
33
33
  sig { params(limit: Integer).void }
34
34
  attr_writer :limit
35
35
 
36
+ # The metric status to filter to ('active', 'archived', or 'draft').
37
+ sig { returns(T.nilable(Orb::MetricListParams::Status::OrSymbol)) }
38
+ attr_accessor :status
39
+
36
40
  sig do
37
41
  params(
38
42
  created_at_gt: T.nilable(Time),
@@ -41,6 +45,7 @@ module Orb
41
45
  created_at_lte: T.nilable(Time),
42
46
  cursor: T.nilable(String),
43
47
  limit: Integer,
48
+ status: T.nilable(Orb::MetricListParams::Status::OrSymbol),
44
49
  request_options: Orb::RequestOptions::OrHash
45
50
  ).returns(T.attached_class)
46
51
  end
@@ -54,6 +59,8 @@ module Orb
54
59
  cursor: nil,
55
60
  # The number of items to fetch. Defaults to 20.
56
61
  limit: nil,
62
+ # The metric status to filter to ('active', 'archived', or 'draft').
63
+ status: nil,
57
64
  request_options: {}
58
65
  )
59
66
  end
@@ -67,12 +74,34 @@ module Orb
67
74
  created_at_lte: T.nilable(Time),
68
75
  cursor: T.nilable(String),
69
76
  limit: Integer,
77
+ status: T.nilable(Orb::MetricListParams::Status::OrSymbol),
70
78
  request_options: Orb::RequestOptions
71
79
  }
72
80
  )
73
81
  end
74
82
  def to_hash
75
83
  end
84
+
85
+ # The metric status to filter to ('active', 'archived', or 'draft').
86
+ module Status
87
+ extend Orb::Internal::Type::Enum
88
+
89
+ TaggedSymbol =
90
+ T.type_alias { T.all(Symbol, Orb::MetricListParams::Status) }
91
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
92
+
93
+ ACTIVE = T.let(:active, Orb::MetricListParams::Status::TaggedSymbol)
94
+ ARCHIVED = T.let(:archived, Orb::MetricListParams::Status::TaggedSymbol)
95
+ DRAFT = T.let(:draft, Orb::MetricListParams::Status::TaggedSymbol)
96
+
97
+ sig do
98
+ override.returns(
99
+ T::Array[Orb::MetricListParams::Status::TaggedSymbol]
100
+ )
101
+ end
102
+ def self.values
103
+ end
104
+ end
76
105
  end
77
106
  end
78
107
  end
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ class MetricUnarchiveParams < Orb::Internal::Type::BaseModel
6
+ extend Orb::Internal::Type::RequestParameters::Converter
7
+ include Orb::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Orb::MetricUnarchiveParams, Orb::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :metric_id
16
+
17
+ sig do
18
+ params(
19
+ metric_id: String,
20
+ request_options: Orb::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(metric_id:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { metric_id: String, request_options: Orb::RequestOptions }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
@@ -12,25 +12,39 @@ module Orb
12
12
  sig { returns(String) }
13
13
  attr_accessor :metric_id
14
14
 
15
+ # A description of the metric.
16
+ sig { returns(T.nilable(String)) }
17
+ attr_accessor :description
18
+
15
19
  # User-specified key/value pairs for the resource. Individual keys can be removed
16
20
  # by setting the value to `null`, and the entire metadata mapping can be cleared
17
21
  # by setting `metadata` to `null`.
18
22
  sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
19
23
  attr_accessor :metadata
20
24
 
25
+ # The name of the metric.
26
+ sig { returns(T.nilable(String)) }
27
+ attr_accessor :name
28
+
21
29
  sig do
22
30
  params(
23
31
  metric_id: String,
32
+ description: T.nilable(String),
24
33
  metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
34
+ name: T.nilable(String),
25
35
  request_options: Orb::RequestOptions::OrHash
26
36
  ).returns(T.attached_class)
27
37
  end
28
38
  def self.new(
29
39
  metric_id:,
40
+ # A description of the metric.
41
+ description: nil,
30
42
  # User-specified key/value pairs for the resource. Individual keys can be removed
31
43
  # by setting the value to `null`, and the entire metadata mapping can be cleared
32
44
  # by setting `metadata` to `null`.
33
45
  metadata: nil,
46
+ # The name of the metric.
47
+ name: nil,
34
48
  request_options: {}
35
49
  )
36
50
  end
@@ -39,7 +53,9 @@ module Orb
39
53
  override.returns(
40
54
  {
41
55
  metric_id: String,
56
+ description: T.nilable(String),
42
57
  metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
58
+ name: T.nilable(String),
43
59
  request_options: Orb::RequestOptions
44
60
  }
45
61
  )
@@ -28,12 +28,17 @@ module Orb
28
28
  sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
29
29
  attr_accessor :metadata
30
30
 
31
+ # The name of the plan.
32
+ sig { returns(T.nilable(String)) }
33
+ attr_accessor :name
34
+
31
35
  sig do
32
36
  params(
33
37
  plan_id: String,
34
38
  description: T.nilable(String),
35
39
  external_plan_id: T.nilable(String),
36
40
  metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
41
+ name: T.nilable(String),
37
42
  request_options: Orb::RequestOptions::OrHash
38
43
  ).returns(T.attached_class)
39
44
  end
@@ -49,6 +54,8 @@ module Orb
49
54
  # by setting the value to `null`, and the entire metadata mapping can be cleared
50
55
  # by setting `metadata` to `null`.
51
56
  metadata: nil,
57
+ # The name of the plan.
58
+ name: nil,
52
59
  request_options: {}
53
60
  )
54
61
  end
@@ -60,6 +67,7 @@ module Orb
60
67
  description: T.nilable(String),
61
68
  external_plan_id: T.nilable(String),
62
69
  metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
70
+ name: T.nilable(String),
63
71
  request_options: Orb::RequestOptions
64
72
  }
65
73
  )
@@ -34,12 +34,17 @@ module Orb
34
34
  sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
35
35
  attr_accessor :metadata
36
36
 
37
+ # The name of the plan.
38
+ sig { returns(T.nilable(String)) }
39
+ attr_accessor :name
40
+
37
41
  sig do
38
42
  params(
39
43
  other_external_plan_id: String,
40
44
  description: T.nilable(String),
41
45
  external_plan_id: T.nilable(String),
42
46
  metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
47
+ name: T.nilable(String),
43
48
  request_options: Orb::RequestOptions::OrHash
44
49
  ).returns(T.attached_class)
45
50
  end
@@ -55,6 +60,8 @@ module Orb
55
60
  # by setting the value to `null`, and the entire metadata mapping can be cleared
56
61
  # by setting `metadata` to `null`.
57
62
  metadata: nil,
63
+ # The name of the plan.
64
+ name: nil,
58
65
  request_options: {}
59
66
  )
60
67
  end
@@ -66,6 +73,7 @@ module Orb
66
73
  description: T.nilable(String),
67
74
  external_plan_id: T.nilable(String),
68
75
  metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
76
+ name: T.nilable(String),
69
77
  request_options: Orb::RequestOptions
70
78
  }
71
79
  )
@@ -41,10 +41,8 @@ module Orb
41
41
  end
42
42
  attr_writer :properties
43
43
 
44
- # A lightweight subscription representation for webhook payloads.
45
- #
46
- # This avoids the expensive to_subscription_params() call required for full
47
- # serialization.
44
+ # The subscription in a license or grouped cost webhook payload: its status,
45
+ # dates, plan and customer.
48
46
  sig { returns(Orb::SubscriptionAlertDisabledWebhookEvent::Subscription) }
49
47
  attr_reader :subscription
50
48
 
@@ -87,10 +85,8 @@ module Orb
87
85
  # Sent when the system disables an alert on its own, currently for
88
86
  # cardinality-limit enforcement on grouped cost alerts.
89
87
  properties:,
90
- # A lightweight subscription representation for webhook payloads.
91
- #
92
- # This avoids the expensive to_subscription_params() call required for full
93
- # serialization.
88
+ # The subscription in a license or grouped cost webhook payload: its status,
89
+ # dates, plan and customer.
94
90
  subscription:,
95
91
  # The event this payload describes.
96
92
  type:
@@ -1122,10 +1118,8 @@ module Orb
1122
1118
  end
1123
1119
  attr_accessor :status
1124
1120
 
1125
- # A lightweight subscription representation for webhook payloads.
1126
- #
1127
- # This avoids the expensive to_subscription_params() call required for full
1128
- # serialization.
1121
+ # The subscription in a license or grouped cost webhook payload: its status,
1122
+ # dates, plan and customer.
1129
1123
  sig do
1130
1124
  params(
1131
1125
  id: String,
@@ -43,10 +43,8 @@ module Orb
43
43
  end
44
44
  attr_writer :properties
45
45
 
46
- # A lightweight subscription representation for webhook payloads.
47
- #
48
- # This avoids the expensive to_subscription_params() call required for full
49
- # serialization.
46
+ # The subscription in a license or grouped cost webhook payload: its status,
47
+ # dates, plan and customer.
50
48
  sig do
51
49
  returns(Orb::SubscriptionGroupedCostExceededWebhookEvent::Subscription)
52
50
  end
@@ -93,10 +91,8 @@ module Orb
93
91
  # Every group that crossed a threshold for one alert, batched into a single
94
92
  # message.
95
93
  properties:,
96
- # A lightweight subscription representation for webhook payloads.
97
- #
98
- # This avoids the expensive to_subscription_params() call required for full
99
- # serialization.
94
+ # The subscription in a license or grouped cost webhook payload: its status,
95
+ # dates, plan and customer.
100
96
  subscription:,
101
97
  # The event this payload describes.
102
98
  type:
@@ -1149,10 +1145,8 @@ module Orb
1149
1145
  end
1150
1146
  attr_accessor :status
1151
1147
 
1152
- # A lightweight subscription representation for webhook payloads.
1153
- #
1154
- # This avoids the expensive to_subscription_params() call required for full
1155
- # serialization.
1148
+ # The subscription in a license or grouped cost webhook payload: its status,
1149
+ # dates, plan and customer.
1156
1150
  sig do
1157
1151
  params(
1158
1152
  id: String,
@@ -43,10 +43,8 @@ module Orb
43
43
  end
44
44
  attr_writer :properties
45
45
 
46
- # A lightweight subscription representation for webhook payloads.
47
- #
48
- # This avoids the expensive to_subscription_params() call required for full
49
- # serialization.
46
+ # The subscription in a license or grouped cost webhook payload: its status,
47
+ # dates, plan and customer.
50
48
  sig do
51
49
  returns(
52
50
  Orb::SubscriptionInvoicingThresholdExceededWebhookEvent::Subscription
@@ -95,10 +93,8 @@ module Orb
95
93
  # endpoint.
96
94
  payload_style:,
97
95
  properties:,
98
- # A lightweight subscription representation for webhook payloads.
99
- #
100
- # This avoids the expensive to_subscription_params() call required for full
101
- # serialization.
96
+ # The subscription in a license or grouped cost webhook payload: its status,
97
+ # dates, plan and customer.
102
98
  subscription:,
103
99
  # The event this payload describes.
104
100
  type:
@@ -261,10 +257,8 @@ module Orb
261
257
  end
262
258
  attr_accessor :status
263
259
 
264
- # A lightweight subscription representation for webhook payloads.
265
- #
266
- # This avoids the expensive to_subscription_params() call required for full
267
- # serialization.
260
+ # The subscription in a license or grouped cost webhook payload: its status,
261
+ # dates, plan and customer.
268
262
  sig do
269
263
  params(
270
264
  id: String,
@@ -43,10 +43,8 @@ module Orb
43
43
  end
44
44
  attr_writer :properties
45
45
 
46
- # A lightweight subscription representation for webhook payloads.
47
- #
48
- # This avoids the expensive to_subscription_params() call required for full
49
- # serialization.
46
+ # The subscription in a license or grouped cost webhook payload: its status,
47
+ # dates, plan and customer.
50
48
  sig do
51
49
  returns(
52
50
  Orb::SubscriptionLicenseAllocationResetWebhookEvent::Subscription
@@ -96,10 +94,8 @@ module Orb
96
94
  # Fires at the start of a billing period when license allocations are replenished.
97
95
  # Allocations sharing a billing period are batched into one message.
98
96
  properties:,
99
- # A lightweight subscription representation for webhook payloads.
100
- #
101
- # This avoids the expensive to_subscription_params() call required for full
102
- # serialization.
97
+ # The subscription in a license or grouped cost webhook payload: its status,
98
+ # dates, plan and customer.
103
99
  subscription:,
104
100
  # The event this payload describes.
105
101
  type:
@@ -308,10 +304,8 @@ module Orb
308
304
  end
309
305
  attr_accessor :status
310
306
 
311
- # A lightweight subscription representation for webhook payloads.
312
- #
313
- # This avoids the expensive to_subscription_params() call required for full
314
- # serialization.
307
+ # The subscription in a license or grouped cost webhook payload: its status,
308
+ # dates, plan and customer.
315
309
  sig do
316
310
  params(
317
311
  id: String,
@@ -45,10 +45,8 @@ module Orb
45
45
  end
46
46
  attr_writer :properties
47
47
 
48
- # A lightweight subscription representation for webhook payloads.
49
- #
50
- # This avoids the expensive to_subscription_params() call required for full
51
- # serialization.
48
+ # The subscription in a license or grouped cost webhook payload: its status,
49
+ # dates, plan and customer.
52
50
  sig do
53
51
  returns(
54
52
  Orb::SubscriptionLicenseBalanceThresholdReachedWebhookEvent::Subscription
@@ -98,10 +96,8 @@ module Orb
98
96
  # Every license that crossed a threshold for one alert, batched into a single
99
97
  # message. For account-wide alerts the licenses may span several license types.
100
98
  properties:,
101
- # A lightweight subscription representation for webhook payloads.
102
- #
103
- # This avoids the expensive to_subscription_params() call required for full
104
- # serialization.
99
+ # The subscription in a license or grouped cost webhook payload: its status,
100
+ # dates, plan and customer.
105
101
  subscription:,
106
102
  # The event this payload describes.
107
103
  type:
@@ -1152,10 +1148,8 @@ module Orb
1152
1148
  end
1153
1149
  attr_accessor :status
1154
1150
 
1155
- # A lightweight subscription representation for webhook payloads.
1156
- #
1157
- # This avoids the expensive to_subscription_params() call required for full
1158
- # serialization.
1151
+ # The subscription in a license or grouped cost webhook payload: its status,
1152
+ # dates, plan and customer.
1159
1153
  sig do
1160
1154
  params(
1161
1155
  id: String,
@@ -23,6 +23,13 @@ module Orb
23
23
  sig { returns(T.nilable(T::Array[String])) }
24
24
  attr_accessor :enabled_event_types
25
25
 
26
+ # The payload style of the webhook events sent to this endpoint. `standard`
27
+ # payloads include each object's own fields and references to related objects,
28
+ # without invoice line items or subscription price intervals. `expanded` payloads
29
+ # include every object fully expanded.
30
+ sig { returns(Orb::WebhookEndpoint::PayloadStyle::TaggedSymbol) }
31
+ attr_accessor :payload_style
32
+
26
33
  # The HTTPS URL that Orb sends webhook events to.
27
34
  sig { returns(String) }
28
35
  attr_accessor :url
@@ -35,6 +42,7 @@ module Orb
35
42
  created_at: Time,
36
43
  enabled: T::Boolean,
37
44
  enabled_event_types: T.nilable(T::Array[String]),
45
+ payload_style: Orb::WebhookEndpoint::PayloadStyle::OrSymbol,
38
46
  url: String
39
47
  ).returns(T.attached_class)
40
48
  end
@@ -48,6 +56,11 @@ module Orb
48
56
  # The webhook event types sent to this endpoint. If null, all event types are
49
57
  # sent.
50
58
  enabled_event_types:,
59
+ # The payload style of the webhook events sent to this endpoint. `standard`
60
+ # payloads include each object's own fields and references to related objects,
61
+ # without invoice line items or subscription price intervals. `expanded` payloads
62
+ # include every object fully expanded.
63
+ payload_style:,
51
64
  # The HTTPS URL that Orb sends webhook events to.
52
65
  url:
53
66
  )
@@ -60,12 +73,38 @@ module Orb
60
73
  created_at: Time,
61
74
  enabled: T::Boolean,
62
75
  enabled_event_types: T.nilable(T::Array[String]),
76
+ payload_style: Orb::WebhookEndpoint::PayloadStyle::TaggedSymbol,
63
77
  url: String
64
78
  }
65
79
  )
66
80
  end
67
81
  def to_hash
68
82
  end
83
+
84
+ # The payload style of the webhook events sent to this endpoint. `standard`
85
+ # payloads include each object's own fields and references to related objects,
86
+ # without invoice line items or subscription price intervals. `expanded` payloads
87
+ # include every object fully expanded.
88
+ module PayloadStyle
89
+ extend Orb::Internal::Type::Enum
90
+
91
+ TaggedSymbol =
92
+ T.type_alias { T.all(Symbol, Orb::WebhookEndpoint::PayloadStyle) }
93
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
94
+
95
+ EXPANDED =
96
+ T.let(:expanded, Orb::WebhookEndpoint::PayloadStyle::TaggedSymbol)
97
+ STANDARD =
98
+ T.let(:standard, Orb::WebhookEndpoint::PayloadStyle::TaggedSymbol)
99
+
100
+ sig do
101
+ override.returns(
102
+ T::Array[Orb::WebhookEndpoint::PayloadStyle::TaggedSymbol]
103
+ )
104
+ end
105
+ def self.values
106
+ end
107
+ end
69
108
  end
70
109
  end
71
110
  end
@@ -20,10 +20,21 @@ module Orb
20
20
  sig { returns(T.nilable(T::Array[String])) }
21
21
  attr_accessor :enabled_event_types
22
22
 
23
+ # The payload style of the webhook events sent to this endpoint. If omitted or
24
+ # null, the account's default style is used.
25
+ sig do
26
+ returns(
27
+ T.nilable(Orb::WebhookEndpointCreateParams::PayloadStyle::OrSymbol)
28
+ )
29
+ end
30
+ attr_accessor :payload_style
31
+
23
32
  sig do
24
33
  params(
25
34
  url: String,
26
35
  enabled_event_types: T.nilable(T::Array[String]),
36
+ payload_style:
37
+ T.nilable(Orb::WebhookEndpointCreateParams::PayloadStyle::OrSymbol),
27
38
  request_options: Orb::RequestOptions::OrHash
28
39
  ).returns(T.attached_class)
29
40
  end
@@ -33,6 +44,9 @@ module Orb
33
44
  # The webhook event types to send to this endpoint. If omitted or null, all event
34
45
  # types are sent.
35
46
  enabled_event_types: nil,
47
+ # The payload style of the webhook events sent to this endpoint. If omitted or
48
+ # null, the account's default style is used.
49
+ payload_style: nil,
36
50
  request_options: {}
37
51
  )
38
52
  end
@@ -42,12 +56,49 @@ module Orb
42
56
  {
43
57
  url: String,
44
58
  enabled_event_types: T.nilable(T::Array[String]),
59
+ payload_style:
60
+ T.nilable(
61
+ Orb::WebhookEndpointCreateParams::PayloadStyle::OrSymbol
62
+ ),
45
63
  request_options: Orb::RequestOptions
46
64
  }
47
65
  )
48
66
  end
49
67
  def to_hash
50
68
  end
69
+
70
+ # The payload style of the webhook events sent to this endpoint. If omitted or
71
+ # null, the account's default style is used.
72
+ module PayloadStyle
73
+ extend Orb::Internal::Type::Enum
74
+
75
+ TaggedSymbol =
76
+ T.type_alias do
77
+ T.all(Symbol, Orb::WebhookEndpointCreateParams::PayloadStyle)
78
+ end
79
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
80
+
81
+ EXPANDED =
82
+ T.let(
83
+ :expanded,
84
+ Orb::WebhookEndpointCreateParams::PayloadStyle::TaggedSymbol
85
+ )
86
+ STANDARD =
87
+ T.let(
88
+ :standard,
89
+ Orb::WebhookEndpointCreateParams::PayloadStyle::TaggedSymbol
90
+ )
91
+
92
+ sig do
93
+ override.returns(
94
+ T::Array[
95
+ Orb::WebhookEndpointCreateParams::PayloadStyle::TaggedSymbol
96
+ ]
97
+ )
98
+ end
99
+ def self.values
100
+ end
101
+ end
51
102
  end
52
103
  end
53
104
  end