orb-billing 1.47.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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -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/webhooks/subscription_accounting_sync_failed_standard_webhook_event.rb +9 -7
  9. data/lib/orb/models/webhooks/subscription_accounting_sync_succeeded_standard_webhook_event.rb +9 -7
  10. data/lib/orb/models/webhooks/subscription_cancellation_scheduled_standard_webhook_event.rb +9 -7
  11. data/lib/orb/models/webhooks/subscription_cancellation_unscheduled_standard_webhook_event.rb +9 -7
  12. data/lib/orb/models/webhooks/subscription_cost_exceeded_standard_webhook_event.rb +9 -7
  13. data/lib/orb/models/webhooks/subscription_created_standard_webhook_event.rb +9 -7
  14. data/lib/orb/models/webhooks/subscription_edited_standard_webhook_event.rb +9 -7
  15. data/lib/orb/models/webhooks/subscription_ended_standard_webhook_event.rb +9 -7
  16. data/lib/orb/models/webhooks/subscription_fixed_fee_quantity_updated_standard_webhook_event.rb +9 -7
  17. data/lib/orb/models/webhooks/subscription_plan_change_scheduled_standard_webhook_event.rb +9 -7
  18. data/lib/orb/models/webhooks/subscription_plan_changed_standard_webhook_event.rb +9 -7
  19. data/lib/orb/models/webhooks/subscription_plan_version_change_scheduled_standard_webhook_event.rb +9 -7
  20. data/lib/orb/models/webhooks/subscription_plan_version_changed_standard_webhook_event.rb +9 -7
  21. data/lib/orb/models/webhooks/subscription_spend_exceeded_standard_webhook_event.rb +9 -7
  22. data/lib/orb/models/webhooks/subscription_started_standard_webhook_event.rb +9 -7
  23. data/lib/orb/models/webhooks/subscription_trial_ended_standard_webhook_event.rb +9 -7
  24. data/lib/orb/models/webhooks/subscription_usage_exceeded_standard_webhook_event.rb +9 -7
  25. data/lib/orb/models.rb +6 -0
  26. data/lib/orb/resources/credit_blocks.rb +35 -0
  27. data/lib/orb/resources/metrics.rb +46 -0
  28. data/lib/orb/version.rb +1 -1
  29. data/lib/orb.rb +4 -0
  30. data/rbi/orb/models/credit_block_update_params.rbi +53 -0
  31. data/rbi/orb/models/credit_block_update_response.rbi +693 -0
  32. data/rbi/orb/models/metric_archive_params.rbi +33 -0
  33. data/rbi/orb/models/metric_unarchive_params.rbi +35 -0
  34. data/rbi/orb/models/webhooks/subscription_accounting_sync_failed_standard_webhook_event.rbi +12 -9
  35. data/rbi/orb/models/webhooks/subscription_accounting_sync_succeeded_standard_webhook_event.rbi +12 -9
  36. data/rbi/orb/models/webhooks/subscription_cancellation_scheduled_standard_webhook_event.rbi +12 -9
  37. data/rbi/orb/models/webhooks/subscription_cancellation_unscheduled_standard_webhook_event.rbi +12 -9
  38. data/rbi/orb/models/webhooks/subscription_cost_exceeded_standard_webhook_event.rbi +12 -9
  39. data/rbi/orb/models/webhooks/subscription_created_standard_webhook_event.rbi +12 -9
  40. data/rbi/orb/models/webhooks/subscription_edited_standard_webhook_event.rbi +12 -9
  41. data/rbi/orb/models/webhooks/subscription_ended_standard_webhook_event.rbi +12 -9
  42. data/rbi/orb/models/webhooks/subscription_fixed_fee_quantity_updated_standard_webhook_event.rbi +12 -9
  43. data/rbi/orb/models/webhooks/subscription_plan_change_scheduled_standard_webhook_event.rbi +12 -9
  44. data/rbi/orb/models/webhooks/subscription_plan_changed_standard_webhook_event.rbi +12 -9
  45. data/rbi/orb/models/webhooks/subscription_plan_version_change_scheduled_standard_webhook_event.rbi +12 -9
  46. data/rbi/orb/models/webhooks/subscription_plan_version_changed_standard_webhook_event.rbi +12 -9
  47. data/rbi/orb/models/webhooks/subscription_spend_exceeded_standard_webhook_event.rbi +12 -9
  48. data/rbi/orb/models/webhooks/subscription_started_standard_webhook_event.rbi +12 -9
  49. data/rbi/orb/models/webhooks/subscription_trial_ended_standard_webhook_event.rbi +12 -9
  50. data/rbi/orb/models/webhooks/subscription_usage_exceeded_standard_webhook_event.rbi +12 -9
  51. data/rbi/orb/models.rbi +6 -0
  52. data/rbi/orb/resources/credit_blocks.rbi +26 -0
  53. data/rbi/orb/resources/metrics.rbi +28 -0
  54. data/sig/orb/models/credit_block_update_params.rbs +28 -0
  55. data/sig/orb/models/credit_block_update_response.rbs +263 -0
  56. data/sig/orb/models/metric_archive_params.rbs +23 -0
  57. data/sig/orb/models/metric_unarchive_params.rbs +23 -0
  58. data/sig/orb/models.rbs +6 -0
  59. data/sig/orb/resources/credit_blocks.rbs +6 -0
  60. data/sig/orb/resources/metrics.rbs +10 -0
  61. metadata +13 -1
@@ -44,9 +44,10 @@ module Orb
44
44
  end
45
45
  attr_writer :properties
46
46
 
47
- # The subscription in a standard webhook payload: its own fields, with its plan
48
- # and customer as references. Fetch the subscription for its price intervals,
49
- # billing periods, plan phases and other derived fields.
47
+ # A subscription's own fields, with its plan and customer as references, as listed
48
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
49
+ # the subscription for its price intervals, billing periods, plan phases and other
50
+ # derived fields.
50
51
  sig do
51
52
  returns(
52
53
  Orb::Webhooks::SubscriptionPlanVersionChangedStandardWebhookEvent::Subscription
@@ -94,9 +95,10 @@ module Orb
94
95
  # endpoint.
95
96
  payload_style:,
96
97
  properties:,
97
- # The subscription in a standard webhook payload: its own fields, with its plan
98
- # and customer as references. Fetch the subscription for its price intervals,
99
- # billing periods, plan phases and other derived fields.
98
+ # A subscription's own fields, with its plan and customer as references, as listed
99
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
100
+ # the subscription for its price intervals, billing periods, plan phases and other
101
+ # derived fields.
100
102
  subscription:,
101
103
  # The event this payload describes.
102
104
  type:
@@ -269,9 +271,10 @@ module Orb
269
271
  end
270
272
  attr_accessor :status
271
273
 
272
- # The subscription in a standard webhook payload: its own fields, with its plan
273
- # and customer as references. Fetch the subscription for its price intervals,
274
- # billing periods, plan phases and other derived fields.
274
+ # A subscription's own fields, with its plan and customer as references, as listed
275
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
276
+ # the subscription for its price intervals, billing periods, plan phases and other
277
+ # derived fields.
275
278
  sig do
276
279
  params(
277
280
  id: String,
@@ -44,9 +44,10 @@ module Orb
44
44
  end
45
45
  attr_writer :properties
46
46
 
47
- # The subscription in a standard webhook payload: its own fields, with its plan
48
- # and customer as references. Fetch the subscription for its price intervals,
49
- # billing periods, plan phases and other derived fields.
47
+ # A subscription's own fields, with its plan and customer as references, as listed
48
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
49
+ # the subscription for its price intervals, billing periods, plan phases and other
50
+ # derived fields.
50
51
  sig do
51
52
  returns(
52
53
  Orb::Webhooks::SubscriptionSpendExceededStandardWebhookEvent::Subscription
@@ -95,9 +96,10 @@ module Orb
95
96
  # endpoint.
96
97
  payload_style:,
97
98
  properties:,
98
- # The subscription in a standard webhook payload: its own fields, with its plan
99
- # and customer as references. Fetch the subscription for its price intervals,
100
- # billing periods, plan phases and other derived fields.
99
+ # A subscription's own fields, with its plan and customer as references, as listed
100
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
101
+ # the subscription for its price intervals, billing periods, plan phases and other
102
+ # derived fields.
101
103
  subscription:,
102
104
  # The event this payload describes.
103
105
  type:
@@ -1111,9 +1113,10 @@ module Orb
1111
1113
  end
1112
1114
  attr_accessor :status
1113
1115
 
1114
- # The subscription in a standard webhook payload: its own fields, with its plan
1115
- # and customer as references. Fetch the subscription for its price intervals,
1116
- # billing periods, plan phases and other derived fields.
1116
+ # A subscription's own fields, with its plan and customer as references, as listed
1117
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
1118
+ # the subscription for its price intervals, billing periods, plan phases and other
1119
+ # derived fields.
1117
1120
  sig do
1118
1121
  params(
1119
1122
  id: String,
@@ -32,9 +32,10 @@ module Orb
32
32
  sig { returns(T.anything) }
33
33
  attr_accessor :properties
34
34
 
35
- # The subscription in a standard webhook payload: its own fields, with its plan
36
- # and customer as references. Fetch the subscription for its price intervals,
37
- # billing periods, plan phases and other derived fields.
35
+ # A subscription's own fields, with its plan and customer as references, as listed
36
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
37
+ # the subscription for its price intervals, billing periods, plan phases and other
38
+ # derived fields.
38
39
  sig do
39
40
  returns(
40
41
  Orb::Webhooks::SubscriptionStartedStandardWebhookEvent::Subscription
@@ -81,9 +82,10 @@ module Orb
81
82
  # endpoint.
82
83
  payload_style:,
83
84
  properties:,
84
- # The subscription in a standard webhook payload: its own fields, with its plan
85
- # and customer as references. Fetch the subscription for its price intervals,
86
- # billing periods, plan phases and other derived fields.
85
+ # A subscription's own fields, with its plan and customer as references, as listed
86
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
87
+ # the subscription for its price intervals, billing periods, plan phases and other
88
+ # derived fields.
87
89
  subscription:,
88
90
  # The event this payload describes.
89
91
  type:
@@ -210,9 +212,10 @@ module Orb
210
212
  end
211
213
  attr_accessor :status
212
214
 
213
- # The subscription in a standard webhook payload: its own fields, with its plan
214
- # and customer as references. Fetch the subscription for its price intervals,
215
- # billing periods, plan phases and other derived fields.
215
+ # A subscription's own fields, with its plan and customer as references, as listed
216
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
217
+ # the subscription for its price intervals, billing periods, plan phases and other
218
+ # derived fields.
216
219
  sig do
217
220
  params(
218
221
  id: String,
@@ -32,9 +32,10 @@ module Orb
32
32
  sig { returns(T.anything) }
33
33
  attr_accessor :properties
34
34
 
35
- # The subscription in a standard webhook payload: its own fields, with its plan
36
- # and customer as references. Fetch the subscription for its price intervals,
37
- # billing periods, plan phases and other derived fields.
35
+ # A subscription's own fields, with its plan and customer as references, as listed
36
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
37
+ # the subscription for its price intervals, billing periods, plan phases and other
38
+ # derived fields.
38
39
  sig do
39
40
  returns(
40
41
  Orb::Webhooks::SubscriptionTrialEndedStandardWebhookEvent::Subscription
@@ -81,9 +82,10 @@ module Orb
81
82
  # endpoint.
82
83
  payload_style:,
83
84
  properties:,
84
- # The subscription in a standard webhook payload: its own fields, with its plan
85
- # and customer as references. Fetch the subscription for its price intervals,
86
- # billing periods, plan phases and other derived fields.
85
+ # A subscription's own fields, with its plan and customer as references, as listed
86
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
87
+ # the subscription for its price intervals, billing periods, plan phases and other
88
+ # derived fields.
87
89
  subscription:,
88
90
  # The event this payload describes.
89
91
  type:
@@ -210,9 +212,10 @@ module Orb
210
212
  end
211
213
  attr_accessor :status
212
214
 
213
- # The subscription in a standard webhook payload: its own fields, with its plan
214
- # and customer as references. Fetch the subscription for its price intervals,
215
- # billing periods, plan phases and other derived fields.
215
+ # A subscription's own fields, with its plan and customer as references, as listed
216
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
217
+ # the subscription for its price intervals, billing periods, plan phases and other
218
+ # derived fields.
216
219
  sig do
217
220
  params(
218
221
  id: String,
@@ -44,9 +44,10 @@ module Orb
44
44
  end
45
45
  attr_writer :properties
46
46
 
47
- # The subscription in a standard webhook payload: its own fields, with its plan
48
- # and customer as references. Fetch the subscription for its price intervals,
49
- # billing periods, plan phases and other derived fields.
47
+ # A subscription's own fields, with its plan and customer as references, as listed
48
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
49
+ # the subscription for its price intervals, billing periods, plan phases and other
50
+ # derived fields.
50
51
  sig do
51
52
  returns(
52
53
  Orb::Webhooks::SubscriptionUsageExceededStandardWebhookEvent::Subscription
@@ -95,9 +96,10 @@ module Orb
95
96
  # endpoint.
96
97
  payload_style:,
97
98
  properties:,
98
- # The subscription in a standard webhook payload: its own fields, with its plan
99
- # and customer as references. Fetch the subscription for its price intervals,
100
- # billing periods, plan phases and other derived fields.
99
+ # A subscription's own fields, with its plan and customer as references, as listed
100
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
101
+ # the subscription for its price intervals, billing periods, plan phases and other
102
+ # derived fields.
101
103
  subscription:,
102
104
  # The event this payload describes.
103
105
  type:
@@ -1117,9 +1119,10 @@ module Orb
1117
1119
  end
1118
1120
  attr_accessor :status
1119
1121
 
1120
- # The subscription in a standard webhook payload: its own fields, with its plan
1121
- # and customer as references. Fetch the subscription for its price intervals,
1122
- # billing periods, plan phases and other derived fields.
1122
+ # A subscription's own fields, with its plan and customer as references, as listed
1123
+ # by List subscription summaries and carried in standard webhook payloads. Fetch
1124
+ # the subscription for its price intervals, billing periods, plan phases and other
1125
+ # derived fields.
1123
1126
  sig do
1124
1127
  params(
1125
1128
  id: String,
data/rbi/orb/models.rbi CHANGED
@@ -106,6 +106,8 @@ module Orb
106
106
 
107
107
  CreditBlockRetrieveParams = Orb::Models::CreditBlockRetrieveParams
108
108
 
109
+ CreditBlockUpdateParams = Orb::Models::CreditBlockUpdateParams
110
+
109
111
  CreditNote = Orb::Models::CreditNote
110
112
 
111
113
  CreditNoteAccountingSyncFailedWebhookEvent =
@@ -392,6 +394,8 @@ module Orb
392
394
 
393
395
  MaximumInterval = Orb::Models::MaximumInterval
394
396
 
397
+ MetricArchiveParams = Orb::Models::MetricArchiveParams
398
+
395
399
  MetricCreateParams = Orb::Models::MetricCreateParams
396
400
 
397
401
  MetricEventsDroppedByWatermarkWebhookEvent =
@@ -401,6 +405,8 @@ module Orb
401
405
 
402
406
  MetricListParams = Orb::Models::MetricListParams
403
407
 
408
+ MetricUnarchiveParams = Orb::Models::MetricUnarchiveParams
409
+
404
410
  MetricUpdateParams = Orb::Models::MetricUpdateParams
405
411
 
406
412
  Minimum = Orb::Models::Minimum
@@ -15,6 +15,32 @@ module Orb
15
15
  def retrieve(block_id, request_options: {})
16
16
  end
17
17
 
18
+ # This endpoint updates the `metadata` of a credit block. Keys you pass are added
19
+ # to the block's existing metadata or overwrite the value already stored for that
20
+ # key, and setting a key to `null` removes it. Passing `null` for `metadata`
21
+ # clears all of the block's metadata. The block's `increment` entry in the
22
+ # [credits ledger](fetch-customer-credits-ledger) reports the block's metadata, so
23
+ # it shows the update too.
24
+ #
25
+ # Other fields on a credit block cannot be changed through this endpoint. Deleted
26
+ # credit blocks return a 404.
27
+ sig do
28
+ params(
29
+ block_id: String,
30
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
31
+ request_options: Orb::RequestOptions::OrHash
32
+ ).returns(Orb::Models::CreditBlockUpdateResponse)
33
+ end
34
+ def update(
35
+ block_id,
36
+ # User-specified key/value pairs for the resource. Individual keys can be removed
37
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
38
+ # by setting `metadata` to `null`.
39
+ metadata: nil,
40
+ request_options: {}
41
+ )
42
+ end
43
+
18
44
  # This endpoint deletes a credit block by its ID.
19
45
  #
20
46
  # When a credit block is deleted:
@@ -96,6 +96,22 @@ module Orb
96
96
  )
97
97
  end
98
98
 
99
+ # This endpoint archives a [metric](/core-concepts#metric). Archived metrics are
100
+ # left out of `GET /v1/metrics` when filtering with `status=active`, and can't be
101
+ # chosen when creating new plans in the Orb dashboard.
102
+ #
103
+ # Archiving does not change existing prices, plans, or subscriptions that use the
104
+ # metric, and usage on those prices continues to be billed. A metric that is
105
+ # already archived cannot be archived again.
106
+ sig do
107
+ params(
108
+ metric_id: String,
109
+ request_options: Orb::RequestOptions::OrHash
110
+ ).returns(Orb::BillableMetric)
111
+ end
112
+ def archive(metric_id, request_options: {})
113
+ end
114
+
99
115
  # This endpoint is used to fetch [metric](/core-concepts#metric) details given a
100
116
  # metric identifier. It returns information about the metrics including its name,
101
117
  # description, and item.
@@ -108,6 +124,18 @@ module Orb
108
124
  def fetch(metric_id, request_options: {})
109
125
  end
110
126
 
127
+ # This endpoint restores an archived [metric](/core-concepts#metric) to `active`,
128
+ # so it can be chosen for new plans again. Only archived metrics can be
129
+ # unarchived.
130
+ sig do
131
+ params(
132
+ metric_id: String,
133
+ request_options: Orb::RequestOptions::OrHash
134
+ ).returns(Orb::BillableMetric)
135
+ end
136
+ def unarchive(metric_id, request_options: {})
137
+ end
138
+
111
139
  # @api private
112
140
  sig { params(client: Orb::Client).returns(T.attached_class) }
113
141
  def self.new(client:)
@@ -0,0 +1,28 @@
1
+ module Orb
2
+ module Models
3
+ type credit_block_update_params =
4
+ { block_id: String, metadata: ::Hash[Symbol, String?]? }
5
+ & Orb::Internal::Type::request_parameters
6
+
7
+ class CreditBlockUpdateParams < Orb::Internal::Type::BaseModel
8
+ extend Orb::Internal::Type::RequestParameters::Converter
9
+ include Orb::Internal::Type::RequestParameters
10
+
11
+ attr_accessor block_id: String
12
+
13
+ attr_accessor metadata: ::Hash[Symbol, String?]?
14
+
15
+ def initialize: (
16
+ block_id: String,
17
+ ?metadata: ::Hash[Symbol, String?]?,
18
+ ?request_options: Orb::request_opts
19
+ ) -> void
20
+
21
+ def to_hash: -> {
22
+ block_id: String,
23
+ metadata: ::Hash[Symbol, String?]?,
24
+ request_options: Orb::RequestOptions
25
+ }
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,263 @@
1
+ module Orb
2
+ module Models
3
+ type credit_block_update_response =
4
+ {
5
+ id: String,
6
+ balance: Float,
7
+ credit_block_source: Orb::Models::CreditBlockUpdateResponse::credit_block_source,
8
+ effective_date: Time?,
9
+ expiry_date: Time?,
10
+ filters: ::Array[Orb::Models::CreditBlockUpdateResponse::Filter],
11
+ maximum_initial_balance: Float?,
12
+ metadata: ::Hash[Symbol, String],
13
+ per_unit_cost_basis: String?,
14
+ status: Orb::Models::CreditBlockUpdateResponse::status,
15
+ credit_allocation: Orb::Models::CreditBlockUpdateResponse::CreditAllocation?,
16
+ credit_commitment: Orb::Models::CreditBlockUpdateResponse::CreditCommitment?
17
+ }
18
+
19
+ class CreditBlockUpdateResponse < Orb::Internal::Type::BaseModel
20
+ attr_accessor id: String
21
+
22
+ attr_accessor balance: Float
23
+
24
+ attr_accessor credit_block_source: Orb::Models::CreditBlockUpdateResponse::credit_block_source
25
+
26
+ attr_accessor effective_date: Time?
27
+
28
+ attr_accessor expiry_date: Time?
29
+
30
+ attr_accessor filters: ::Array[Orb::Models::CreditBlockUpdateResponse::Filter]
31
+
32
+ attr_accessor maximum_initial_balance: Float?
33
+
34
+ attr_accessor metadata: ::Hash[Symbol, String]
35
+
36
+ attr_accessor per_unit_cost_basis: String?
37
+
38
+ attr_accessor status: Orb::Models::CreditBlockUpdateResponse::status
39
+
40
+ attr_accessor credit_allocation: Orb::Models::CreditBlockUpdateResponse::CreditAllocation?
41
+
42
+ attr_accessor credit_commitment: Orb::Models::CreditBlockUpdateResponse::CreditCommitment?
43
+
44
+ def initialize: (
45
+ id: String,
46
+ balance: Float,
47
+ credit_block_source: Orb::Models::CreditBlockUpdateResponse::credit_block_source,
48
+ effective_date: Time?,
49
+ expiry_date: Time?,
50
+ filters: ::Array[Orb::Models::CreditBlockUpdateResponse::Filter],
51
+ maximum_initial_balance: Float?,
52
+ metadata: ::Hash[Symbol, String],
53
+ per_unit_cost_basis: String?,
54
+ status: Orb::Models::CreditBlockUpdateResponse::status,
55
+ ?credit_allocation: Orb::Models::CreditBlockUpdateResponse::CreditAllocation?,
56
+ ?credit_commitment: Orb::Models::CreditBlockUpdateResponse::CreditCommitment?
57
+ ) -> void
58
+
59
+ def to_hash: -> {
60
+ id: String,
61
+ balance: Float,
62
+ credit_block_source: Orb::Models::CreditBlockUpdateResponse::credit_block_source,
63
+ effective_date: Time?,
64
+ expiry_date: Time?,
65
+ filters: ::Array[Orb::Models::CreditBlockUpdateResponse::Filter],
66
+ maximum_initial_balance: Float?,
67
+ metadata: ::Hash[Symbol, String],
68
+ per_unit_cost_basis: String?,
69
+ status: Orb::Models::CreditBlockUpdateResponse::status,
70
+ credit_allocation: Orb::Models::CreditBlockUpdateResponse::CreditAllocation?,
71
+ credit_commitment: Orb::Models::CreditBlockUpdateResponse::CreditCommitment?
72
+ }
73
+
74
+ type credit_block_source = :allocation | :top_up | :commitment | :manual
75
+
76
+ module CreditBlockSource
77
+ extend Orb::Internal::Type::Enum
78
+
79
+ ALLOCATION: :allocation
80
+ TOP_UP: :top_up
81
+ COMMITMENT: :commitment
82
+ MANUAL: :manual
83
+
84
+ def self?.values: -> ::Array[Orb::Models::CreditBlockUpdateResponse::credit_block_source]
85
+ end
86
+
87
+ type filter =
88
+ {
89
+ field: Orb::Models::CreditBlockUpdateResponse::Filter::field,
90
+ operator: Orb::Models::CreditBlockUpdateResponse::Filter::operator,
91
+ values: ::Array[String]
92
+ }
93
+
94
+ class Filter < Orb::Internal::Type::BaseModel
95
+ attr_accessor field: Orb::Models::CreditBlockUpdateResponse::Filter::field
96
+
97
+ attr_accessor operator: Orb::Models::CreditBlockUpdateResponse::Filter::operator
98
+
99
+ attr_accessor values: ::Array[String]
100
+
101
+ def initialize: (
102
+ field: Orb::Models::CreditBlockUpdateResponse::Filter::field,
103
+ operator: Orb::Models::CreditBlockUpdateResponse::Filter::operator,
104
+ values: ::Array[String]
105
+ ) -> void
106
+
107
+ def to_hash: -> {
108
+ field: Orb::Models::CreditBlockUpdateResponse::Filter::field,
109
+ operator: Orb::Models::CreditBlockUpdateResponse::Filter::operator,
110
+ values: ::Array[String]
111
+ }
112
+
113
+ type field =
114
+ :price_id | :item_id | :price_type | :currency | :pricing_unit_id
115
+
116
+ module Field
117
+ extend Orb::Internal::Type::Enum
118
+
119
+ PRICE_ID: :price_id
120
+ ITEM_ID: :item_id
121
+ PRICE_TYPE: :price_type
122
+ CURRENCY: :currency
123
+ PRICING_UNIT_ID: :pricing_unit_id
124
+
125
+ def self?.values: -> ::Array[Orb::Models::CreditBlockUpdateResponse::Filter::field]
126
+ end
127
+
128
+ type operator = :includes | :excludes
129
+
130
+ module Operator
131
+ extend Orb::Internal::Type::Enum
132
+
133
+ INCLUDES: :includes
134
+ EXCLUDES: :excludes
135
+
136
+ def self?.values: -> ::Array[Orb::Models::CreditBlockUpdateResponse::Filter::operator]
137
+ end
138
+ end
139
+
140
+ type status = :active | :pending_payment
141
+
142
+ module Status
143
+ extend Orb::Internal::Type::Enum
144
+
145
+ ACTIVE: :active
146
+ PENDING_PAYMENT: :pending_payment
147
+
148
+ def self?.values: -> ::Array[Orb::Models::CreditBlockUpdateResponse::status]
149
+ end
150
+
151
+ type credit_allocation =
152
+ {
153
+ allows_rollover: bool,
154
+ currency: String,
155
+ custom_expiration: Orb::CustomExpiration?,
156
+ item_id: String,
157
+ filters: ::Array[Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter],
158
+ license_type_id: String?
159
+ }
160
+
161
+ class CreditAllocation < Orb::Internal::Type::BaseModel
162
+ attr_accessor allows_rollover: bool
163
+
164
+ attr_accessor currency: String
165
+
166
+ attr_accessor custom_expiration: Orb::CustomExpiration?
167
+
168
+ attr_accessor item_id: String
169
+
170
+ attr_reader filters: ::Array[Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter]?
171
+
172
+ def filters=: (
173
+ ::Array[Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter]
174
+ ) -> ::Array[Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter]
175
+
176
+ attr_accessor license_type_id: String?
177
+
178
+ def initialize: (
179
+ allows_rollover: bool,
180
+ currency: String,
181
+ custom_expiration: Orb::CustomExpiration?,
182
+ item_id: String,
183
+ ?filters: ::Array[Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter],
184
+ ?license_type_id: String?
185
+ ) -> void
186
+
187
+ def to_hash: -> {
188
+ allows_rollover: bool,
189
+ currency: String,
190
+ custom_expiration: Orb::CustomExpiration?,
191
+ item_id: String,
192
+ filters: ::Array[Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter],
193
+ license_type_id: String?
194
+ }
195
+
196
+ type filter =
197
+ {
198
+ field: Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::field,
199
+ operator: Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::operator,
200
+ values: ::Array[String]
201
+ }
202
+
203
+ class Filter < Orb::Internal::Type::BaseModel
204
+ attr_accessor field: Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::field
205
+
206
+ attr_accessor operator: Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::operator
207
+
208
+ attr_accessor values: ::Array[String]
209
+
210
+ def initialize: (
211
+ field: Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::field,
212
+ operator: Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::operator,
213
+ values: ::Array[String]
214
+ ) -> void
215
+
216
+ def to_hash: -> {
217
+ field: Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::field,
218
+ operator: Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::operator,
219
+ values: ::Array[String]
220
+ }
221
+
222
+ type field =
223
+ :price_id | :item_id | :price_type | :currency | :pricing_unit_id
224
+
225
+ module Field
226
+ extend Orb::Internal::Type::Enum
227
+
228
+ PRICE_ID: :price_id
229
+ ITEM_ID: :item_id
230
+ PRICE_TYPE: :price_type
231
+ CURRENCY: :currency
232
+ PRICING_UNIT_ID: :pricing_unit_id
233
+
234
+ def self?.values: -> ::Array[Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::field]
235
+ end
236
+
237
+ type operator = :includes | :excludes
238
+
239
+ module Operator
240
+ extend Orb::Internal::Type::Enum
241
+
242
+ INCLUDES: :includes
243
+ EXCLUDES: :excludes
244
+
245
+ def self?.values: -> ::Array[Orb::Models::CreditBlockUpdateResponse::CreditAllocation::Filter::operator]
246
+ end
247
+ end
248
+ end
249
+
250
+ type credit_commitment = { id: String, subscription_id: String? }
251
+
252
+ class CreditCommitment < Orb::Internal::Type::BaseModel
253
+ attr_accessor id: String
254
+
255
+ attr_accessor subscription_id: String?
256
+
257
+ def initialize: (id: String, ?subscription_id: String?) -> void
258
+
259
+ def to_hash: -> { id: String, subscription_id: String? }
260
+ end
261
+ end
262
+ end
263
+ end
@@ -0,0 +1,23 @@
1
+ module Orb
2
+ module Models
3
+ type metric_archive_params =
4
+ { metric_id: String } & Orb::Internal::Type::request_parameters
5
+
6
+ class MetricArchiveParams < Orb::Internal::Type::BaseModel
7
+ extend Orb::Internal::Type::RequestParameters::Converter
8
+ include Orb::Internal::Type::RequestParameters
9
+
10
+ attr_accessor metric_id: String
11
+
12
+ def initialize: (
13
+ metric_id: String,
14
+ ?request_options: Orb::request_opts
15
+ ) -> void
16
+
17
+ def to_hash: -> {
18
+ metric_id: String,
19
+ request_options: Orb::RequestOptions
20
+ }
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ module Orb
2
+ module Models
3
+ type metric_unarchive_params =
4
+ { metric_id: String } & Orb::Internal::Type::request_parameters
5
+
6
+ class MetricUnarchiveParams < Orb::Internal::Type::BaseModel
7
+ extend Orb::Internal::Type::RequestParameters::Converter
8
+ include Orb::Internal::Type::RequestParameters
9
+
10
+ attr_accessor metric_id: String
11
+
12
+ def initialize: (
13
+ metric_id: String,
14
+ ?request_options: Orb::request_opts
15
+ ) -> void
16
+
17
+ def to_hash: -> {
18
+ metric_id: String,
19
+ request_options: Orb::RequestOptions
20
+ }
21
+ end
22
+ end
23
+ end