orb-billing 1.12.0 → 1.13.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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +72 -0
  5. data/lib/orb/internal/util.rb +31 -0
  6. data/lib/orb/models/billable_metric.rb +10 -1
  7. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +11 -2
  8. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +11 -2
  9. data/lib/orb/models/invoice_create_params.rb +11 -1
  10. data/lib/orb/models/invoice_update_params.rb +11 -1
  11. data/lib/orb/models/item.rb +1 -0
  12. data/lib/orb/models/item_update_params.rb +1 -0
  13. data/lib/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rb +9 -1
  14. data/lib/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rb +9 -1
  15. data/lib/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb +9 -1
  16. data/lib/orb/models/price.rb +9 -1
  17. data/lib/orb/models/price_create_params.rb +9 -1
  18. data/lib/orb/models/price_evaluate_multiple_params.rb +12 -1
  19. data/lib/orb/models/price_evaluate_params.rb +12 -1
  20. data/lib/orb/models/price_evaluate_preview_events_params.rb +12 -1
  21. data/lib/orb/models/price_interval.rb +12 -1
  22. data/lib/orb/models/subscription_create_params.rb +24 -2
  23. data/lib/orb/models/subscription_price_intervals_params.rb +24 -2
  24. data/lib/orb/models/subscription_schedule_plan_change_params.rb +24 -2
  25. data/lib/orb/resources/alerts.rb +11 -3
  26. data/lib/orb/resources/beta/external_plan_id.rb +4 -0
  27. data/lib/orb/resources/beta.rb +8 -0
  28. data/lib/orb/resources/coupons/subscriptions.rb +7 -1
  29. data/lib/orb/resources/coupons.rb +12 -1
  30. data/lib/orb/resources/credit_blocks.rb +2 -0
  31. data/lib/orb/resources/credit_notes.rb +4 -1
  32. data/lib/orb/resources/customers/balance_transactions.rb +20 -1
  33. data/lib/orb/resources/customers/costs.rb +22 -2
  34. data/lib/orb/resources/customers/credits/ledger.rb +18 -6
  35. data/lib/orb/resources/customers/credits/top_ups.rb +6 -2
  36. data/lib/orb/resources/customers/credits.rb +10 -2
  37. data/lib/orb/resources/customers.rb +58 -1
  38. data/lib/orb/resources/dimensional_price_groups.rb +2 -1
  39. data/lib/orb/resources/events/backfills.rb +5 -1
  40. data/lib/orb/resources/events/volume.rb +5 -1
  41. data/lib/orb/resources/events.rb +12 -2
  42. data/lib/orb/resources/invoice_line_items.rb +5 -0
  43. data/lib/orb/resources/invoices.rb +23 -10
  44. data/lib/orb/resources/items.rb +5 -1
  45. data/lib/orb/resources/license_types.rb +5 -1
  46. data/lib/orb/resources/licenses/external_licenses.rb +2 -1
  47. data/lib/orb/resources/licenses/usage.rb +4 -2
  48. data/lib/orb/resources/licenses.rb +4 -2
  49. data/lib/orb/resources/metrics.rb +5 -1
  50. data/lib/orb/resources/plans/external_plan_id.rb +4 -0
  51. data/lib/orb/resources/plans/migrations.rb +6 -1
  52. data/lib/orb/resources/plans.rb +14 -1
  53. data/lib/orb/resources/prices/external_price_id.rb +10 -0
  54. data/lib/orb/resources/prices.rb +25 -2
  55. data/lib/orb/resources/subscription_changes.rb +2 -1
  56. data/lib/orb/resources/subscriptions.rb +8 -4
  57. data/lib/orb/version.rb +1 -1
  58. data/rbi/orb/client.rbi +72 -0
  59. data/rbi/orb/internal/util.rbi +18 -0
  60. data/rbi/orb/models/billable_metric.rbi +11 -3
  61. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +15 -2
  62. data/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi +15 -2
  63. data/rbi/orb/models/invoice_create_params.rbi +12 -0
  64. data/rbi/orb/models/invoice_update_params.rbi +12 -0
  65. data/rbi/orb/models/item.rbi +5 -0
  66. data/rbi/orb/models/item_update_params.rbi +5 -0
  67. data/rbi/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbi +8 -0
  68. data/rbi/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbi +8 -0
  69. data/rbi/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbi +8 -0
  70. data/rbi/orb/models/price.rbi +8 -0
  71. data/rbi/orb/models/price_create_params.rbi +8 -0
  72. data/rbi/orb/models/price_evaluate_multiple_params.rbi +11 -0
  73. data/rbi/orb/models/price_evaluate_params.rbi +10 -0
  74. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +11 -0
  75. data/rbi/orb/models/price_interval.rbi +13 -3
  76. data/rbi/orb/models/subscription_create_params.rbi +22 -0
  77. data/rbi/orb/models/subscription_price_intervals_params.rbi +22 -0
  78. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +22 -0
  79. data/rbi/orb/resources/alerts.rbi +5 -0
  80. data/rbi/orb/resources/beta/external_plan_id.rbi +4 -0
  81. data/rbi/orb/resources/beta.rbi +8 -0
  82. data/rbi/orb/resources/coupons/subscriptions.rbi +5 -0
  83. data/rbi/orb/resources/coupons.rbi +10 -0
  84. data/rbi/orb/resources/credit_blocks.rbi +2 -0
  85. data/rbi/orb/resources/credit_notes.rbi +2 -0
  86. data/rbi/orb/resources/customers/balance_transactions.rbi +18 -0
  87. data/rbi/orb/resources/customers/costs.rbi +18 -0
  88. data/rbi/orb/resources/customers/credits/ledger.rbi +14 -4
  89. data/rbi/orb/resources/customers/credits/top_ups.rbi +2 -0
  90. data/rbi/orb/resources/customers/credits.rbi +6 -0
  91. data/rbi/orb/resources/customers.rbi +56 -0
  92. data/rbi/orb/resources/events/backfills.rbi +3 -0
  93. data/rbi/orb/resources/events/volume.rbi +3 -0
  94. data/rbi/orb/resources/events.rbi +9 -0
  95. data/rbi/orb/resources/invoice_line_items.rbi +5 -0
  96. data/rbi/orb/resources/invoices.rbi +21 -5
  97. data/rbi/orb/resources/items.rbi +3 -0
  98. data/rbi/orb/resources/license_types.rbi +3 -0
  99. data/rbi/orb/resources/metrics.rbi +3 -0
  100. data/rbi/orb/resources/plans/external_plan_id.rbi +4 -0
  101. data/rbi/orb/resources/plans/migrations.rbi +4 -0
  102. data/rbi/orb/resources/plans.rbi +12 -0
  103. data/rbi/orb/resources/prices/external_price_id.rbi +10 -0
  104. data/rbi/orb/resources/prices.rbi +24 -0
  105. data/sig/orb/internal/util.rbs +10 -0
  106. data/sig/orb/models/billable_metric.rbs +8 -3
  107. data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs +7 -0
  108. data/sig/orb/models/customers/credits/ledger_create_entry_params.rbs +7 -0
  109. data/sig/orb/models/invoice_create_params.rbs +5 -0
  110. data/sig/orb/models/invoice_update_params.rbs +5 -0
  111. data/sig/orb/models/item.rbs +2 -0
  112. data/sig/orb/models/item_update_params.rbs +2 -0
  113. data/sig/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbs +5 -0
  114. data/sig/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbs +5 -0
  115. data/sig/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbs +5 -0
  116. data/sig/orb/models/price.rbs +5 -0
  117. data/sig/orb/models/price_create_params.rbs +5 -0
  118. data/sig/orb/models/price_evaluate_multiple_params.rbs +5 -0
  119. data/sig/orb/models/price_evaluate_params.rbs +6 -1
  120. data/sig/orb/models/price_evaluate_preview_events_params.rbs +5 -0
  121. data/sig/orb/models/price_interval.rbs +8 -3
  122. data/sig/orb/models/subscription_create_params.rbs +10 -0
  123. data/sig/orb/models/subscription_price_intervals_params.rbs +10 -0
  124. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +10 -0
  125. data/sig/orb/resources/invoices.rbs +2 -0
  126. data/sig/orb/resources/prices.rbs +1 -0
  127. metadata +2 -2
@@ -2,13 +2,69 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # A customer is a buyer of your products, and the other party to the billing
6
+ # relationship.
7
+ #
8
+ # In Orb, customers are assigned system generated identifiers automatically, but
9
+ # it's often desirable to have these match existing identifiers in your system. To
10
+ # avoid having to denormalize Orb ID information, you can pass in an
11
+ # `external_customer_id` with your own identifier. See
12
+ # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
13
+ # information about how these aliases work in Orb.
14
+ #
15
+ # In addition to having an identifier in your system, a customer may exist in a
16
+ # payment provider solution like Stripe. Use the `payment_provider_id` and the
17
+ # `payment_provider` enum field to express this mapping.
18
+ #
19
+ # A customer also has a timezone (from the standard
20
+ # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
21
+ # your account's timezone. See [Timezone localization](/essentials/timezones) for
22
+ # information on what this timezone parameter influences within Orb.
5
23
  class Customers
24
+ # A customer is a buyer of your products, and the other party to the billing
25
+ # relationship.
26
+ #
27
+ # In Orb, customers are assigned system generated identifiers automatically, but
28
+ # it's often desirable to have these match existing identifiers in your system. To
29
+ # avoid having to denormalize Orb ID information, you can pass in an
30
+ # `external_customer_id` with your own identifier. See
31
+ # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
32
+ # information about how these aliases work in Orb.
33
+ #
34
+ # In addition to having an identifier in your system, a customer may exist in a
35
+ # payment provider solution like Stripe. Use the `payment_provider_id` and the
36
+ # `payment_provider` enum field to express this mapping.
37
+ #
38
+ # A customer also has a timezone (from the standard
39
+ # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
40
+ # your account's timezone. See [Timezone localization](/essentials/timezones) for
41
+ # information on what this timezone parameter influences within Orb.
6
42
  sig { returns(Orb::Resources::Customers::Costs) }
7
43
  attr_reader :costs
8
44
 
45
+ # The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
46
+ # credits within Orb.
9
47
  sig { returns(Orb::Resources::Customers::Credits) }
10
48
  attr_reader :credits
11
49
 
50
+ # A customer is a buyer of your products, and the other party to the billing
51
+ # relationship.
52
+ #
53
+ # In Orb, customers are assigned system generated identifiers automatically, but
54
+ # it's often desirable to have these match existing identifiers in your system. To
55
+ # avoid having to denormalize Orb ID information, you can pass in an
56
+ # `external_customer_id` with your own identifier. See
57
+ # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
58
+ # information about how these aliases work in Orb.
59
+ #
60
+ # In addition to having an identifier in your system, a customer may exist in a
61
+ # payment provider solution like Stripe. Use the `payment_provider_id` and the
62
+ # `payment_provider` enum field to express this mapping.
63
+ #
64
+ # A customer also has a timezone (from the standard
65
+ # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
66
+ # your account's timezone. See [Timezone localization](/essentials/timezones) for
67
+ # information on what this timezone parameter influences within Orb.
12
68
  sig { returns(Orb::Resources::Customers::BalanceTransactions) }
13
69
  attr_reader :balance_transactions
14
70
 
@@ -3,6 +3,9 @@
3
3
  module Orb
4
4
  module Resources
5
5
  class Events
6
+ # The [Event](/core-concepts#event) resource represents a usage event that has
7
+ # been created for a customer. Events are the core of Orb's usage-based billing
8
+ # model, and are used to calculate the usage charges for a given billing period.
6
9
  class Backfills
7
10
  # Creating the backfill enables adding or replacing past events, even those that
8
11
  # are older than the ingestion grace period. Performing a backfill in Orb involves
@@ -3,6 +3,9 @@
3
3
  module Orb
4
4
  module Resources
5
5
  class Events
6
+ # The [Event](/core-concepts#event) resource represents a usage event that has
7
+ # been created for a customer. Events are the core of Orb's usage-based billing
8
+ # model, and are used to calculate the usage charges for a given billing period.
6
9
  class Volume
7
10
  # This endpoint returns the event volume for an account in a
8
11
  # [paginated list format](/api-reference/pagination).
@@ -2,10 +2,19 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # The [Event](/core-concepts#event) resource represents a usage event that has
6
+ # been created for a customer. Events are the core of Orb's usage-based billing
7
+ # model, and are used to calculate the usage charges for a given billing period.
5
8
  class Events
9
+ # The [Event](/core-concepts#event) resource represents a usage event that has
10
+ # been created for a customer. Events are the core of Orb's usage-based billing
11
+ # model, and are used to calculate the usage charges for a given billing period.
6
12
  sig { returns(Orb::Resources::Events::Backfills) }
7
13
  attr_reader :backfills
8
14
 
15
+ # The [Event](/core-concepts#event) resource represents a usage event that has
16
+ # been created for a customer. Events are the core of Orb's usage-based billing
17
+ # model, and are used to calculate the usage charges for a given billing period.
9
18
  sig { returns(Orb::Resources::Events::Volume) }
10
19
  attr_reader :volume
11
20
 
@@ -2,6 +2,11 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity,
6
+ # representing the request for payment for a single subscription. This includes a
7
+ # set of line items, which correspond to prices in the subscription's plan and can
8
+ # represent fixed recurring fees or usage-based fees. They are generated at the
9
+ # end of a billing period, or as the result of an action, such as a cancellation.
5
10
  class InvoiceLineItems
6
11
  # This creates a one-off fixed fee invoice line item on an Invoice. This can only
7
12
  # be done for invoices that are in a `draft` status.
@@ -2,6 +2,11 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity,
6
+ # representing the request for payment for a single subscription. This includes a
7
+ # set of line items, which correspond to prices in the subscription's plan and can
8
+ # represent fixed recurring fees or usage-based fees. They are generated at the
9
+ # end of a billing period, or as the result of an action, such as a cancellation.
5
10
  class Invoices
6
11
  # This endpoint is used to create a one-off invoice for a customer.
7
12
  sig do
@@ -9,6 +14,7 @@ module Orb
9
14
  currency: String,
10
15
  invoice_date: Time,
11
16
  line_items: T::Array[Orb::InvoiceCreateParams::LineItem::OrHash],
17
+ auto_collection: T.nilable(T::Boolean),
12
18
  customer_id: T.nilable(String),
13
19
  discount:
14
20
  T.nilable(
@@ -36,6 +42,10 @@ module Orb
36
42
  # set to the current time in the customer's timezone.
37
43
  invoice_date:,
38
44
  line_items:,
45
+ # Determines whether this invoice will automatically attempt to charge a saved
46
+ # payment method, if any. If not specified, the invoice inherits the customer's
47
+ # auto_collection setting.
48
+ auto_collection: nil,
39
49
  # The id of the `Customer` to create this invoice for. One of `customer_id` and
40
50
  # `external_customer_id` are required.
41
51
  customer_id: nil,
@@ -68,16 +78,18 @@ module Orb
68
78
  )
69
79
  end
70
80
 
71
- # This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and
72
- # `invoice_date` properties on an invoice. If you pass null for the metadata
73
- # value, it will clear any existing metadata for that invoice.
81
+ # This endpoint allows you to update the `metadata`, `net_terms`, `due_date`,
82
+ # `invoice_date`, and `auto_collection` properties on an invoice. If you pass null
83
+ # for the metadata value, it will clear any existing metadata for that invoice.
74
84
  #
75
85
  # `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
76
- # and `invoice_date` can only be modified if the invoice is in a `draft` state.
77
- # `invoice_date` can only be modified for non-subscription invoices.
86
+ # `invoice_date`, and `auto_collection` can only be modified if the invoice is in
87
+ # a `draft` state. `invoice_date` can only be modified for non-subscription
88
+ # invoices.
78
89
  sig do
79
90
  params(
80
91
  invoice_id: String,
92
+ auto_collection: T.nilable(T::Boolean),
81
93
  due_date: T.nilable(Orb::InvoiceUpdateParams::DueDate::Variants),
82
94
  invoice_date:
83
95
  T.nilable(Orb::InvoiceUpdateParams::InvoiceDate::Variants),
@@ -88,6 +100,10 @@ module Orb
88
100
  end
89
101
  def update(
90
102
  invoice_id,
103
+ # Determines whether this invoice will automatically attempt to charge a saved
104
+ # payment method, if any. Can only be modified on draft invoices. If not
105
+ # specified, the invoice's existing setting is unchanged.
106
+ auto_collection: nil,
91
107
  # An optional custom due date for the invoice. If not set, the due date will be
92
108
  # calculated based on the `net_terms` value.
93
109
  due_date: nil,
@@ -2,6 +2,9 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # The Item resource represents a sellable product or good. Items are associated
6
+ # with all line items, billable metrics, and prices and are used for defining
7
+ # external sync behavior for invoices and tax calculation purposes.
5
8
  class Items
6
9
  # This endpoint is used to create an [Item](/core-concepts#item).
7
10
  sig do
@@ -2,6 +2,9 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # The LicenseType resource represents a type of license that can be assigned to
6
+ # users. License types are used during billing by grouping metrics on the
7
+ # configured grouping key.
5
8
  class LicenseTypes
6
9
  # This endpoint is used to create a new license type.
7
10
  #
@@ -2,6 +2,9 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # The Metric resource represents a calculation of a quantity based on events.
6
+ # Metrics are defined by the query that transforms raw usage events into
7
+ # meaningful values for your customers.
5
8
  class Metrics
6
9
  # This endpoint is used to create a [metric](/core-concepts###metric) using a SQL
7
10
  # string. See [SQL support](/extensibility/advanced-metrics#sql-support) for a
@@ -3,6 +3,10 @@
3
3
  module Orb
4
4
  module Resources
5
5
  class Plans
6
+ # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
7
+ # subscribed to by a customer. Plans define the billing behavior of the
8
+ # subscription. You can see more about how to configure prices in the
9
+ # [Price resource](/reference/price).
6
10
  class ExternalPlanID
7
11
  # This endpoint can be used to update the `external_plan_id`, and `metadata` of an
8
12
  # existing plan.
@@ -3,6 +3,10 @@
3
3
  module Orb
4
4
  module Resources
5
5
  class Plans
6
+ # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
7
+ # subscribed to by a customer. Plans define the billing behavior of the
8
+ # subscription. You can see more about how to configure prices in the
9
+ # [Price resource](/reference/price).
6
10
  class Migrations
7
11
  # Fetch migration
8
12
  sig do
@@ -2,10 +2,22 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
6
+ # subscribed to by a customer. Plans define the billing behavior of the
7
+ # subscription. You can see more about how to configure prices in the
8
+ # [Price resource](/reference/price).
5
9
  class Plans
10
+ # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
11
+ # subscribed to by a customer. Plans define the billing behavior of the
12
+ # subscription. You can see more about how to configure prices in the
13
+ # [Price resource](/reference/price).
6
14
  sig { returns(Orb::Resources::Plans::ExternalPlanID) }
7
15
  attr_reader :external_plan_id
8
16
 
17
+ # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
18
+ # subscribed to by a customer. Plans define the billing behavior of the
19
+ # subscription. You can see more about how to configure prices in the
20
+ # [Price resource](/reference/price).
9
21
  sig { returns(Orb::Resources::Plans::Migrations) }
10
22
  attr_reader :migrations
11
23
 
@@ -3,6 +3,16 @@
3
3
  module Orb
4
4
  module Resources
5
5
  class Prices
6
+ # The Price resource represents a price that can be billed on a subscription,
7
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
8
+ # take a quantity and determine an amount to bill.
9
+ #
10
+ # Orb supports a few different pricing models out of the box. Each of these models
11
+ # is serialized differently in a given Price object. The model_type field
12
+ # determines the key for the configuration object that is present.
13
+ #
14
+ # For more on the types of prices, see
15
+ # [the core concepts documentation](/core-concepts#plan-and-price)
6
16
  class ExternalPriceID
7
17
  # This endpoint allows you to update the `metadata` property on a price. If you
8
18
  # pass null for the metadata value, it will clear any existing metadata for that
@@ -2,7 +2,27 @@
2
2
 
3
3
  module Orb
4
4
  module Resources
5
+ # The Price resource represents a price that can be billed on a subscription,
6
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
7
+ # take a quantity and determine an amount to bill.
8
+ #
9
+ # Orb supports a few different pricing models out of the box. Each of these models
10
+ # is serialized differently in a given Price object. The model_type field
11
+ # determines the key for the configuration object that is present.
12
+ #
13
+ # For more on the types of prices, see
14
+ # [the core concepts documentation](/core-concepts#plan-and-price)
5
15
  class Prices
16
+ # The Price resource represents a price that can be billed on a subscription,
17
+ # resulting in a charge on an invoice in the form of an invoice line item. Prices
18
+ # take a quantity and determine an amount to bill.
19
+ #
20
+ # Orb supports a few different pricing models out of the box. Each of these models
21
+ # is serialized differently in a given Price object. The model_type field
22
+ # determines the key for the configuration object that is present.
23
+ #
24
+ # For more on the types of prices, see
25
+ # [the core concepts documentation](/core-concepts#plan-and-price)
6
26
  sig { returns(Orb::Resources::Prices::ExternalPriceID) }
7
27
  attr_reader :external_price_id
8
28
 
@@ -284,6 +304,7 @@ module Orb
284
304
  external_customer_id: T.nilable(String),
285
305
  filter: T.nilable(String),
286
306
  grouping_keys: T::Array[String],
307
+ metric_parameter_overrides: T.nilable(T::Hash[Symbol, T.anything]),
287
308
  request_options: Orb::RequestOptions::OrHash
288
309
  ).returns(Orb::Models::PriceEvaluateResponse)
289
310
  end
@@ -305,6 +326,9 @@ module Orb
305
326
  # [computed properties](/extensibility/advanced-metrics#computed-properties)) used
306
327
  # to group the underlying billable metric
307
328
  grouping_keys: nil,
329
+ # Optional overrides for parameterized billable metric parameters. If the metric
330
+ # has parameter definitions and no overrides are provided, defaults will be used.
331
+ metric_parameter_overrides: nil,
308
332
  request_options: {}
309
333
  )
310
334
  end
@@ -106,6 +106,16 @@ module Orb
106
106
  JSON_CONTENT: Regexp
107
107
  JSONL_CONTENT: Regexp
108
108
 
109
+ def encode_query_params: (
110
+ ::Hash[Symbol, top] query
111
+ ) -> ::Hash[Symbol, top]
112
+
113
+ private def write_query_param_element!: (
114
+ ::Hash[Symbol, top] collection,
115
+ String key,
116
+ top element
117
+ ) -> nil
118
+
109
119
  def self?.write_multipart_content: (
110
120
  Enumerator::Yielder y,
111
121
  val: top,
@@ -7,7 +7,8 @@ module Orb
7
7
  item: Orb::Item,
8
8
  metadata: ::Hash[Symbol, String],
9
9
  name: String,
10
- status: Orb::Models::BillableMetric::status
10
+ status: Orb::Models::BillableMetric::status,
11
+ parameter_definitions: ::Array[::Hash[Symbol, top]]?
11
12
  }
12
13
 
13
14
  class BillableMetric < Orb::Internal::Type::BaseModel
@@ -23,13 +24,16 @@ module Orb
23
24
 
24
25
  attr_accessor status: Orb::Models::BillableMetric::status
25
26
 
27
+ attr_accessor parameter_definitions: ::Array[::Hash[Symbol, top]]?
28
+
26
29
  def initialize: (
27
30
  id: String,
28
31
  description: String?,
29
32
  item: Orb::Item,
30
33
  metadata: ::Hash[Symbol, String],
31
34
  name: String,
32
- status: Orb::Models::BillableMetric::status
35
+ status: Orb::Models::BillableMetric::status,
36
+ ?parameter_definitions: ::Array[::Hash[Symbol, top]]?
33
37
  ) -> void
34
38
 
35
39
  def to_hash: -> {
@@ -38,7 +42,8 @@ module Orb
38
42
  item: Orb::Item,
39
43
  metadata: ::Hash[Symbol, String],
40
44
  name: String,
41
- status: Orb::Models::BillableMetric::status
45
+ status: Orb::Models::BillableMetric::status,
46
+ parameter_definitions: ::Array[::Hash[Symbol, top]]?
42
47
  }
43
48
 
44
49
  type status = :active | :draft | :archived
@@ -148,6 +148,7 @@ module Orb
148
148
  custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::custom_due_date?,
149
149
  invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::invoice_date?,
150
150
  item_id: String?,
151
+ mark_as_paid: bool,
151
152
  memo: String?,
152
153
  net_terms: Integer?,
153
154
  require_successful_payment: bool
@@ -162,6 +163,10 @@ module Orb
162
163
 
163
164
  attr_accessor item_id: String?
164
165
 
166
+ attr_reader mark_as_paid: bool?
167
+
168
+ def mark_as_paid=: (bool) -> bool
169
+
165
170
  attr_accessor memo: String?
166
171
 
167
172
  attr_accessor net_terms: Integer?
@@ -175,6 +180,7 @@ module Orb
175
180
  ?custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::custom_due_date?,
176
181
  ?invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::invoice_date?,
177
182
  ?item_id: String?,
183
+ ?mark_as_paid: bool,
178
184
  ?memo: String?,
179
185
  ?net_terms: Integer?,
180
186
  ?require_successful_payment: bool
@@ -185,6 +191,7 @@ module Orb
185
191
  custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::custom_due_date?,
186
192
  invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::invoice_date?,
187
193
  item_id: String?,
194
+ mark_as_paid: bool,
188
195
  memo: String?,
189
196
  net_terms: Integer?,
190
197
  require_successful_payment: bool
@@ -148,6 +148,7 @@ module Orb
148
148
  custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::custom_due_date?,
149
149
  invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::invoice_date?,
150
150
  item_id: String?,
151
+ mark_as_paid: bool,
151
152
  memo: String?,
152
153
  net_terms: Integer?,
153
154
  require_successful_payment: bool
@@ -162,6 +163,10 @@ module Orb
162
163
 
163
164
  attr_accessor item_id: String?
164
165
 
166
+ attr_reader mark_as_paid: bool?
167
+
168
+ def mark_as_paid=: (bool) -> bool
169
+
165
170
  attr_accessor memo: String?
166
171
 
167
172
  attr_accessor net_terms: Integer?
@@ -175,6 +180,7 @@ module Orb
175
180
  ?custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::custom_due_date?,
176
181
  ?invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::invoice_date?,
177
182
  ?item_id: String?,
183
+ ?mark_as_paid: bool,
178
184
  ?memo: String?,
179
185
  ?net_terms: Integer?,
180
186
  ?require_successful_payment: bool
@@ -185,6 +191,7 @@ module Orb
185
191
  custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::custom_due_date?,
186
192
  invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::invoice_date?,
187
193
  item_id: String?,
194
+ mark_as_paid: bool,
188
195
  memo: String?,
189
196
  net_terms: Integer?,
190
197
  require_successful_payment: bool
@@ -5,6 +5,7 @@ module Orb
5
5
  currency: String,
6
6
  invoice_date: Time,
7
7
  line_items: ::Array[Orb::InvoiceCreateParams::LineItem],
8
+ auto_collection: bool?,
8
9
  customer_id: String?,
9
10
  discount: Orb::Models::discount?,
10
11
  due_date: Orb::Models::InvoiceCreateParams::due_date?,
@@ -26,6 +27,8 @@ module Orb
26
27
 
27
28
  attr_accessor line_items: ::Array[Orb::InvoiceCreateParams::LineItem]
28
29
 
30
+ attr_accessor auto_collection: bool?
31
+
29
32
  attr_accessor customer_id: String?
30
33
 
31
34
  attr_accessor discount: Orb::Models::discount?
@@ -48,6 +51,7 @@ module Orb
48
51
  currency: String,
49
52
  invoice_date: Time,
50
53
  line_items: ::Array[Orb::InvoiceCreateParams::LineItem],
54
+ ?auto_collection: bool?,
51
55
  ?customer_id: String?,
52
56
  ?discount: Orb::Models::discount?,
53
57
  ?due_date: Orb::Models::InvoiceCreateParams::due_date?,
@@ -63,6 +67,7 @@ module Orb
63
67
  currency: String,
64
68
  invoice_date: Time,
65
69
  line_items: ::Array[Orb::InvoiceCreateParams::LineItem],
70
+ auto_collection: bool?,
66
71
  customer_id: String?,
67
72
  discount: Orb::Models::discount?,
68
73
  due_date: Orb::Models::InvoiceCreateParams::due_date?,
@@ -2,6 +2,7 @@ module Orb
2
2
  module Models
3
3
  type invoice_update_params =
4
4
  {
5
+ auto_collection: bool?,
5
6
  due_date: Orb::Models::InvoiceUpdateParams::due_date?,
6
7
  invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?,
7
8
  metadata: ::Hash[Symbol, String?]?,
@@ -13,6 +14,8 @@ module Orb
13
14
  extend Orb::Internal::Type::RequestParameters::Converter
14
15
  include Orb::Internal::Type::RequestParameters
15
16
 
17
+ attr_accessor auto_collection: bool?
18
+
16
19
  attr_accessor due_date: Orb::Models::InvoiceUpdateParams::due_date?
17
20
 
18
21
  attr_accessor invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?
@@ -22,6 +25,7 @@ module Orb
22
25
  attr_accessor net_terms: Integer?
23
26
 
24
27
  def initialize: (
28
+ ?auto_collection: bool?,
25
29
  ?due_date: Orb::Models::InvoiceUpdateParams::due_date?,
26
30
  ?invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?,
27
31
  ?metadata: ::Hash[Symbol, String?]?,
@@ -30,6 +34,7 @@ module Orb
30
34
  ) -> void
31
35
 
32
36
  def to_hash: -> {
37
+ auto_collection: bool?,
33
38
  due_date: Orb::Models::InvoiceUpdateParams::due_date?,
34
39
  invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?,
35
40
  metadata: ::Hash[Symbol, String?]?,
@@ -71,6 +71,7 @@ module Orb
71
71
  | :avalara
72
72
  | :anrok
73
73
  | :numeral
74
+ | :stripe_tax
74
75
 
75
76
  module ExternalConnectionName
76
77
  extend Orb::Internal::Type::Enum
@@ -83,6 +84,7 @@ module Orb
83
84
  AVALARA: :avalara
84
85
  ANROK: :anrok
85
86
  NUMERAL: :numeral
87
+ STRIPE_TAX: :stripe_tax
86
88
 
87
89
  def self?.values: -> ::Array[Orb::Models::Item::ExternalConnection::external_connection_name]
88
90
  end
@@ -62,6 +62,7 @@ module Orb
62
62
  | :avalara
63
63
  | :anrok
64
64
  | :numeral
65
+ | :stripe_tax
65
66
 
66
67
  module ExternalConnectionName
67
68
  extend Orb::Internal::Type::Enum
@@ -74,6 +75,7 @@ module Orb
74
75
  AVALARA: :avalara
75
76
  ANROK: :anrok
76
77
  NUMERAL: :numeral
78
+ STRIPE_TAX: :stripe_tax
77
79
 
78
80
  def self?.values: -> ::Array[Orb::Models::ItemUpdateParams::ExternalConnection::external_connection_name]
79
81
  end
@@ -132,6 +132,7 @@ module Orb
132
132
  first_dimension: String,
133
133
  matrix_scaling_factors: ::Array[Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor],
134
134
  unit_price: String,
135
+ grouping_key: String?,
135
136
  prorate: bool?,
136
137
  second_dimension: String?
137
138
  }
@@ -143,6 +144,8 @@ module Orb
143
144
 
144
145
  attr_accessor unit_price: String
145
146
 
147
+ attr_accessor grouping_key: String?
148
+
146
149
  attr_accessor prorate: bool?
147
150
 
148
151
  attr_accessor second_dimension: String?
@@ -151,6 +154,7 @@ module Orb
151
154
  first_dimension: String,
152
155
  matrix_scaling_factors: ::Array[Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor],
153
156
  unit_price: String,
157
+ ?grouping_key: String?,
154
158
  ?prorate: bool?,
155
159
  ?second_dimension: String?
156
160
  ) -> void
@@ -159,6 +163,7 @@ module Orb
159
163
  first_dimension: String,
160
164
  matrix_scaling_factors: ::Array[Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor],
161
165
  unit_price: String,
166
+ grouping_key: String?,
162
167
  prorate: bool?,
163
168
  second_dimension: String?
164
169
  }
@@ -137,6 +137,7 @@ module Orb
137
137
  first_dimension: String,
138
138
  matrix_scaling_factors: ::Array[Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor],
139
139
  unit_price: String,
140
+ grouping_key: String?,
140
141
  prorate: bool?,
141
142
  second_dimension: String?
142
143
  }
@@ -148,6 +149,8 @@ module Orb
148
149
 
149
150
  attr_accessor unit_price: String
150
151
 
152
+ attr_accessor grouping_key: String?
153
+
151
154
  attr_accessor prorate: bool?
152
155
 
153
156
  attr_accessor second_dimension: String?
@@ -156,6 +159,7 @@ module Orb
156
159
  first_dimension: String,
157
160
  matrix_scaling_factors: ::Array[Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor],
158
161
  unit_price: String,
162
+ ?grouping_key: String?,
159
163
  ?prorate: bool?,
160
164
  ?second_dimension: String?
161
165
  ) -> void
@@ -164,6 +168,7 @@ module Orb
164
168
  first_dimension: String,
165
169
  matrix_scaling_factors: ::Array[Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor],
166
170
  unit_price: String,
171
+ grouping_key: String?,
167
172
  prorate: bool?,
168
173
  second_dimension: String?
169
174
  }
@@ -137,6 +137,7 @@ module Orb
137
137
  first_dimension: String,
138
138
  matrix_scaling_factors: ::Array[Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor],
139
139
  unit_price: String,
140
+ grouping_key: String?,
140
141
  prorate: bool?,
141
142
  second_dimension: String?
142
143
  }
@@ -148,6 +149,8 @@ module Orb
148
149
 
149
150
  attr_accessor unit_price: String
150
151
 
152
+ attr_accessor grouping_key: String?
153
+
151
154
  attr_accessor prorate: bool?
152
155
 
153
156
  attr_accessor second_dimension: String?
@@ -156,6 +159,7 @@ module Orb
156
159
  first_dimension: String,
157
160
  matrix_scaling_factors: ::Array[Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor],
158
161
  unit_price: String,
162
+ ?grouping_key: String?,
159
163
  ?prorate: bool?,
160
164
  ?second_dimension: String?
161
165
  ) -> void
@@ -164,6 +168,7 @@ module Orb
164
168
  first_dimension: String,
165
169
  matrix_scaling_factors: ::Array[Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor],
166
170
  unit_price: String,
171
+ grouping_key: String?,
167
172
  prorate: bool?,
168
173
  second_dimension: String?
169
174
  }