orb-billing 1.51.0 → 1.53.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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +1 -1
  4. data/lib/orb/models/billable_metric_edited_webhook_event.rb +33 -1
  5. data/lib/orb/models/credit_block_accounting_sync_failed_webhook_event.rb +7 -1
  6. data/lib/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rb +7 -1
  7. data/lib/orb/models/credit_block_list_invoices_response.rb +7 -1
  8. data/lib/orb/models/credit_block_retrieve_response.rb +7 -1
  9. data/lib/orb/models/credit_block_update_response.rb +7 -1
  10. data/lib/orb/models/customer_credit_ledger_incremented_webhook_event.rb +7 -1
  11. data/lib/orb/models/metric_create_params.rb +24 -1
  12. data/lib/orb/models/metric_list_params.rb +1 -1
  13. data/lib/orb/models/metric_publish_params.rb +20 -0
  14. data/lib/orb/models/metric_update_params.rb +20 -1
  15. data/lib/orb/models/plan.rb +9 -1
  16. data/lib/orb/models/plan_version_phase.rb +9 -1
  17. data/lib/orb/models/webhooks/billable_metric_edited_standard_webhook_event.rb +35 -1
  18. data/lib/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rb +7 -1
  19. data/lib/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rb +7 -1
  20. data/lib/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rb +7 -1
  21. data/lib/orb/models.rb +2 -0
  22. data/lib/orb/resources/credit_blocks.rb +2 -1
  23. data/lib/orb/resources/metrics.rb +34 -2
  24. data/lib/orb/version.rb +1 -1
  25. data/lib/orb.rb +1 -0
  26. data/rbi/orb/models/billable_metric_edited_webhook_event.rbi +76 -3
  27. data/rbi/orb/models/credit_block_accounting_sync_failed_webhook_event.rbi +11 -0
  28. data/rbi/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbi +11 -0
  29. data/rbi/orb/models/credit_block_list_invoices_response.rbi +11 -0
  30. data/rbi/orb/models/credit_block_retrieve_response.rbi +11 -0
  31. data/rbi/orb/models/credit_block_update_response.rbi +11 -0
  32. data/rbi/orb/models/customer_credit_ledger_incremented_webhook_event.rbi +11 -0
  33. data/rbi/orb/models/metric_create_params.rbi +37 -0
  34. data/rbi/orb/models/metric_list_params.rbi +1 -1
  35. data/rbi/orb/models/metric_publish_params.rbi +33 -0
  36. data/rbi/orb/models/metric_update_params.rbi +22 -0
  37. data/rbi/orb/models/plan.rbi +11 -3
  38. data/rbi/orb/models/plan_version_phase.rbi +11 -3
  39. data/rbi/orb/models/webhooks/billable_metric_edited_standard_webhook_event.rbi +76 -3
  40. data/rbi/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rbi +11 -0
  41. data/rbi/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rbi +11 -0
  42. data/rbi/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rbi +11 -0
  43. data/rbi/orb/models.rbi +2 -0
  44. data/rbi/orb/resources/credit_blocks.rbi +2 -1
  45. data/rbi/orb/resources/metrics.rbi +31 -0
  46. data/sig/orb/models/billable_metric_edited_webhook_event.rbs +30 -3
  47. data/sig/orb/models/credit_block_accounting_sync_failed_webhook_event.rbs +2 -1
  48. data/sig/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbs +2 -1
  49. data/sig/orb/models/credit_block_list_invoices_response.rbs +2 -1
  50. data/sig/orb/models/credit_block_retrieve_response.rbs +2 -1
  51. data/sig/orb/models/credit_block_update_response.rbs +2 -1
  52. data/sig/orb/models/customer_credit_ledger_incremented_webhook_event.rbs +2 -1
  53. data/sig/orb/models/metric_create_params.rbs +21 -1
  54. data/sig/orb/models/metric_list_params.rbs +2 -2
  55. data/sig/orb/models/metric_publish_params.rbs +23 -0
  56. data/sig/orb/models/metric_update_params.rbs +11 -1
  57. data/sig/orb/models/plan.rbs +8 -3
  58. data/sig/orb/models/plan_version_phase.rbs +8 -3
  59. data/sig/orb/models/webhooks/billable_metric_edited_standard_webhook_event.rbs +30 -3
  60. data/sig/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rbs +2 -1
  61. data/sig/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rbs +2 -1
  62. data/sig/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rbs +2 -1
  63. data/sig/orb/models.rbs +2 -0
  64. data/sig/orb/resources/metrics.rbs +8 -0
  65. metadata +4 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b13531cc7174792da0403fb24d8daaec0a7f4c506a99ea8f0fff3cb812f8ffd7
4
- data.tar.gz: 392550e5d20269c44a509ddfd642ee9645bd2c8d71821d53b62d2f8aee0ee2c9
3
+ metadata.gz: 950351e40d31694b639bee789b3022557b0fa8727303e1ca35abfea9cad93466
4
+ data.tar.gz: 8a6fd092876c79778cbf3d87a7304670dbee7cf1d36cb980eda50c5bb5abc3f9
5
5
  SHA512:
6
- metadata.gz: 2b37f4211ac72f771577ef9ee4a58c6887f1a6d51595bfdc1638c70ab9d7db65041f965f65bd3fd25127079265b0c2c866c82916634b0cedb466def823c5f712
7
- data.tar.gz: d9ff1ad381affb5d9cba1f8c96d253bc3318760f310e55e721755ec2b61e4b2d1144006889f27d2d66cfac234bc82b51667b53e79492171b7f8e599040c74e8b
6
+ metadata.gz: c798e20fbe78d5f96793f78b9bf7a2d09dd739a709f27a7e0c0e0d630bae3fe782c2be620744dc679e3ddae10ef4430de3a7a9b4a9fd13fece43867138c09a66
7
+ data.tar.gz: b10175d96eeb55c4748c24dce2b2e8c3f4e80a1391099bbe23df496aca4b49cf980c6947f618acc0329f1e2816afca300c7c1f294105e5bcf5c25815a9ddaba6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.53.0](https://github.com/orbcorp/orb-ruby/compare/v1.52.0...v1.53.0) (2026-11-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** add price_ids to plan phases in plan responses ([31c53a7](https://github.com/orbcorp/orb-ruby/commit/31c53a746d3a58bf1c5e2af1a17e0ec609d2632b))
9
+ * **api:** support draft billable metrics with SQL/item edits and publish ([d101f75](https://github.com/orbcorp/orb-ruby/commit/d101f751084628d14727d0be016bec21f21b4853))
10
+
11
+ ## [1.52.0](https://github.com/orbcorp/orb-ruby/compare/v1.51.0...v1.52.0) (2026-10-31)
12
+
13
+
14
+ ### Features
15
+
16
+ * **api:** add void status for deleted credit blocks in CreditBlock schema ([7769947](https://github.com/orbcorp/orb-ruby/commit/7769947b098add28640d65c7600d7939660b3a46))
17
+
3
18
  ## [1.51.0](https://github.com/orbcorp/orb-ruby/compare/v1.50.0...v1.51.0) (2026-10-30)
4
19
 
5
20
 
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "orb-billing", "~> 1.51.0"
18
+ gem "orb-billing", "~> 1.53.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -92,6 +92,11 @@ module Orb
92
92
  # @return [String, nil]
93
93
  optional :description, String, nil?: true
94
94
 
95
+ # @!attribute item_id
96
+ #
97
+ # @return [String, nil]
98
+ optional :item_id, String, nil?: true
99
+
95
100
  # @!attribute metadata
96
101
  #
97
102
  # @return [Hash{Symbol=>String}, nil]
@@ -102,12 +107,39 @@ module Orb
102
107
  # @return [String, nil]
103
108
  optional :name, String, nil?: true
104
109
 
105
- # @!method initialize(description: nil, metadata: nil, name: nil)
110
+ # @!attribute sql
111
+ #
112
+ # @return [String, nil]
113
+ optional :sql, String, nil?: true
114
+
115
+ # @!attribute status
116
+ #
117
+ # @return [Symbol, Orb::Models::BillableMetricEditedWebhookEvent::Properties::PreviousAttributes::Status, nil]
118
+ optional :status,
119
+ enum: -> { Orb::BillableMetricEditedWebhookEvent::Properties::PreviousAttributes::Status },
120
+ nil?: true
121
+
122
+ # @!method initialize(description: nil, item_id: nil, metadata: nil, name: nil, sql: nil, status: nil)
106
123
  # metadata values are non-null on the wire, as on the price event.
107
124
  #
108
125
  # @param description [String, nil]
126
+ # @param item_id [String, nil]
109
127
  # @param metadata [Hash{Symbol=>String}, nil]
110
128
  # @param name [String, nil]
129
+ # @param sql [String, nil]
130
+ # @param status [Symbol, Orb::Models::BillableMetricEditedWebhookEvent::Properties::PreviousAttributes::Status, nil]
131
+
132
+ # @see Orb::Models::BillableMetricEditedWebhookEvent::Properties::PreviousAttributes#status
133
+ module Status
134
+ extend Orb::Internal::Type::Enum
135
+
136
+ ACTIVE = :active
137
+ ARCHIVED = :archived
138
+ DRAFT = :draft
139
+
140
+ # @!method self.values
141
+ # @return [Array<Symbol>]
142
+ end
111
143
  end
112
144
  end
113
145
 
@@ -201,6 +201,8 @@ module Orb
201
201
  required :per_unit_cost_basis, String, nil?: true
202
202
 
203
203
  # @!attribute status
204
+ # `void` means the credit block was deleted. A voided block's `balance` is
205
+ # always 0.
204
206
  #
205
207
  # @return [Symbol, Orb::Models::CreditBlockAccountingSyncFailedWebhookEvent::Block::Status]
206
208
  required :status, enum: -> { Orb::CreditBlockAccountingSyncFailedWebhookEvent::Block::Status }
@@ -248,7 +250,7 @@ module Orb
248
250
  #
249
251
  # @param per_unit_cost_basis [String, nil]
250
252
  #
251
- # @param status [Symbol, Orb::Models::CreditBlockAccountingSyncFailedWebhookEvent::Block::Status]
253
+ # @param status [Symbol, Orb::Models::CreditBlockAccountingSyncFailedWebhookEvent::Block::Status] `void` means the credit block was deleted. A voided block's `balance` is always
252
254
  #
253
255
  # @param credit_allocation [Orb::Models::CreditBlockAccountingSyncFailedWebhookEvent::Block::CreditAllocation, nil] The credit allocation that funded a block. Extends the allocation resource
254
256
  #
@@ -329,12 +331,16 @@ module Orb
329
331
  end
330
332
  end
331
333
 
334
+ # `void` means the credit block was deleted. A voided block's `balance` is
335
+ # always 0.
336
+ #
332
337
  # @see Orb::Models::CreditBlockAccountingSyncFailedWebhookEvent::Block#status
333
338
  module Status
334
339
  extend Orb::Internal::Type::Enum
335
340
 
336
341
  ACTIVE = :active
337
342
  PENDING_PAYMENT = :pending_payment
343
+ VOID = :void
338
344
 
339
345
  # @!method self.values
340
346
  # @return [Array<Symbol>]
@@ -201,6 +201,8 @@ module Orb
201
201
  required :per_unit_cost_basis, String, nil?: true
202
202
 
203
203
  # @!attribute status
204
+ # `void` means the credit block was deleted. A voided block's `balance` is
205
+ # always 0.
204
206
  #
205
207
  # @return [Symbol, Orb::Models::CreditBlockAccountingSyncSucceededWebhookEvent::Block::Status]
206
208
  required :status, enum: -> { Orb::CreditBlockAccountingSyncSucceededWebhookEvent::Block::Status }
@@ -248,7 +250,7 @@ module Orb
248
250
  #
249
251
  # @param per_unit_cost_basis [String, nil]
250
252
  #
251
- # @param status [Symbol, Orb::Models::CreditBlockAccountingSyncSucceededWebhookEvent::Block::Status]
253
+ # @param status [Symbol, Orb::Models::CreditBlockAccountingSyncSucceededWebhookEvent::Block::Status] `void` means the credit block was deleted. A voided block's `balance` is always
252
254
  #
253
255
  # @param credit_allocation [Orb::Models::CreditBlockAccountingSyncSucceededWebhookEvent::Block::CreditAllocation, nil] The credit allocation that funded a block. Extends the allocation resource
254
256
  #
@@ -330,12 +332,16 @@ module Orb
330
332
  end
331
333
  end
332
334
 
335
+ # `void` means the credit block was deleted. A voided block's `balance` is
336
+ # always 0.
337
+ #
333
338
  # @see Orb::Models::CreditBlockAccountingSyncSucceededWebhookEvent::Block#status
334
339
  module Status
335
340
  extend Orb::Internal::Type::Enum
336
341
 
337
342
  ACTIVE = :active
338
343
  PENDING_PAYMENT = :pending_payment
344
+ VOID = :void
339
345
 
340
346
  # @!method self.values
341
347
  # @return [Array<Symbol>]
@@ -80,6 +80,8 @@ module Orb
80
80
  required :per_unit_cost_basis, String, nil?: true
81
81
 
82
82
  # @!attribute status
83
+ # `void` means the credit block was deleted. A voided block's `balance` is
84
+ # always 0.
83
85
  #
84
86
  # @return [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::Status]
85
87
  required :status, enum: -> { Orb::Models::CreditBlockListInvoicesResponse::Block::Status }
@@ -126,7 +128,7 @@ module Orb
126
128
  #
127
129
  # @param per_unit_cost_basis [String, nil]
128
130
  #
129
- # @param status [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::Status]
131
+ # @param status [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::Status] `void` means the credit block was deleted. A voided block's `balance` is always
130
132
  #
131
133
  # @param credit_allocation [Orb::Models::CreditBlockListInvoicesResponse::Block::CreditAllocation, nil] The credit allocation that funded a block. Extends the allocation resource
132
134
  #
@@ -207,12 +209,16 @@ module Orb
207
209
  end
208
210
  end
209
211
 
212
+ # `void` means the credit block was deleted. A voided block's `balance` is
213
+ # always 0.
214
+ #
210
215
  # @see Orb::Models::CreditBlockListInvoicesResponse::Block#status
211
216
  module Status
212
217
  extend Orb::Internal::Type::Enum
213
218
 
214
219
  ACTIVE = :active
215
220
  PENDING_PAYMENT = :pending_payment
221
+ VOID = :void
216
222
 
217
223
  # @!method self.values
218
224
  # @return [Array<Symbol>]
@@ -59,6 +59,8 @@ module Orb
59
59
  required :per_unit_cost_basis, String, nil?: true
60
60
 
61
61
  # @!attribute status
62
+ # `void` means the credit block was deleted. A voided block's `balance` is
63
+ # always 0.
62
64
  #
63
65
  # @return [Symbol, Orb::Models::CreditBlockRetrieveResponse::Status]
64
66
  required :status, enum: -> { Orb::Models::CreditBlockRetrieveResponse::Status }
@@ -101,7 +103,7 @@ module Orb
101
103
  #
102
104
  # @param per_unit_cost_basis [String, nil]
103
105
  #
104
- # @param status [Symbol, Orb::Models::CreditBlockRetrieveResponse::Status]
106
+ # @param status [Symbol, Orb::Models::CreditBlockRetrieveResponse::Status] `void` means the credit block was deleted. A voided block's `balance` is always
105
107
  #
106
108
  # @param credit_allocation [Orb::Models::CreditBlockRetrieveResponse::CreditAllocation, nil] The credit allocation that funded a block. Extends the allocation resource
107
109
  #
@@ -182,12 +184,16 @@ module Orb
182
184
  end
183
185
  end
184
186
 
187
+ # `void` means the credit block was deleted. A voided block's `balance` is
188
+ # always 0.
189
+ #
185
190
  # @see Orb::Models::CreditBlockRetrieveResponse#status
186
191
  module Status
187
192
  extend Orb::Internal::Type::Enum
188
193
 
189
194
  ACTIVE = :active
190
195
  PENDING_PAYMENT = :pending_payment
196
+ VOID = :void
191
197
 
192
198
  # @!method self.values
193
199
  # @return [Array<Symbol>]
@@ -59,6 +59,8 @@ module Orb
59
59
  required :per_unit_cost_basis, String, nil?: true
60
60
 
61
61
  # @!attribute status
62
+ # `void` means the credit block was deleted. A voided block's `balance` is
63
+ # always 0.
62
64
  #
63
65
  # @return [Symbol, Orb::Models::CreditBlockUpdateResponse::Status]
64
66
  required :status, enum: -> { Orb::Models::CreditBlockUpdateResponse::Status }
@@ -101,7 +103,7 @@ module Orb
101
103
  #
102
104
  # @param per_unit_cost_basis [String, nil]
103
105
  #
104
- # @param status [Symbol, Orb::Models::CreditBlockUpdateResponse::Status]
106
+ # @param status [Symbol, Orb::Models::CreditBlockUpdateResponse::Status] `void` means the credit block was deleted. A voided block's `balance` is always
105
107
  #
106
108
  # @param credit_allocation [Orb::Models::CreditBlockUpdateResponse::CreditAllocation, nil] The credit allocation that funded a block. Extends the allocation resource
107
109
  #
@@ -182,12 +184,16 @@ module Orb
182
184
  end
183
185
  end
184
186
 
187
+ # `void` means the credit block was deleted. A voided block's `balance` is
188
+ # always 0.
189
+ #
185
190
  # @see Orb::Models::CreditBlockUpdateResponse#status
186
191
  module Status
187
192
  extend Orb::Internal::Type::Enum
188
193
 
189
194
  ACTIVE = :active
190
195
  PENDING_PAYMENT = :pending_payment
196
+ VOID = :void
191
197
 
192
198
  # @!method self.values
193
199
  # @return [Array<Symbol>]
@@ -166,6 +166,8 @@ module Orb
166
166
  required :per_unit_cost_basis, String, nil?: true
167
167
 
168
168
  # @!attribute status
169
+ # `void` means the credit block was deleted. A voided block's `balance` is
170
+ # always 0.
169
171
  #
170
172
  # @return [Symbol, Orb::Models::CustomerCreditLedgerIncrementedWebhookEvent::Properties::Block::Status]
171
173
  required :status, enum: -> { Orb::CustomerCreditLedgerIncrementedWebhookEvent::Properties::Block::Status }
@@ -217,7 +219,7 @@ module Orb
217
219
  #
218
220
  # @param per_unit_cost_basis [String, nil]
219
221
  #
220
- # @param status [Symbol, Orb::Models::CustomerCreditLedgerIncrementedWebhookEvent::Properties::Block::Status]
222
+ # @param status [Symbol, Orb::Models::CustomerCreditLedgerIncrementedWebhookEvent::Properties::Block::Status] `void` means the credit block was deleted. A voided block's `balance` is always
221
223
  #
222
224
  # @param credit_allocation [Orb::Models::CustomerCreditLedgerIncrementedWebhookEvent::Properties::Block::CreditAllocation, nil] The credit allocation that funded a block. Extends the allocation resource
223
225
  #
@@ -300,12 +302,16 @@ module Orb
300
302
  end
301
303
  end
302
304
 
305
+ # `void` means the credit block was deleted. A voided block's `balance` is
306
+ # always 0.
307
+ #
303
308
  # @see Orb::Models::CustomerCreditLedgerIncrementedWebhookEvent::Properties::Block#status
304
309
  module Status
305
310
  extend Orb::Internal::Type::Enum
306
311
 
307
312
  ACTIVE = :active
308
313
  PENDING_PAYMENT = :pending_payment
314
+ VOID = :void
309
315
 
310
316
  # @!method self.values
311
317
  # @return [Array<Symbol>]
@@ -39,7 +39,15 @@ module Orb
39
39
  # @return [Hash{Symbol=>String, nil}, nil]
40
40
  optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true
41
41
 
42
- # @!method initialize(description:, item_id:, name:, sql:, metadata: nil, request_options: {})
42
+ # @!attribute status
43
+ # The status of the metric to create (either active or draft). If not specified,
44
+ # this defaults to active. A draft metric's `sql` and `item_id` can be changed
45
+ # until it's published.
46
+ #
47
+ # @return [Symbol, Orb::Models::MetricCreateParams::Status, nil]
48
+ optional :status, enum: -> { Orb::MetricCreateParams::Status }
49
+
50
+ # @!method initialize(description:, item_id:, name:, sql:, metadata: nil, status: nil, request_options: {})
43
51
  # Some parameter documentations has been truncated, see
44
52
  # {Orb::Models::MetricCreateParams} for more details.
45
53
  #
@@ -53,7 +61,22 @@ module Orb
53
61
  #
54
62
  # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
55
63
  #
64
+ # @param status [Symbol, Orb::Models::MetricCreateParams::Status] The status of the metric to create (either active or draft). If not specified, t
65
+ #
56
66
  # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
67
+
68
+ # The status of the metric to create (either active or draft). If not specified,
69
+ # this defaults to active. A draft metric's `sql` and `item_id` can be changed
70
+ # until it's published.
71
+ module Status
72
+ extend Orb::Internal::Type::Enum
73
+
74
+ ACTIVE = :active
75
+ DRAFT = :draft
76
+
77
+ # @!method self.values
78
+ # @return [Array<Symbol>]
79
+ end
57
80
  end
58
81
  end
59
82
  end
@@ -71,8 +71,8 @@ module Orb
71
71
  extend Orb::Internal::Type::Enum
72
72
 
73
73
  ACTIVE = :active
74
- ARCHIVED = :archived
75
74
  DRAFT = :draft
75
+ ARCHIVED = :archived
76
76
 
77
77
  # @!method self.values
78
78
  # @return [Array<Symbol>]
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Metrics#publish
6
+ class MetricPublishParams < Orb::Internal::Type::BaseModel
7
+ extend Orb::Internal::Type::RequestParameters::Converter
8
+ include Orb::Internal::Type::RequestParameters
9
+
10
+ # @!attribute metric_id
11
+ #
12
+ # @return [String]
13
+ required :metric_id, String
14
+
15
+ # @!method initialize(metric_id:, request_options: {})
16
+ # @param metric_id [String]
17
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -18,6 +18,13 @@ module Orb
18
18
  # @return [String, nil]
19
19
  optional :description, String, nil?: true
20
20
 
21
+ # @!attribute item_id
22
+ # The id of the item to associate the metric with. Can only be changed while the
23
+ # metric is in `draft` status.
24
+ #
25
+ # @return [String, nil]
26
+ optional :item_id, String, nil?: true
27
+
21
28
  # @!attribute metadata
22
29
  # User-specified key/value pairs for the resource. Individual keys can be removed
23
30
  # by setting the value to `null`, and the entire metadata mapping can be cleared
@@ -32,7 +39,15 @@ module Orb
32
39
  # @return [String, nil]
33
40
  optional :name, String, nil?: true
34
41
 
35
- # @!method initialize(metric_id:, description: nil, metadata: nil, name: nil, request_options: {})
42
+ # @!attribute sql
43
+ # A new sql string defining the metric. Can only be changed while the metric is in
44
+ # `draft` status and no price uses it. If the metric has parameters, the new sql
45
+ # must use the same ones.
46
+ #
47
+ # @return [String, nil]
48
+ optional :sql, String, nil?: true
49
+
50
+ # @!method initialize(metric_id:, description: nil, item_id: nil, metadata: nil, name: nil, sql: nil, request_options: {})
36
51
  # Some parameter documentations has been truncated, see
37
52
  # {Orb::Models::MetricUpdateParams} for more details.
38
53
  #
@@ -40,10 +55,14 @@ module Orb
40
55
  #
41
56
  # @param description [String, nil] A description of the metric.
42
57
  #
58
+ # @param item_id [String, nil] The id of the item to associate the metric with. Can only be changed while the m
59
+ #
43
60
  # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
44
61
  #
45
62
  # @param name [String, nil] The name of the metric.
46
63
  #
64
+ # @param sql [String, nil] A new sql string defining the metric. Can only be changed while the metric is in
65
+ #
47
66
  # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
48
67
  end
49
68
  end
@@ -512,7 +512,13 @@ module Orb
512
512
  # @return [Integer]
513
513
  required :order, Integer
514
514
 
515
- # @!method initialize(id:, description:, discount:, duration:, duration_unit:, maximum:, maximum_amount:, minimum:, minimum_amount:, name:, order:)
515
+ # @!attribute price_ids
516
+ # The IDs of the prices active in this phase.
517
+ #
518
+ # @return [Array<String>]
519
+ required :price_ids, Orb::Internal::Type::ArrayOf[String]
520
+
521
+ # @!method initialize(id:, description:, discount:, duration:, duration_unit:, maximum:, maximum_amount:, minimum:, minimum_amount:, name:, order:, price_ids:)
516
522
  # Some parameter documentations has been truncated, see
517
523
  # {Orb::Models::Plan::PlanPhase} for more details.
518
524
  #
@@ -537,6 +543,8 @@ module Orb
537
543
  # @param name [String]
538
544
  #
539
545
  # @param order [Integer] Determines the ordering of the phase in a plan's lifecycle. 1 = first phase.
546
+ #
547
+ # @param price_ids [Array<String>] The IDs of the prices active in this phase.
540
548
 
541
549
  # @see Orb::Models::Plan::PlanPhase#duration_unit
542
550
  module DurationUnit
@@ -36,7 +36,13 @@ module Orb
36
36
  # @return [Integer]
37
37
  required :order, Integer
38
38
 
39
- # @!method initialize(id:, description:, duration:, duration_unit:, name:, order:)
39
+ # @!attribute price_ids
40
+ # The IDs of the prices active in this phase.
41
+ #
42
+ # @return [Array<String>]
43
+ required :price_ids, Orb::Internal::Type::ArrayOf[String]
44
+
45
+ # @!method initialize(id:, description:, duration:, duration_unit:, name:, order:, price_ids:)
40
46
  # Some parameter documentations has been truncated, see
41
47
  # {Orb::Models::PlanVersionPhase} for more details.
42
48
  #
@@ -51,6 +57,8 @@ module Orb
51
57
  # @param name [String]
52
58
  #
53
59
  # @param order [Integer] Determines the ordering of the phase in a plan's lifecycle. 1 = first phase.
60
+ #
61
+ # @param price_ids [Array<String>] The IDs of the prices active in this phase.
54
62
 
55
63
  # @see Orb::Models::PlanVersionPhase#duration_unit
56
64
  module DurationUnit
@@ -95,6 +95,11 @@ module Orb
95
95
  # @return [String, nil]
96
96
  optional :description, String, nil?: true
97
97
 
98
+ # @!attribute item_id
99
+ #
100
+ # @return [String, nil]
101
+ optional :item_id, String, nil?: true
102
+
98
103
  # @!attribute metadata
99
104
  #
100
105
  # @return [Hash{Symbol=>String}, nil]
@@ -105,12 +110,41 @@ module Orb
105
110
  # @return [String, nil]
106
111
  optional :name, String, nil?: true
107
112
 
108
- # @!method initialize(description: nil, metadata: nil, name: nil)
113
+ # @!attribute sql
114
+ #
115
+ # @return [String, nil]
116
+ optional :sql, String, nil?: true
117
+
118
+ # @!attribute status
119
+ #
120
+ # @return [Symbol, Orb::Models::Webhooks::BillableMetricEditedStandardWebhookEvent::Properties::PreviousAttributes::Status, nil]
121
+ optional :status,
122
+ enum: -> {
123
+ Orb::Webhooks::BillableMetricEditedStandardWebhookEvent::Properties::PreviousAttributes::Status
124
+ },
125
+ nil?: true
126
+
127
+ # @!method initialize(description: nil, item_id: nil, metadata: nil, name: nil, sql: nil, status: nil)
109
128
  # metadata values are non-null on the wire, as on the price event.
110
129
  #
111
130
  # @param description [String, nil]
131
+ # @param item_id [String, nil]
112
132
  # @param metadata [Hash{Symbol=>String}, nil]
113
133
  # @param name [String, nil]
134
+ # @param sql [String, nil]
135
+ # @param status [Symbol, Orb::Models::Webhooks::BillableMetricEditedStandardWebhookEvent::Properties::PreviousAttributes::Status, nil]
136
+
137
+ # @see Orb::Models::Webhooks::BillableMetricEditedStandardWebhookEvent::Properties::PreviousAttributes#status
138
+ module Status
139
+ extend Orb::Internal::Type::Enum
140
+
141
+ ACTIVE = :active
142
+ ARCHIVED = :archived
143
+ DRAFT = :draft
144
+
145
+ # @!method self.values
146
+ # @return [Array<Symbol>]
147
+ end
114
148
  end
115
149
  end
116
150
 
@@ -205,6 +205,8 @@ module Orb
205
205
  required :per_unit_cost_basis, String, nil?: true
206
206
 
207
207
  # @!attribute status
208
+ # `void` means the credit block was deleted. A voided block's `balance` is
209
+ # always 0.
208
210
  #
209
211
  # @return [Symbol, Orb::Models::Webhooks::CreditBlockAccountingSyncFailedStandardWebhookEvent::Block::Status]
210
212
  required :status,
@@ -257,7 +259,7 @@ module Orb
257
259
  #
258
260
  # @param per_unit_cost_basis [String, nil]
259
261
  #
260
- # @param status [Symbol, Orb::Models::Webhooks::CreditBlockAccountingSyncFailedStandardWebhookEvent::Block::Status]
262
+ # @param status [Symbol, Orb::Models::Webhooks::CreditBlockAccountingSyncFailedStandardWebhookEvent::Block::Status] `void` means the credit block was deleted. A voided block's `balance` is always
261
263
  #
262
264
  # @param credit_allocation [Orb::Models::Webhooks::CreditBlockAccountingSyncFailedStandardWebhookEvent::Block::CreditAllocation, nil] The credit allocation that funded a block. Extends the allocation resource
263
265
  #
@@ -340,12 +342,16 @@ module Orb
340
342
  end
341
343
  end
342
344
 
345
+ # `void` means the credit block was deleted. A voided block's `balance` is
346
+ # always 0.
347
+ #
343
348
  # @see Orb::Models::Webhooks::CreditBlockAccountingSyncFailedStandardWebhookEvent::Block#status
344
349
  module Status
345
350
  extend Orb::Internal::Type::Enum
346
351
 
347
352
  ACTIVE = :active
348
353
  PENDING_PAYMENT = :pending_payment
354
+ VOID = :void
349
355
 
350
356
  # @!method self.values
351
357
  # @return [Array<Symbol>]
@@ -205,6 +205,8 @@ module Orb
205
205
  required :per_unit_cost_basis, String, nil?: true
206
206
 
207
207
  # @!attribute status
208
+ # `void` means the credit block was deleted. A voided block's `balance` is
209
+ # always 0.
208
210
  #
209
211
  # @return [Symbol, Orb::Models::Webhooks::CreditBlockAccountingSyncSucceededStandardWebhookEvent::Block::Status]
210
212
  required :status,
@@ -257,7 +259,7 @@ module Orb
257
259
  #
258
260
  # @param per_unit_cost_basis [String, nil]
259
261
  #
260
- # @param status [Symbol, Orb::Models::Webhooks::CreditBlockAccountingSyncSucceededStandardWebhookEvent::Block::Status]
262
+ # @param status [Symbol, Orb::Models::Webhooks::CreditBlockAccountingSyncSucceededStandardWebhookEvent::Block::Status] `void` means the credit block was deleted. A voided block's `balance` is always
261
263
  #
262
264
  # @param credit_allocation [Orb::Models::Webhooks::CreditBlockAccountingSyncSucceededStandardWebhookEvent::Block::CreditAllocation, nil] The credit allocation that funded a block. Extends the allocation resource
263
265
  #
@@ -340,12 +342,16 @@ module Orb
340
342
  end
341
343
  end
342
344
 
345
+ # `void` means the credit block was deleted. A voided block's `balance` is
346
+ # always 0.
347
+ #
343
348
  # @see Orb::Models::Webhooks::CreditBlockAccountingSyncSucceededStandardWebhookEvent::Block#status
344
349
  module Status
345
350
  extend Orb::Internal::Type::Enum
346
351
 
347
352
  ACTIVE = :active
348
353
  PENDING_PAYMENT = :pending_payment
354
+ VOID = :void
349
355
 
350
356
  # @!method self.values
351
357
  # @return [Array<Symbol>]
@@ -172,6 +172,8 @@ module Orb
172
172
  required :per_unit_cost_basis, String, nil?: true
173
173
 
174
174
  # @!attribute status
175
+ # `void` means the credit block was deleted. A voided block's `balance` is
176
+ # always 0.
175
177
  #
176
178
  # @return [Symbol, Orb::Models::Webhooks::CustomerCreditLedgerIncrementedStandardWebhookEvent::Properties::Block::Status]
177
179
  required :status,
@@ -224,7 +226,7 @@ module Orb
224
226
  #
225
227
  # @param per_unit_cost_basis [String, nil]
226
228
  #
227
- # @param status [Symbol, Orb::Models::Webhooks::CustomerCreditLedgerIncrementedStandardWebhookEvent::Properties::Block::Status]
229
+ # @param status [Symbol, Orb::Models::Webhooks::CustomerCreditLedgerIncrementedStandardWebhookEvent::Properties::Block::Status] `void` means the credit block was deleted. A voided block's `balance` is always
228
230
  #
229
231
  # @param credit_allocation [Orb::Models::Webhooks::CustomerCreditLedgerIncrementedStandardWebhookEvent::Properties::Block::CreditAllocation, nil] The credit allocation that funded a block. Extends the allocation resource
230
232
  #
@@ -307,12 +309,16 @@ module Orb
307
309
  end
308
310
  end
309
311
 
312
+ # `void` means the credit block was deleted. A voided block's `balance` is
313
+ # always 0.
314
+ #
310
315
  # @see Orb::Models::Webhooks::CustomerCreditLedgerIncrementedStandardWebhookEvent::Properties::Block#status
311
316
  module Status
312
317
  extend Orb::Internal::Type::Enum
313
318
 
314
319
  ACTIVE = :active
315
320
  PENDING_PAYMENT = :pending_payment
321
+ VOID = :void
316
322
 
317
323
  # @!method self.values
318
324
  # @return [Array<Symbol>]
data/lib/orb/models.rb CHANGED
@@ -403,6 +403,8 @@ module Orb
403
403
 
404
404
  MetricListParams = Orb::Models::MetricListParams
405
405
 
406
+ MetricPublishParams = Orb::Models::MetricPublishParams
407
+
406
408
  MetricUnarchiveParams = Orb::Models::MetricUnarchiveParams
407
409
 
408
410
  MetricUpdateParams = Orb::Models::MetricUpdateParams
@@ -5,7 +5,8 @@ module Orb
5
5
  # The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
6
6
  # credits within Orb.
7
7
  class CreditBlocks
8
- # This endpoint returns a credit block identified by its block_id.
8
+ # This endpoint returns a credit block identified by its block_id. A deleted
9
+ # credit block is returned with a `status` of `void` and a `balance` of 0.
9
10
  #
10
11
  # @overload retrieve(block_id, request_options: {})
11
12
  #