orb-billing 1.47.0 → 1.49.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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  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/metric_archive_params.rb +20 -0
  7. data/lib/orb/models/metric_unarchive_params.rb +20 -0
  8. data/lib/orb/models/subscription_list_summary_params.rb +108 -0
  9. data/lib/orb/models/subscription_list_summary_response.rb +130 -0
  10. data/lib/orb/models/webhooks/subscription_accounting_sync_failed_standard_webhook_event.rb +9 -7
  11. data/lib/orb/models/webhooks/subscription_accounting_sync_succeeded_standard_webhook_event.rb +9 -7
  12. data/lib/orb/models/webhooks/subscription_cancellation_scheduled_standard_webhook_event.rb +9 -7
  13. data/lib/orb/models/webhooks/subscription_cancellation_unscheduled_standard_webhook_event.rb +9 -7
  14. data/lib/orb/models/webhooks/subscription_cost_exceeded_standard_webhook_event.rb +9 -7
  15. data/lib/orb/models/webhooks/subscription_created_standard_webhook_event.rb +9 -7
  16. data/lib/orb/models/webhooks/subscription_edited_standard_webhook_event.rb +9 -7
  17. data/lib/orb/models/webhooks/subscription_ended_standard_webhook_event.rb +9 -7
  18. data/lib/orb/models/webhooks/subscription_fixed_fee_quantity_updated_standard_webhook_event.rb +9 -7
  19. data/lib/orb/models/webhooks/subscription_plan_change_scheduled_standard_webhook_event.rb +9 -7
  20. data/lib/orb/models/webhooks/subscription_plan_changed_standard_webhook_event.rb +9 -7
  21. data/lib/orb/models/webhooks/subscription_plan_version_change_scheduled_standard_webhook_event.rb +9 -7
  22. data/lib/orb/models/webhooks/subscription_plan_version_changed_standard_webhook_event.rb +9 -7
  23. data/lib/orb/models/webhooks/subscription_spend_exceeded_standard_webhook_event.rb +9 -7
  24. data/lib/orb/models/webhooks/subscription_started_standard_webhook_event.rb +9 -7
  25. data/lib/orb/models/webhooks/subscription_trial_ended_standard_webhook_event.rb +9 -7
  26. data/lib/orb/models/webhooks/subscription_usage_exceeded_standard_webhook_event.rb +9 -7
  27. data/lib/orb/models.rb +8 -0
  28. data/lib/orb/resources/alerts.rb +7 -4
  29. data/lib/orb/resources/credit_blocks.rb +35 -0
  30. data/lib/orb/resources/metrics.rb +46 -0
  31. data/lib/orb/resources/subscriptions.rb +60 -0
  32. data/lib/orb/version.rb +1 -1
  33. data/lib/orb.rb +6 -0
  34. data/rbi/orb/models/credit_block_update_params.rbi +53 -0
  35. data/rbi/orb/models/credit_block_update_response.rbi +693 -0
  36. data/rbi/orb/models/metric_archive_params.rbi +33 -0
  37. data/rbi/orb/models/metric_unarchive_params.rbi +35 -0
  38. data/rbi/orb/models/subscription_list_summary_params.rbi +148 -0
  39. data/rbi/orb/models/subscription_list_summary_response.rbi +214 -0
  40. data/rbi/orb/models/webhooks/subscription_accounting_sync_failed_standard_webhook_event.rbi +12 -9
  41. data/rbi/orb/models/webhooks/subscription_accounting_sync_succeeded_standard_webhook_event.rbi +12 -9
  42. data/rbi/orb/models/webhooks/subscription_cancellation_scheduled_standard_webhook_event.rbi +12 -9
  43. data/rbi/orb/models/webhooks/subscription_cancellation_unscheduled_standard_webhook_event.rbi +12 -9
  44. data/rbi/orb/models/webhooks/subscription_cost_exceeded_standard_webhook_event.rbi +12 -9
  45. data/rbi/orb/models/webhooks/subscription_created_standard_webhook_event.rbi +12 -9
  46. data/rbi/orb/models/webhooks/subscription_edited_standard_webhook_event.rbi +12 -9
  47. data/rbi/orb/models/webhooks/subscription_ended_standard_webhook_event.rbi +12 -9
  48. data/rbi/orb/models/webhooks/subscription_fixed_fee_quantity_updated_standard_webhook_event.rbi +12 -9
  49. data/rbi/orb/models/webhooks/subscription_plan_change_scheduled_standard_webhook_event.rbi +12 -9
  50. data/rbi/orb/models/webhooks/subscription_plan_changed_standard_webhook_event.rbi +12 -9
  51. data/rbi/orb/models/webhooks/subscription_plan_version_change_scheduled_standard_webhook_event.rbi +12 -9
  52. data/rbi/orb/models/webhooks/subscription_plan_version_changed_standard_webhook_event.rbi +12 -9
  53. data/rbi/orb/models/webhooks/subscription_spend_exceeded_standard_webhook_event.rbi +12 -9
  54. data/rbi/orb/models/webhooks/subscription_started_standard_webhook_event.rbi +12 -9
  55. data/rbi/orb/models/webhooks/subscription_trial_ended_standard_webhook_event.rbi +12 -9
  56. data/rbi/orb/models/webhooks/subscription_usage_exceeded_standard_webhook_event.rbi +12 -9
  57. data/rbi/orb/models.rbi +8 -0
  58. data/rbi/orb/resources/alerts.rbi +7 -4
  59. data/rbi/orb/resources/credit_blocks.rbi +26 -0
  60. data/rbi/orb/resources/metrics.rbi +28 -0
  61. data/rbi/orb/resources/subscriptions.rbi +47 -0
  62. data/sig/orb/models/credit_block_update_params.rbs +28 -0
  63. data/sig/orb/models/credit_block_update_response.rbs +263 -0
  64. data/sig/orb/models/metric_archive_params.rbs +23 -0
  65. data/sig/orb/models/metric_unarchive_params.rbs +23 -0
  66. data/sig/orb/models/subscription_list_summary_params.rbs +90 -0
  67. data/sig/orb/models/subscription_list_summary_response.rbs +94 -0
  68. data/sig/orb/models.rbs +8 -0
  69. data/sig/orb/resources/credit_blocks.rbs +6 -0
  70. data/sig/orb/resources/metrics.rbs +10 -0
  71. data/sig/orb/resources/subscriptions.rbs +15 -0
  72. metadata +19 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d7c98b26b6434d034ca980f43f02584b1899396f1a4e527aafbcf81d7b47616
4
- data.tar.gz: d92ce8e10c43f62392c762f01ccae79e520badae4a7f66a6fb91f73f3f53010d
3
+ metadata.gz: a9de5e66a507e201cfc16aabb8c3b05315d34c90cc18ea4ddd4ec5af2f20397d
4
+ data.tar.gz: 9ce23da33a1d9052453b788b969f4bd7759cbf336d89bd48737313375870ebce
5
5
  SHA512:
6
- metadata.gz: d40cf89aa5841db9d6c37dddacd5521aca697e8723a8c6f08fe0514ab201bf06e129831ab244d73687ee674add8265286d6c9cdfb347c77b6491c837ffd342c2
7
- data.tar.gz: 608dfcf816e143b4845c999ae90f0e84c7c5cf14157246b0cb61e960be81ceaad1b564a09ccd5ad3cc11d0d3d24b1d77e89010b72f3eedec9ac24d615c99dcc9
6
+ metadata.gz: 56b985ac015716ca1d328c60cc1d5659dd6f5ea69052bc541aa7a6258d0ad5f5ed685b46dd2b2a9e837d4efb8ea709426ca9773113e1205fa34deb4d383b0611
7
+ data.tar.gz: ac6d59ad41d20c3878c9531ff2ff899da372cb44a5ce349eea3bbd8ec01144fd199049c5ed31fd309aa2190ed9acdad252cadf0fbf8c892aa6f6e4c1e1e8cb79
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.49.0](https://github.com/orbcorp/orb-ruby/compare/v1.48.0...v1.49.0) (2026-10-27)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** allow up to 50 spend_exceeded alerts per plan or subscription ([0448a00](https://github.com/orbcorp/orb-ruby/commit/0448a002cbad582b428b77b530b62460e6f96274))
9
+
10
+ ## [1.48.0](https://github.com/orbcorp/orb-ruby/compare/v1.47.0...v1.48.0) (2026-10-24)
11
+
12
+
13
+ ### Features
14
+
15
+ * **api:** add list endpoint for lightweight subscription summaries ([7640020](https://github.com/orbcorp/orb-ruby/commit/7640020cab2a3d03c569781bdb51af3ae504fc91))
16
+
3
17
  ## [1.47.0](https://github.com/orbcorp/orb-ruby/compare/v1.46.0...v1.47.0) (2026-10-23)
4
18
 
5
19
 
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.47.0"
18
+ gem "orb-billing", "~> 1.49.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::CreditBlocks#update
6
+ class CreditBlockUpdateParams < Orb::Internal::Type::BaseModel
7
+ extend Orb::Internal::Type::RequestParameters::Converter
8
+ include Orb::Internal::Type::RequestParameters
9
+
10
+ # @!attribute block_id
11
+ #
12
+ # @return [String]
13
+ required :block_id, String
14
+
15
+ # @!attribute metadata
16
+ # User-specified key/value pairs for the resource. Individual keys can be removed
17
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
18
+ # by setting `metadata` to `null`.
19
+ #
20
+ # @return [Hash{Symbol=>String, nil}, nil]
21
+ optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true
22
+
23
+ # @!method initialize(block_id:, metadata: nil, request_options: {})
24
+ # Some parameter documentations has been truncated, see
25
+ # {Orb::Models::CreditBlockUpdateParams} for more details.
26
+ #
27
+ # @param block_id [String]
28
+ #
29
+ # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
30
+ #
31
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,332 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::CreditBlocks#update
6
+ class CreditBlockUpdateResponse < Orb::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute balance
13
+ #
14
+ # @return [Float]
15
+ required :balance, Float
16
+
17
+ # @!attribute credit_block_source
18
+ # How this credit block was created: `allocation` (a subscription's recurring
19
+ # credit allocation), `top_up` (an automatic balance-threshold top-up),
20
+ # `commitment` (a subscription commitment true-up rolled forward as credit), or
21
+ # `manual` (a manual credit ledger increment, including credits voided or expired
22
+ # off another block).
23
+ #
24
+ # @return [Symbol, Orb::Models::CreditBlockUpdateResponse::CreditBlockSource]
25
+ required :credit_block_source, enum: -> { Orb::Models::CreditBlockUpdateResponse::CreditBlockSource }
26
+
27
+ # @!attribute effective_date
28
+ #
29
+ # @return [Time, nil]
30
+ required :effective_date, Time, nil?: true
31
+
32
+ # @!attribute expiry_date
33
+ #
34
+ # @return [Time, nil]
35
+ required :expiry_date, Time, nil?: true
36
+
37
+ # @!attribute filters
38
+ #
39
+ # @return [Array<Orb::Models::CreditBlockUpdateResponse::Filter>]
40
+ required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::Models::CreditBlockUpdateResponse::Filter] }
41
+
42
+ # @!attribute maximum_initial_balance
43
+ #
44
+ # @return [Float, nil]
45
+ required :maximum_initial_balance, Float, nil?: true
46
+
47
+ # @!attribute metadata
48
+ # User specified key-value pairs for the resource. If not present, this defaults
49
+ # to an empty dictionary. Individual keys can be removed by setting the value to
50
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
51
+ # `null`.
52
+ #
53
+ # @return [Hash{Symbol=>String}]
54
+ required :metadata, Orb::Internal::Type::HashOf[String]
55
+
56
+ # @!attribute per_unit_cost_basis
57
+ #
58
+ # @return [String, nil]
59
+ required :per_unit_cost_basis, String, nil?: true
60
+
61
+ # @!attribute status
62
+ #
63
+ # @return [Symbol, Orb::Models::CreditBlockUpdateResponse::Status]
64
+ required :status, enum: -> { Orb::Models::CreditBlockUpdateResponse::Status }
65
+
66
+ # @!attribute credit_allocation
67
+ # The credit allocation that funded a block. Extends the allocation resource
68
+ # serialized on prices with the catalog-item attribution of the funding price.
69
+ #
70
+ # @return [Orb::Models::CreditBlockUpdateResponse::CreditAllocation, nil]
71
+ optional :credit_allocation, -> { Orb::Models::CreditBlockUpdateResponse::CreditAllocation }, nil?: true
72
+
73
+ # @!attribute credit_commitment
74
+ # The subscription commitment whose true-up rolled forward into this credit block.
75
+ # Present only when `credit_block_source` is `commitment`.
76
+ #
77
+ # @return [Orb::Models::CreditBlockUpdateResponse::CreditCommitment, nil]
78
+ optional :credit_commitment, -> { Orb::Models::CreditBlockUpdateResponse::CreditCommitment }, nil?: true
79
+
80
+ # @!method initialize(id:, balance:, credit_block_source:, effective_date:, expiry_date:, filters:, maximum_initial_balance:, metadata:, per_unit_cost_basis:, status:, credit_allocation: nil, credit_commitment: nil)
81
+ # Some parameter documentations has been truncated, see
82
+ # {Orb::Models::CreditBlockUpdateResponse} for more details.
83
+ #
84
+ # The Credit Block resource models prepaid credits within Orb.
85
+ #
86
+ # @param id [String]
87
+ #
88
+ # @param balance [Float]
89
+ #
90
+ # @param credit_block_source [Symbol, Orb::Models::CreditBlockUpdateResponse::CreditBlockSource] How this credit block was created: `allocation` (a subscription's recurring cred
91
+ #
92
+ # @param effective_date [Time, nil]
93
+ #
94
+ # @param expiry_date [Time, nil]
95
+ #
96
+ # @param filters [Array<Orb::Models::CreditBlockUpdateResponse::Filter>]
97
+ #
98
+ # @param maximum_initial_balance [Float, nil]
99
+ #
100
+ # @param metadata [Hash{Symbol=>String}] User specified key-value pairs for the resource. If not present, this defaults t
101
+ #
102
+ # @param per_unit_cost_basis [String, nil]
103
+ #
104
+ # @param status [Symbol, Orb::Models::CreditBlockUpdateResponse::Status]
105
+ #
106
+ # @param credit_allocation [Orb::Models::CreditBlockUpdateResponse::CreditAllocation, nil] The credit allocation that funded a block. Extends the allocation resource
107
+ #
108
+ # @param credit_commitment [Orb::Models::CreditBlockUpdateResponse::CreditCommitment, nil] The subscription commitment whose true-up rolled forward into this credit block.
109
+
110
+ # How this credit block was created: `allocation` (a subscription's recurring
111
+ # credit allocation), `top_up` (an automatic balance-threshold top-up),
112
+ # `commitment` (a subscription commitment true-up rolled forward as credit), or
113
+ # `manual` (a manual credit ledger increment, including credits voided or expired
114
+ # off another block).
115
+ #
116
+ # @see Orb::Models::CreditBlockUpdateResponse#credit_block_source
117
+ module CreditBlockSource
118
+ extend Orb::Internal::Type::Enum
119
+
120
+ ALLOCATION = :allocation
121
+ TOP_UP = :top_up
122
+ COMMITMENT = :commitment
123
+ MANUAL = :manual
124
+
125
+ # @!method self.values
126
+ # @return [Array<Symbol>]
127
+ end
128
+
129
+ class Filter < Orb::Internal::Type::BaseModel
130
+ # @!attribute field
131
+ # The property of the price to filter on.
132
+ #
133
+ # @return [Symbol, Orb::Models::CreditBlockUpdateResponse::Filter::Field]
134
+ required :field, enum: -> { Orb::Models::CreditBlockUpdateResponse::Filter::Field }
135
+
136
+ # @!attribute operator
137
+ # Should prices that match the filter be included or excluded.
138
+ #
139
+ # @return [Symbol, Orb::Models::CreditBlockUpdateResponse::Filter::Operator]
140
+ required :operator, enum: -> { Orb::Models::CreditBlockUpdateResponse::Filter::Operator }
141
+
142
+ # @!attribute values
143
+ # The IDs or values that match this filter.
144
+ #
145
+ # @return [Array<String>]
146
+ required :values, Orb::Internal::Type::ArrayOf[String]
147
+
148
+ # @!method initialize(field:, operator:, values:)
149
+ # @param field [Symbol, Orb::Models::CreditBlockUpdateResponse::Filter::Field] The property of the price to filter on.
150
+ #
151
+ # @param operator [Symbol, Orb::Models::CreditBlockUpdateResponse::Filter::Operator] Should prices that match the filter be included or excluded.
152
+ #
153
+ # @param values [Array<String>] The IDs or values that match this filter.
154
+
155
+ # The property of the price to filter on.
156
+ #
157
+ # @see Orb::Models::CreditBlockUpdateResponse::Filter#field
158
+ module Field
159
+ extend Orb::Internal::Type::Enum
160
+
161
+ PRICE_ID = :price_id
162
+ ITEM_ID = :item_id
163
+ PRICE_TYPE = :price_type
164
+ CURRENCY = :currency
165
+ PRICING_UNIT_ID = :pricing_unit_id
166
+
167
+ # @!method self.values
168
+ # @return [Array<Symbol>]
169
+ end
170
+
171
+ # Should prices that match the filter be included or excluded.
172
+ #
173
+ # @see Orb::Models::CreditBlockUpdateResponse::Filter#operator
174
+ module Operator
175
+ extend Orb::Internal::Type::Enum
176
+
177
+ INCLUDES = :includes
178
+ EXCLUDES = :excludes
179
+
180
+ # @!method self.values
181
+ # @return [Array<Symbol>]
182
+ end
183
+ end
184
+
185
+ # @see Orb::Models::CreditBlockUpdateResponse#status
186
+ module Status
187
+ extend Orb::Internal::Type::Enum
188
+
189
+ ACTIVE = :active
190
+ PENDING_PAYMENT = :pending_payment
191
+
192
+ # @!method self.values
193
+ # @return [Array<Symbol>]
194
+ end
195
+
196
+ # @see Orb::Models::CreditBlockUpdateResponse#credit_allocation
197
+ class CreditAllocation < Orb::Internal::Type::BaseModel
198
+ # @!attribute allows_rollover
199
+ #
200
+ # @return [Boolean]
201
+ required :allows_rollover, Orb::Internal::Type::Boolean
202
+
203
+ # @!attribute currency
204
+ #
205
+ # @return [String]
206
+ required :currency, String
207
+
208
+ # @!attribute custom_expiration
209
+ #
210
+ # @return [Orb::Models::CustomExpiration, nil]
211
+ required :custom_expiration, -> { Orb::CustomExpiration }, nil?: true
212
+
213
+ # @!attribute item_id
214
+ # The ID of the catalog item this block was allocated from, derived from the
215
+ # allocation's price.
216
+ #
217
+ # @return [String]
218
+ required :item_id, String
219
+
220
+ # @!attribute filters
221
+ #
222
+ # @return [Array<Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter>, nil]
223
+ optional :filters,
224
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter] }
225
+
226
+ # @!attribute license_type_id
227
+ #
228
+ # @return [String, nil]
229
+ optional :license_type_id, String, nil?: true
230
+
231
+ # @!method initialize(allows_rollover:, currency:, custom_expiration:, item_id:, filters: nil, license_type_id: nil)
232
+ # Some parameter documentations has been truncated, see
233
+ # {Orb::Models::CreditBlockUpdateResponse::CreditAllocation} for more details.
234
+ #
235
+ # The credit allocation that funded a block. Extends the allocation resource
236
+ # serialized on prices with the catalog-item attribution of the funding price.
237
+ #
238
+ # @param allows_rollover [Boolean]
239
+ #
240
+ # @param currency [String]
241
+ #
242
+ # @param custom_expiration [Orb::Models::CustomExpiration, nil]
243
+ #
244
+ # @param item_id [String] The ID of the catalog item this block was allocated from, derived from the alloc
245
+ #
246
+ # @param filters [Array<Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter>]
247
+ #
248
+ # @param license_type_id [String, nil]
249
+
250
+ class Filter < Orb::Internal::Type::BaseModel
251
+ # @!attribute field
252
+ # The property of the price to filter on.
253
+ #
254
+ # @return [Symbol, Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::Field]
255
+ required :field, enum: -> { Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::Field }
256
+
257
+ # @!attribute operator
258
+ # Should prices that match the filter be included or excluded.
259
+ #
260
+ # @return [Symbol, Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::Operator]
261
+ required :operator,
262
+ enum: -> { Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::Operator }
263
+
264
+ # @!attribute values
265
+ # The IDs or values that match this filter.
266
+ #
267
+ # @return [Array<String>]
268
+ required :values, Orb::Internal::Type::ArrayOf[String]
269
+
270
+ # @!method initialize(field:, operator:, values:)
271
+ # @param field [Symbol, Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::Field] The property of the price to filter on.
272
+ #
273
+ # @param operator [Symbol, Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::Operator] Should prices that match the filter be included or excluded.
274
+ #
275
+ # @param values [Array<String>] The IDs or values that match this filter.
276
+
277
+ # The property of the price to filter on.
278
+ #
279
+ # @see Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter#field
280
+ module Field
281
+ extend Orb::Internal::Type::Enum
282
+
283
+ PRICE_ID = :price_id
284
+ ITEM_ID = :item_id
285
+ PRICE_TYPE = :price_type
286
+ CURRENCY = :currency
287
+ PRICING_UNIT_ID = :pricing_unit_id
288
+
289
+ # @!method self.values
290
+ # @return [Array<Symbol>]
291
+ end
292
+
293
+ # Should prices that match the filter be included or excluded.
294
+ #
295
+ # @see Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter#operator
296
+ module Operator
297
+ extend Orb::Internal::Type::Enum
298
+
299
+ INCLUDES = :includes
300
+ EXCLUDES = :excludes
301
+
302
+ # @!method self.values
303
+ # @return [Array<Symbol>]
304
+ end
305
+ end
306
+ end
307
+
308
+ # @see Orb::Models::CreditBlockUpdateResponse#credit_commitment
309
+ class CreditCommitment < Orb::Internal::Type::BaseModel
310
+ # @!attribute id
311
+ # The ID of the subscription commitment this block was rolled forward from.
312
+ #
313
+ # @return [String]
314
+ required :id, String
315
+
316
+ # @!attribute subscription_id
317
+ # The subscription the commitment belongs to.
318
+ #
319
+ # @return [String, nil]
320
+ optional :subscription_id, String, nil?: true
321
+
322
+ # @!method initialize(id:, subscription_id: nil)
323
+ # The subscription commitment whose true-up rolled forward into this credit block.
324
+ # Present only when `credit_block_source` is `commitment`.
325
+ #
326
+ # @param id [String] The ID of the subscription commitment this block was rolled forward from.
327
+ #
328
+ # @param subscription_id [String, nil] The subscription the commitment belongs to.
329
+ end
330
+ end
331
+ end
332
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Metrics#archive
6
+ class MetricArchiveParams < 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
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Metrics#unarchive
6
+ class MetricUnarchiveParams < 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
@@ -0,0 +1,108 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Subscriptions#list_summary
6
+ class SubscriptionListSummaryParams < Orb::Internal::Type::BaseModel
7
+ extend Orb::Internal::Type::RequestParameters::Converter
8
+ include Orb::Internal::Type::RequestParameters
9
+
10
+ # @!attribute created_at_gt
11
+ #
12
+ # @return [Time, nil]
13
+ optional :created_at_gt, Time, nil?: true
14
+
15
+ # @!attribute created_at_gte
16
+ #
17
+ # @return [Time, nil]
18
+ optional :created_at_gte, Time, nil?: true
19
+
20
+ # @!attribute created_at_lt
21
+ #
22
+ # @return [Time, nil]
23
+ optional :created_at_lt, Time, nil?: true
24
+
25
+ # @!attribute created_at_lte
26
+ #
27
+ # @return [Time, nil]
28
+ optional :created_at_lte, Time, nil?: true
29
+
30
+ # @!attribute cursor
31
+ # Cursor for pagination. This can be populated by the `next_cursor` value returned
32
+ # from the initial request.
33
+ #
34
+ # @return [String, nil]
35
+ optional :cursor, String, nil?: true
36
+
37
+ # @!attribute customer_id
38
+ #
39
+ # @return [String, nil]
40
+ optional :customer_id, String, nil?: true
41
+
42
+ # @!attribute external_customer_id
43
+ #
44
+ # @return [String, nil]
45
+ optional :external_customer_id, String, nil?: true
46
+
47
+ # @!attribute external_plan_id
48
+ #
49
+ # @return [String, nil]
50
+ optional :external_plan_id, String, nil?: true
51
+
52
+ # @!attribute limit
53
+ # The number of items to fetch. Defaults to 20.
54
+ #
55
+ # @return [Integer, nil]
56
+ optional :limit, Integer
57
+
58
+ # @!attribute plan_id
59
+ #
60
+ # @return [String, nil]
61
+ optional :plan_id, String, nil?: true
62
+
63
+ # @!attribute status
64
+ #
65
+ # @return [Symbol, Orb::Models::SubscriptionListSummaryParams::Status, nil]
66
+ optional :status, enum: -> { Orb::SubscriptionListSummaryParams::Status }, nil?: true
67
+
68
+ # @!method initialize(created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, customer_id: nil, external_customer_id: nil, external_plan_id: nil, limit: nil, plan_id: nil, status: nil, request_options: {})
69
+ # Some parameter documentations has been truncated, see
70
+ # {Orb::Models::SubscriptionListSummaryParams} for more details.
71
+ #
72
+ # @param created_at_gt [Time, nil]
73
+ #
74
+ # @param created_at_gte [Time, nil]
75
+ #
76
+ # @param created_at_lt [Time, nil]
77
+ #
78
+ # @param created_at_lte [Time, nil]
79
+ #
80
+ # @param cursor [String, nil] Cursor for pagination. This can be populated by the `next_cursor` value returned
81
+ #
82
+ # @param customer_id [String, nil]
83
+ #
84
+ # @param external_customer_id [String, nil]
85
+ #
86
+ # @param external_plan_id [String, nil]
87
+ #
88
+ # @param limit [Integer] The number of items to fetch. Defaults to 20.
89
+ #
90
+ # @param plan_id [String, nil]
91
+ #
92
+ # @param status [Symbol, Orb::Models::SubscriptionListSummaryParams::Status, nil]
93
+ #
94
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
95
+
96
+ module Status
97
+ extend Orb::Internal::Type::Enum
98
+
99
+ ACTIVE = :active
100
+ ENDED = :ended
101
+ UPCOMING = :upcoming
102
+
103
+ # @!method self.values
104
+ # @return [Array<Symbol>]
105
+ end
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,130 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Subscriptions#list_summary
6
+ class SubscriptionListSummaryResponse < Orb::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute created_at
13
+ #
14
+ # @return [Time]
15
+ required :created_at, Time
16
+
17
+ # @!attribute customer
18
+ #
19
+ # @return [Orb::Models::CustomerMinified]
20
+ required :customer, -> { Orb::CustomerMinified }
21
+
22
+ # @!attribute end_date
23
+ # The date Orb stops billing for this subscription.
24
+ #
25
+ # @return [Time, nil]
26
+ required :end_date, Time, nil?: true
27
+
28
+ # @!attribute metadata
29
+ # User specified key-value pairs for the resource. If not present, this defaults
30
+ # to an empty dictionary. Individual keys can be removed by setting the value to
31
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
32
+ # `null`.
33
+ #
34
+ # @return [Hash{Symbol=>String}]
35
+ required :metadata, Orb::Internal::Type::HashOf[String]
36
+
37
+ # @!attribute name
38
+ # The name of the subscription.
39
+ #
40
+ # @return [String]
41
+ required :name, String
42
+
43
+ # @!attribute plan
44
+ #
45
+ # @return [Orb::Models::SubscriptionListSummaryResponse::Plan, nil]
46
+ required :plan, -> { Orb::Models::SubscriptionListSummaryResponse::Plan }, nil?: true
47
+
48
+ # @!attribute start_date
49
+ # The date Orb starts billing for this subscription.
50
+ #
51
+ # @return [Time]
52
+ required :start_date, Time
53
+
54
+ # @!attribute status
55
+ #
56
+ # @return [Symbol, Orb::Models::SubscriptionListSummaryResponse::Status]
57
+ required :status, enum: -> { Orb::Models::SubscriptionListSummaryResponse::Status }
58
+
59
+ # @!method initialize(id:, created_at:, customer:, end_date:, metadata:, name:, plan:, start_date:, status:)
60
+ # Some parameter documentations has been truncated, see
61
+ # {Orb::Models::SubscriptionListSummaryResponse} for more details.
62
+ #
63
+ # A subscription's own fields, with its plan and customer as references, as listed
64
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
65
+ # the subscription for its price intervals, billing periods, plan phases and other
66
+ # derived fields.
67
+ #
68
+ # @param id [String]
69
+ #
70
+ # @param created_at [Time]
71
+ #
72
+ # @param customer [Orb::Models::CustomerMinified]
73
+ #
74
+ # @param end_date [Time, nil] The date Orb stops billing for this subscription.
75
+ #
76
+ # @param metadata [Hash{Symbol=>String}] User specified key-value pairs for the resource. If not present, this defaults t
77
+ #
78
+ # @param name [String] The name of the subscription.
79
+ #
80
+ # @param plan [Orb::Models::SubscriptionListSummaryResponse::Plan, nil]
81
+ #
82
+ # @param start_date [Time] The date Orb starts billing for this subscription.
83
+ #
84
+ # @param status [Symbol, Orb::Models::SubscriptionListSummaryResponse::Status]
85
+
86
+ # @see Orb::Models::SubscriptionListSummaryResponse#plan
87
+ class Plan < Orb::Internal::Type::BaseModel
88
+ # @!attribute id
89
+ #
90
+ # @return [String, nil]
91
+ required :id, String, nil?: true
92
+
93
+ # @!attribute external_plan_id
94
+ # An optional user-defined ID for this plan resource, used throughout the system
95
+ # as an alias for this Plan. Use this field to identify a plan by an existing
96
+ # identifier in your system.
97
+ #
98
+ # @return [String, nil]
99
+ required :external_plan_id, String, nil?: true
100
+
101
+ # @!attribute name
102
+ #
103
+ # @return [String, nil]
104
+ required :name, String, nil?: true
105
+
106
+ # @!method initialize(id:, external_plan_id:, name:)
107
+ # Some parameter documentations has been truncated, see
108
+ # {Orb::Models::SubscriptionListSummaryResponse::Plan} for more details.
109
+ #
110
+ # @param id [String, nil]
111
+ #
112
+ # @param external_plan_id [String, nil] An optional user-defined ID for this plan resource, used throughout the system a
113
+ #
114
+ # @param name [String, nil]
115
+ end
116
+
117
+ # @see Orb::Models::SubscriptionListSummaryResponse#status
118
+ module Status
119
+ extend Orb::Internal::Type::Enum
120
+
121
+ ACTIVE = :active
122
+ ENDED = :ended
123
+ UPCOMING = :upcoming
124
+
125
+ # @!method self.values
126
+ # @return [Array<Symbol>]
127
+ end
128
+ end
129
+ end
130
+ end