orb-billing 0.5.5 → 0.7.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 (205) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +4 -0
  5. data/lib/orb/internal/type/base_model.rb +2 -2
  6. data/lib/orb/internal/type/union.rb +6 -6
  7. data/lib/orb/models/alert.rb +33 -1
  8. data/lib/orb/models/amount_discount.rb +10 -10
  9. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +17940 -0
  10. data/lib/orb/models/beta/external_plan_id_fetch_plan_version_params.rb +22 -0
  11. data/lib/orb/models/beta/external_plan_id_set_default_plan_version_params.rb +24 -0
  12. data/lib/orb/models/beta_create_plan_version_params.rb +17758 -0
  13. data/lib/orb/models/beta_fetch_plan_version_params.rb +20 -0
  14. data/lib/orb/models/beta_set_default_plan_version_params.rb +22 -0
  15. data/lib/orb/models/credit_note_create_params.rb +9 -9
  16. data/lib/orb/models/customer_create_params.rb +21 -3
  17. data/lib/orb/models/customer_update_by_external_id_params.rb +21 -3
  18. data/lib/orb/models/customer_update_params.rb +21 -3
  19. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb +9 -1
  20. data/lib/orb/models/customers/credits/ledger_create_entry_response.rb +9 -1
  21. data/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb +9 -1
  22. data/lib/orb/models/customers/credits/ledger_list_response.rb +9 -1
  23. data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +1 -1
  24. data/lib/orb/models/customers/credits/top_up_create_params.rb +1 -1
  25. data/lib/orb/models/invoice.rb +626 -9
  26. data/lib/orb/models/invoice_fetch_upcoming_response.rb +624 -9
  27. data/lib/orb/models/invoice_line_item_create_response.rb +486 -7
  28. data/lib/orb/models/item.rb +18 -1
  29. data/lib/orb/models/item_archive_params.rb +14 -0
  30. data/lib/orb/models/item_create_params.rb +14 -1
  31. data/lib/orb/models/item_update_params.rb +16 -1
  32. data/lib/orb/models/percentage_discount.rb +10 -10
  33. data/lib/orb/models/plan.rb +618 -9
  34. data/lib/orb/models/plan_create_params.rb +2066 -30
  35. data/lib/orb/models/plan_version.rb +735 -0
  36. data/lib/orb/models/plan_version_phase.rb +70 -0
  37. data/lib/orb/models/price.rb +4124 -70
  38. data/lib/orb/models/price_create_params.rb +45 -1
  39. data/lib/orb/models/price_evaluate_multiple_params.rb +8620 -0
  40. data/lib/orb/models/price_evaluate_multiple_response.rb +51 -0
  41. data/lib/orb/models/subscription.rb +730 -54
  42. data/lib/orb/models/subscription_cancel_response.rb +706 -54
  43. data/lib/orb/models/subscription_change_apply_response.rb +728 -54
  44. data/lib/orb/models/subscription_change_cancel_response.rb +728 -54
  45. data/lib/orb/models/subscription_change_retrieve_response.rb +728 -54
  46. data/lib/orb/models/subscription_create_params.rb +5992 -1698
  47. data/lib/orb/models/subscription_create_response.rb +706 -54
  48. data/lib/orb/models/subscription_fetch_schedule_response.rb +3 -3
  49. data/lib/orb/models/subscription_price_intervals_params.rb +1392 -76
  50. data/lib/orb/models/subscription_price_intervals_response.rb +712 -54
  51. data/lib/orb/models/subscription_schedule_plan_change_params.rb +6005 -1723
  52. data/lib/orb/models/subscription_schedule_plan_change_response.rb +716 -54
  53. data/lib/orb/models/subscription_trigger_phase_response.rb +708 -54
  54. data/lib/orb/models/subscription_unschedule_cancellation_response.rb +720 -54
  55. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb +728 -54
  56. data/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb +728 -54
  57. data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +1 -1
  58. data/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb +720 -54
  59. data/lib/orb/models/subscription_update_trial_response.rb +706 -54
  60. data/lib/orb/models/trial_discount.rb +10 -10
  61. data/lib/orb/models/usage_discount.rb +10 -10
  62. data/lib/orb/models.rb +16 -0
  63. data/lib/orb/resources/beta/external_plan_id.rb +113 -0
  64. data/lib/orb/resources/beta.rb +115 -0
  65. data/lib/orb/resources/credit_notes.rb +3 -3
  66. data/lib/orb/resources/customers/balance_transactions.rb +0 -7
  67. data/lib/orb/resources/customers.rb +4 -7
  68. data/lib/orb/resources/dimensional_price_groups.rb +1 -1
  69. data/lib/orb/resources/items.rb +34 -2
  70. data/lib/orb/resources/plans/external_plan_id.rb +1 -1
  71. data/lib/orb/resources/plans.rb +2 -2
  72. data/lib/orb/resources/prices.rb +69 -2
  73. data/lib/orb/resources/subscriptions.rb +5 -1
  74. data/lib/orb/version.rb +1 -1
  75. data/lib/orb.rb +13 -0
  76. data/rbi/orb/client.rbi +3 -0
  77. data/rbi/orb/models/alert.rbi +50 -3
  78. data/rbi/orb/models/amount_discount.rbi +8 -8
  79. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +32652 -0
  80. data/rbi/orb/models/beta/external_plan_id_fetch_plan_version_params.rbi +40 -0
  81. data/rbi/orb/models/beta/external_plan_id_set_default_plan_version_params.rbi +45 -0
  82. data/rbi/orb/models/beta_create_plan_version_params.rbi +32595 -0
  83. data/rbi/orb/models/beta_fetch_plan_version_params.rbi +35 -0
  84. data/rbi/orb/models/beta_set_default_plan_version_params.rbi +40 -0
  85. data/rbi/orb/models/credit_note_create_params.rbi +8 -8
  86. data/rbi/orb/models/customer_create_params.rbi +38 -4
  87. data/rbi/orb/models/customer_update_by_external_id_params.rbi +38 -4
  88. data/rbi/orb/models/customer_update_params.rbi +38 -4
  89. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi +9 -1
  90. data/rbi/orb/models/customers/credits/ledger_create_entry_response.rbi +9 -1
  91. data/rbi/orb/models/customers/credits/ledger_list_by_external_id_response.rbi +9 -1
  92. data/rbi/orb/models/customers/credits/ledger_list_response.rbi +9 -1
  93. data/rbi/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +2 -2
  94. data/rbi/orb/models/customers/credits/top_up_create_params.rbi +2 -2
  95. data/rbi/orb/models/invoice.rbi +1451 -35
  96. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +1524 -4
  97. data/rbi/orb/models/invoice_line_item_create_response.rbi +1184 -2
  98. data/rbi/orb/models/item.rbi +20 -1
  99. data/rbi/orb/models/item_archive_params.rbi +25 -0
  100. data/rbi/orb/models/item_create_params.rbi +18 -1
  101. data/rbi/orb/models/item_update_params.rbi +17 -1
  102. data/rbi/orb/models/percentage_discount.rbi +10 -10
  103. data/rbi/orb/models/plan.rbi +1339 -4
  104. data/rbi/orb/models/plan_create_params.rbi +3833 -29
  105. data/rbi/orb/models/plan_version.rbi +1367 -0
  106. data/rbi/orb/models/plan_version_phase.rbi +99 -0
  107. data/rbi/orb/models/price.rbi +9447 -441
  108. data/rbi/orb/models/price_create_params.rbi +80 -0
  109. data/rbi/orb/models/price_evaluate_multiple_params.rbi +15764 -0
  110. data/rbi/orb/models/price_evaluate_multiple_response.rbi +96 -0
  111. data/rbi/orb/models/subscription.rbi +1654 -44
  112. data/rbi/orb/models/subscription_cancel_response.rbi +1692 -44
  113. data/rbi/orb/models/subscription_change_apply_response.rbi +1692 -44
  114. data/rbi/orb/models/subscription_change_cancel_response.rbi +1692 -44
  115. data/rbi/orb/models/subscription_change_retrieve_response.rbi +1692 -44
  116. data/rbi/orb/models/subscription_create_params.rbi +10400 -2710
  117. data/rbi/orb/models/subscription_create_response.rbi +1692 -44
  118. data/rbi/orb/models/subscription_fetch_schedule_response.rbi +13 -4
  119. data/rbi/orb/models/subscription_price_intervals_params.rbi +2401 -49
  120. data/rbi/orb/models/subscription_price_intervals_response.rbi +1692 -44
  121. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +10423 -2753
  122. data/rbi/orb/models/subscription_schedule_plan_change_response.rbi +1692 -44
  123. data/rbi/orb/models/subscription_trigger_phase_response.rbi +1692 -44
  124. data/rbi/orb/models/subscription_unschedule_cancellation_response.rbi +1692 -44
  125. data/rbi/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi +1692 -44
  126. data/rbi/orb/models/subscription_unschedule_pending_plan_changes_response.rbi +1692 -44
  127. data/rbi/orb/models/subscription_update_fixed_fee_quantity_params.rbi +2 -2
  128. data/rbi/orb/models/subscription_update_fixed_fee_quantity_response.rbi +1692 -44
  129. data/rbi/orb/models/subscription_update_trial_response.rbi +1692 -44
  130. data/rbi/orb/models/trial_discount.rbi +8 -8
  131. data/rbi/orb/models/usage_discount.rbi +10 -10
  132. data/rbi/orb/models.rbi +16 -0
  133. data/rbi/orb/resources/beta/external_plan_id.rbi +118 -0
  134. data/rbi/orb/resources/beta.rbi +111 -0
  135. data/rbi/orb/resources/credit_notes.rbi +3 -3
  136. data/rbi/orb/resources/customers/balance_transactions.rbi +0 -7
  137. data/rbi/orb/resources/customers/credits/top_ups.rbi +2 -2
  138. data/rbi/orb/resources/customers.rbi +7 -7
  139. data/rbi/orb/resources/dimensional_price_groups.rbi +1 -1
  140. data/rbi/orb/resources/items.rbi +20 -0
  141. data/rbi/orb/resources/plans/external_plan_id.rbi +1 -1
  142. data/rbi/orb/resources/plans.rbi +5 -2
  143. data/rbi/orb/resources/prices.rbi +73 -1
  144. data/rbi/orb/resources/subscriptions.rbi +9 -1
  145. data/sig/orb/client.rbs +2 -0
  146. data/sig/orb/models/alert.rbs +20 -3
  147. data/sig/orb/models/amount_discount.rbs +5 -5
  148. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +12898 -0
  149. data/sig/orb/models/beta/external_plan_id_fetch_plan_version_params.rbs +25 -0
  150. data/sig/orb/models/beta/external_plan_id_set_default_plan_version_params.rbs +25 -0
  151. data/sig/orb/models/beta_create_plan_version_params.rbs +12877 -0
  152. data/sig/orb/models/beta_fetch_plan_version_params.rbs +20 -0
  153. data/sig/orb/models/beta_set_default_plan_version_params.rbs +20 -0
  154. data/sig/orb/models/credit_note_create_params.rbs +6 -6
  155. data/sig/orb/models/customer_create_params.rbs +13 -0
  156. data/sig/orb/models/customer_update_by_external_id_params.rbs +13 -0
  157. data/sig/orb/models/customer_update_params.rbs +13 -0
  158. data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbs +7 -2
  159. data/sig/orb/models/customers/credits/ledger_create_entry_response.rbs +7 -2
  160. data/sig/orb/models/customers/credits/ledger_list_by_external_id_response.rbs +7 -2
  161. data/sig/orb/models/customers/credits/ledger_list_response.rbs +7 -2
  162. data/sig/orb/models/invoice.rbs +558 -4
  163. data/sig/orb/models/invoice_fetch_upcoming_response.rbs +558 -4
  164. data/sig/orb/models/invoice_line_item_create_response.rbs +414 -2
  165. data/sig/orb/models/item.rbs +5 -0
  166. data/sig/orb/models/item_archive_params.rbs +14 -0
  167. data/sig/orb/models/item_create_params.rbs +10 -2
  168. data/sig/orb/models/item_update_params.rbs +5 -0
  169. data/sig/orb/models/percentage_discount.rbs +5 -5
  170. data/sig/orb/models/plan.rbs +538 -4
  171. data/sig/orb/models/plan_create_params.rbs +1460 -3
  172. data/sig/orb/models/plan_version.rbs +583 -0
  173. data/sig/orb/models/plan_version_phase.rbs +60 -0
  174. data/sig/orb/models/price.rbs +3512 -96
  175. data/sig/orb/models/price_create_params.rbs +32 -0
  176. data/sig/orb/models/price_evaluate_multiple_params.rbs +6230 -0
  177. data/sig/orb/models/price_evaluate_multiple_response.rbs +50 -0
  178. data/sig/orb/models/subscription.rbs +609 -29
  179. data/sig/orb/models/subscription_cancel_response.rbs +609 -29
  180. data/sig/orb/models/subscription_change_apply_response.rbs +621 -29
  181. data/sig/orb/models/subscription_change_cancel_response.rbs +621 -29
  182. data/sig/orb/models/subscription_change_retrieve_response.rbs +621 -29
  183. data/sig/orb/models/subscription_create_params.rbs +4450 -1466
  184. data/sig/orb/models/subscription_create_response.rbs +609 -29
  185. data/sig/orb/models/subscription_fetch_schedule_response.rbs +4 -4
  186. data/sig/orb/models/subscription_price_intervals_params.rbs +920 -24
  187. data/sig/orb/models/subscription_price_intervals_response.rbs +609 -29
  188. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +4440 -1466
  189. data/sig/orb/models/subscription_schedule_plan_change_response.rbs +609 -29
  190. data/sig/orb/models/subscription_trigger_phase_response.rbs +609 -29
  191. data/sig/orb/models/subscription_unschedule_cancellation_response.rbs +609 -29
  192. data/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbs +609 -29
  193. data/sig/orb/models/subscription_unschedule_pending_plan_changes_response.rbs +609 -29
  194. data/sig/orb/models/subscription_update_fixed_fee_quantity_response.rbs +609 -29
  195. data/sig/orb/models/subscription_update_trial_response.rbs +609 -29
  196. data/sig/orb/models/trial_discount.rbs +5 -5
  197. data/sig/orb/models/usage_discount.rbs +5 -5
  198. data/sig/orb/models.rbs +16 -0
  199. data/sig/orb/resources/beta/external_plan_id.rbs +34 -0
  200. data/sig/orb/resources/beta.rbs +34 -0
  201. data/sig/orb/resources/credit_notes.rbs +1 -1
  202. data/sig/orb/resources/items.rbs +7 -0
  203. data/sig/orb/resources/prices.rbs +11 -0
  204. data/sig/orb/resources/subscriptions.rbs +2 -0
  205. metadata +40 -1
@@ -1891,6 +1891,16 @@ module Orb
1891
1891
  sig { returns(T::Array[String]) }
1892
1892
  attr_accessor :applies_to_price_ids
1893
1893
 
1894
+ # The filters that determine which prices to apply this adjustment to.
1895
+ sig do
1896
+ returns(
1897
+ T::Array[
1898
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter
1899
+ ]
1900
+ )
1901
+ end
1902
+ attr_accessor :filters
1903
+
1894
1904
  # True for adjustments that apply to an entire invocice, false for adjustments
1895
1905
  # that apply to only one price.
1896
1906
  sig { returns(T::Boolean) }
@@ -1910,6 +1920,10 @@ module Orb
1910
1920
  id: String,
1911
1921
  amount: String,
1912
1922
  applies_to_price_ids: T::Array[String],
1923
+ filters:
1924
+ T::Array[
1925
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::OrHash
1926
+ ],
1913
1927
  is_invoice_level: T::Boolean,
1914
1928
  reason: T.nilable(String),
1915
1929
  usage_discount: Float,
@@ -1922,6 +1936,8 @@ module Orb
1922
1936
  amount:,
1923
1937
  # The price IDs that this adjustment applies to.
1924
1938
  applies_to_price_ids:,
1939
+ # The filters that determine which prices to apply this adjustment to.
1940
+ filters:,
1925
1941
  # True for adjustments that apply to an entire invocice, false for adjustments
1926
1942
  # that apply to only one price.
1927
1943
  is_invoice_level:,
@@ -1941,6 +1957,10 @@ module Orb
1941
1957
  adjustment_type: Symbol,
1942
1958
  amount: String,
1943
1959
  applies_to_price_ids: T::Array[String],
1960
+ filters:
1961
+ T::Array[
1962
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter
1963
+ ],
1944
1964
  is_invoice_level: T::Boolean,
1945
1965
  reason: T.nilable(String),
1946
1966
  usage_discount: Float
@@ -1949,6 +1969,154 @@ module Orb
1949
1969
  end
1950
1970
  def to_hash
1951
1971
  end
1972
+
1973
+ class Filter < Orb::Internal::Type::BaseModel
1974
+ OrHash =
1975
+ T.type_alias do
1976
+ T.any(
1977
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter,
1978
+ Orb::Internal::AnyHash
1979
+ )
1980
+ end
1981
+
1982
+ # The property of the price to filter on.
1983
+ sig do
1984
+ returns(
1985
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
1986
+ )
1987
+ end
1988
+ attr_accessor :field
1989
+
1990
+ # Should prices that match the filter be included or excluded.
1991
+ sig do
1992
+ returns(
1993
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol
1994
+ )
1995
+ end
1996
+ attr_accessor :operator
1997
+
1998
+ # The IDs or values that match this filter.
1999
+ sig { returns(T::Array[String]) }
2000
+ attr_accessor :values
2001
+
2002
+ sig do
2003
+ params(
2004
+ field:
2005
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Field::OrSymbol,
2006
+ operator:
2007
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Operator::OrSymbol,
2008
+ values: T::Array[String]
2009
+ ).returns(T.attached_class)
2010
+ end
2011
+ def self.new(
2012
+ # The property of the price to filter on.
2013
+ field:,
2014
+ # Should prices that match the filter be included or excluded.
2015
+ operator:,
2016
+ # The IDs or values that match this filter.
2017
+ values:
2018
+ )
2019
+ end
2020
+
2021
+ sig do
2022
+ override.returns(
2023
+ {
2024
+ field:
2025
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol,
2026
+ operator:
2027
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol,
2028
+ values: T::Array[String]
2029
+ }
2030
+ )
2031
+ end
2032
+ def to_hash
2033
+ end
2034
+
2035
+ # The property of the price to filter on.
2036
+ module Field
2037
+ extend Orb::Internal::Type::Enum
2038
+
2039
+ TaggedSymbol =
2040
+ T.type_alias do
2041
+ T.all(
2042
+ Symbol,
2043
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Field
2044
+ )
2045
+ end
2046
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2047
+
2048
+ PRICE_ID =
2049
+ T.let(
2050
+ :price_id,
2051
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
2052
+ )
2053
+ ITEM_ID =
2054
+ T.let(
2055
+ :item_id,
2056
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
2057
+ )
2058
+ PRICE_TYPE =
2059
+ T.let(
2060
+ :price_type,
2061
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
2062
+ )
2063
+ CURRENCY =
2064
+ T.let(
2065
+ :currency,
2066
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
2067
+ )
2068
+ PRICING_UNIT_ID =
2069
+ T.let(
2070
+ :pricing_unit_id,
2071
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
2072
+ )
2073
+
2074
+ sig do
2075
+ override.returns(
2076
+ T::Array[
2077
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Field::TaggedSymbol
2078
+ ]
2079
+ )
2080
+ end
2081
+ def self.values
2082
+ end
2083
+ end
2084
+
2085
+ # Should prices that match the filter be included or excluded.
2086
+ module Operator
2087
+ extend Orb::Internal::Type::Enum
2088
+
2089
+ TaggedSymbol =
2090
+ T.type_alias do
2091
+ T.all(
2092
+ Symbol,
2093
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Operator
2094
+ )
2095
+ end
2096
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2097
+
2098
+ INCLUDES =
2099
+ T.let(
2100
+ :includes,
2101
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol
2102
+ )
2103
+ EXCLUDES =
2104
+ T.let(
2105
+ :excludes,
2106
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol
2107
+ )
2108
+
2109
+ sig do
2110
+ override.returns(
2111
+ T::Array[
2112
+ Orb::Invoice::LineItem::Adjustment::UsageDiscount::Filter::Operator::TaggedSymbol
2113
+ ]
2114
+ )
2115
+ end
2116
+ def self.values
2117
+ end
2118
+ end
2119
+ end
1952
2120
  end
1953
2121
 
1954
2122
  class AmountDiscount < Orb::Internal::Type::BaseModel
@@ -1979,6 +2147,16 @@ module Orb
1979
2147
  sig { returns(T::Array[String]) }
1980
2148
  attr_accessor :applies_to_price_ids
1981
2149
 
2150
+ # The filters that determine which prices to apply this adjustment to.
2151
+ sig do
2152
+ returns(
2153
+ T::Array[
2154
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter
2155
+ ]
2156
+ )
2157
+ end
2158
+ attr_accessor :filters
2159
+
1982
2160
  # True for adjustments that apply to an entire invocice, false for adjustments
1983
2161
  # that apply to only one price.
1984
2162
  sig { returns(T::Boolean) }
@@ -1994,6 +2172,10 @@ module Orb
1994
2172
  amount: String,
1995
2173
  amount_discount: String,
1996
2174
  applies_to_price_ids: T::Array[String],
2175
+ filters:
2176
+ T::Array[
2177
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::OrHash
2178
+ ],
1997
2179
  is_invoice_level: T::Boolean,
1998
2180
  reason: T.nilable(String),
1999
2181
  adjustment_type: Symbol
@@ -2008,6 +2190,8 @@ module Orb
2008
2190
  amount_discount:,
2009
2191
  # The price IDs that this adjustment applies to.
2010
2192
  applies_to_price_ids:,
2193
+ # The filters that determine which prices to apply this adjustment to.
2194
+ filters:,
2011
2195
  # True for adjustments that apply to an entire invocice, false for adjustments
2012
2196
  # that apply to only one price.
2013
2197
  is_invoice_level:,
@@ -2025,6 +2209,10 @@ module Orb
2025
2209
  amount: String,
2026
2210
  amount_discount: String,
2027
2211
  applies_to_price_ids: T::Array[String],
2212
+ filters:
2213
+ T::Array[
2214
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter
2215
+ ],
2028
2216
  is_invoice_level: T::Boolean,
2029
2217
  reason: T.nilable(String)
2030
2218
  }
@@ -2032,6 +2220,154 @@ module Orb
2032
2220
  end
2033
2221
  def to_hash
2034
2222
  end
2223
+
2224
+ class Filter < Orb::Internal::Type::BaseModel
2225
+ OrHash =
2226
+ T.type_alias do
2227
+ T.any(
2228
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter,
2229
+ Orb::Internal::AnyHash
2230
+ )
2231
+ end
2232
+
2233
+ # The property of the price to filter on.
2234
+ sig do
2235
+ returns(
2236
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
2237
+ )
2238
+ end
2239
+ attr_accessor :field
2240
+
2241
+ # Should prices that match the filter be included or excluded.
2242
+ sig do
2243
+ returns(
2244
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol
2245
+ )
2246
+ end
2247
+ attr_accessor :operator
2248
+
2249
+ # The IDs or values that match this filter.
2250
+ sig { returns(T::Array[String]) }
2251
+ attr_accessor :values
2252
+
2253
+ sig do
2254
+ params(
2255
+ field:
2256
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Field::OrSymbol,
2257
+ operator:
2258
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Operator::OrSymbol,
2259
+ values: T::Array[String]
2260
+ ).returns(T.attached_class)
2261
+ end
2262
+ def self.new(
2263
+ # The property of the price to filter on.
2264
+ field:,
2265
+ # Should prices that match the filter be included or excluded.
2266
+ operator:,
2267
+ # The IDs or values that match this filter.
2268
+ values:
2269
+ )
2270
+ end
2271
+
2272
+ sig do
2273
+ override.returns(
2274
+ {
2275
+ field:
2276
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol,
2277
+ operator:
2278
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol,
2279
+ values: T::Array[String]
2280
+ }
2281
+ )
2282
+ end
2283
+ def to_hash
2284
+ end
2285
+
2286
+ # The property of the price to filter on.
2287
+ module Field
2288
+ extend Orb::Internal::Type::Enum
2289
+
2290
+ TaggedSymbol =
2291
+ T.type_alias do
2292
+ T.all(
2293
+ Symbol,
2294
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Field
2295
+ )
2296
+ end
2297
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2298
+
2299
+ PRICE_ID =
2300
+ T.let(
2301
+ :price_id,
2302
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
2303
+ )
2304
+ ITEM_ID =
2305
+ T.let(
2306
+ :item_id,
2307
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
2308
+ )
2309
+ PRICE_TYPE =
2310
+ T.let(
2311
+ :price_type,
2312
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
2313
+ )
2314
+ CURRENCY =
2315
+ T.let(
2316
+ :currency,
2317
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
2318
+ )
2319
+ PRICING_UNIT_ID =
2320
+ T.let(
2321
+ :pricing_unit_id,
2322
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
2323
+ )
2324
+
2325
+ sig do
2326
+ override.returns(
2327
+ T::Array[
2328
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Field::TaggedSymbol
2329
+ ]
2330
+ )
2331
+ end
2332
+ def self.values
2333
+ end
2334
+ end
2335
+
2336
+ # Should prices that match the filter be included or excluded.
2337
+ module Operator
2338
+ extend Orb::Internal::Type::Enum
2339
+
2340
+ TaggedSymbol =
2341
+ T.type_alias do
2342
+ T.all(
2343
+ Symbol,
2344
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Operator
2345
+ )
2346
+ end
2347
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2348
+
2349
+ INCLUDES =
2350
+ T.let(
2351
+ :includes,
2352
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol
2353
+ )
2354
+ EXCLUDES =
2355
+ T.let(
2356
+ :excludes,
2357
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol
2358
+ )
2359
+
2360
+ sig do
2361
+ override.returns(
2362
+ T::Array[
2363
+ Orb::Invoice::LineItem::Adjustment::AmountDiscount::Filter::Operator::TaggedSymbol
2364
+ ]
2365
+ )
2366
+ end
2367
+ def self.values
2368
+ end
2369
+ end
2370
+ end
2035
2371
  end
2036
2372
 
2037
2373
  class PercentageDiscount < Orb::Internal::Type::BaseModel
@@ -2057,6 +2393,16 @@ module Orb
2057
2393
  sig { returns(T::Array[String]) }
2058
2394
  attr_accessor :applies_to_price_ids
2059
2395
 
2396
+ # The filters that determine which prices to apply this adjustment to.
2397
+ sig do
2398
+ returns(
2399
+ T::Array[
2400
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter
2401
+ ]
2402
+ )
2403
+ end
2404
+ attr_accessor :filters
2405
+
2060
2406
  # True for adjustments that apply to an entire invocice, false for adjustments
2061
2407
  # that apply to only one price.
2062
2408
  sig { returns(T::Boolean) }
@@ -2076,6 +2422,10 @@ module Orb
2076
2422
  id: String,
2077
2423
  amount: String,
2078
2424
  applies_to_price_ids: T::Array[String],
2425
+ filters:
2426
+ T::Array[
2427
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::OrHash
2428
+ ],
2079
2429
  is_invoice_level: T::Boolean,
2080
2430
  percentage_discount: Float,
2081
2431
  reason: T.nilable(String),
@@ -2088,6 +2438,8 @@ module Orb
2088
2438
  amount:,
2089
2439
  # The price IDs that this adjustment applies to.
2090
2440
  applies_to_price_ids:,
2441
+ # The filters that determine which prices to apply this adjustment to.
2442
+ filters:,
2091
2443
  # True for adjustments that apply to an entire invocice, false for adjustments
2092
2444
  # that apply to only one price.
2093
2445
  is_invoice_level:,
@@ -2107,6 +2459,10 @@ module Orb
2107
2459
  adjustment_type: Symbol,
2108
2460
  amount: String,
2109
2461
  applies_to_price_ids: T::Array[String],
2462
+ filters:
2463
+ T::Array[
2464
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter
2465
+ ],
2110
2466
  is_invoice_level: T::Boolean,
2111
2467
  percentage_discount: Float,
2112
2468
  reason: T.nilable(String)
@@ -2115,6 +2471,154 @@ module Orb
2115
2471
  end
2116
2472
  def to_hash
2117
2473
  end
2474
+
2475
+ class Filter < Orb::Internal::Type::BaseModel
2476
+ OrHash =
2477
+ T.type_alias do
2478
+ T.any(
2479
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter,
2480
+ Orb::Internal::AnyHash
2481
+ )
2482
+ end
2483
+
2484
+ # The property of the price to filter on.
2485
+ sig do
2486
+ returns(
2487
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
2488
+ )
2489
+ end
2490
+ attr_accessor :field
2491
+
2492
+ # Should prices that match the filter be included or excluded.
2493
+ sig do
2494
+ returns(
2495
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol
2496
+ )
2497
+ end
2498
+ attr_accessor :operator
2499
+
2500
+ # The IDs or values that match this filter.
2501
+ sig { returns(T::Array[String]) }
2502
+ attr_accessor :values
2503
+
2504
+ sig do
2505
+ params(
2506
+ field:
2507
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Field::OrSymbol,
2508
+ operator:
2509
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Operator::OrSymbol,
2510
+ values: T::Array[String]
2511
+ ).returns(T.attached_class)
2512
+ end
2513
+ def self.new(
2514
+ # The property of the price to filter on.
2515
+ field:,
2516
+ # Should prices that match the filter be included or excluded.
2517
+ operator:,
2518
+ # The IDs or values that match this filter.
2519
+ values:
2520
+ )
2521
+ end
2522
+
2523
+ sig do
2524
+ override.returns(
2525
+ {
2526
+ field:
2527
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol,
2528
+ operator:
2529
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol,
2530
+ values: T::Array[String]
2531
+ }
2532
+ )
2533
+ end
2534
+ def to_hash
2535
+ end
2536
+
2537
+ # The property of the price to filter on.
2538
+ module Field
2539
+ extend Orb::Internal::Type::Enum
2540
+
2541
+ TaggedSymbol =
2542
+ T.type_alias do
2543
+ T.all(
2544
+ Symbol,
2545
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Field
2546
+ )
2547
+ end
2548
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2549
+
2550
+ PRICE_ID =
2551
+ T.let(
2552
+ :price_id,
2553
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
2554
+ )
2555
+ ITEM_ID =
2556
+ T.let(
2557
+ :item_id,
2558
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
2559
+ )
2560
+ PRICE_TYPE =
2561
+ T.let(
2562
+ :price_type,
2563
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
2564
+ )
2565
+ CURRENCY =
2566
+ T.let(
2567
+ :currency,
2568
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
2569
+ )
2570
+ PRICING_UNIT_ID =
2571
+ T.let(
2572
+ :pricing_unit_id,
2573
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
2574
+ )
2575
+
2576
+ sig do
2577
+ override.returns(
2578
+ T::Array[
2579
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Field::TaggedSymbol
2580
+ ]
2581
+ )
2582
+ end
2583
+ def self.values
2584
+ end
2585
+ end
2586
+
2587
+ # Should prices that match the filter be included or excluded.
2588
+ module Operator
2589
+ extend Orb::Internal::Type::Enum
2590
+
2591
+ TaggedSymbol =
2592
+ T.type_alias do
2593
+ T.all(
2594
+ Symbol,
2595
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Operator
2596
+ )
2597
+ end
2598
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2599
+
2600
+ INCLUDES =
2601
+ T.let(
2602
+ :includes,
2603
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol
2604
+ )
2605
+ EXCLUDES =
2606
+ T.let(
2607
+ :excludes,
2608
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol
2609
+ )
2610
+
2611
+ sig do
2612
+ override.returns(
2613
+ T::Array[
2614
+ Orb::Invoice::LineItem::Adjustment::PercentageDiscount::Filter::Operator::TaggedSymbol
2615
+ ]
2616
+ )
2617
+ end
2618
+ def self.values
2619
+ end
2620
+ end
2621
+ end
2118
2622
  end
2119
2623
 
2120
2624
  class Minimum < Orb::Internal::Type::BaseModel
@@ -2140,6 +2644,14 @@ module Orb
2140
2644
  sig { returns(T::Array[String]) }
2141
2645
  attr_accessor :applies_to_price_ids
2142
2646
 
2647
+ # The filters that determine which prices to apply this adjustment to.
2648
+ sig do
2649
+ returns(
2650
+ T::Array[Orb::Invoice::LineItem::Adjustment::Minimum::Filter]
2651
+ )
2652
+ end
2653
+ attr_accessor :filters
2654
+
2143
2655
  # True for adjustments that apply to an entire invocice, false for adjustments
2144
2656
  # that apply to only one price.
2145
2657
  sig { returns(T::Boolean) }
@@ -2163,6 +2675,10 @@ module Orb
2163
2675
  id: String,
2164
2676
  amount: String,
2165
2677
  applies_to_price_ids: T::Array[String],
2678
+ filters:
2679
+ T::Array[
2680
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::OrHash
2681
+ ],
2166
2682
  is_invoice_level: T::Boolean,
2167
2683
  item_id: String,
2168
2684
  minimum_amount: String,
@@ -2176,6 +2692,8 @@ module Orb
2176
2692
  amount:,
2177
2693
  # The price IDs that this adjustment applies to.
2178
2694
  applies_to_price_ids:,
2695
+ # The filters that determine which prices to apply this adjustment to.
2696
+ filters:,
2179
2697
  # True for adjustments that apply to an entire invocice, false for adjustments
2180
2698
  # that apply to only one price.
2181
2699
  is_invoice_level:,
@@ -2197,6 +2715,10 @@ module Orb
2197
2715
  adjustment_type: Symbol,
2198
2716
  amount: String,
2199
2717
  applies_to_price_ids: T::Array[String],
2718
+ filters:
2719
+ T::Array[
2720
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter
2721
+ ],
2200
2722
  is_invoice_level: T::Boolean,
2201
2723
  item_id: String,
2202
2724
  minimum_amount: String,
@@ -2206,6 +2728,154 @@ module Orb
2206
2728
  end
2207
2729
  def to_hash
2208
2730
  end
2731
+
2732
+ class Filter < Orb::Internal::Type::BaseModel
2733
+ OrHash =
2734
+ T.type_alias do
2735
+ T.any(
2736
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter,
2737
+ Orb::Internal::AnyHash
2738
+ )
2739
+ end
2740
+
2741
+ # The property of the price to filter on.
2742
+ sig do
2743
+ returns(
2744
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Field::TaggedSymbol
2745
+ )
2746
+ end
2747
+ attr_accessor :field
2748
+
2749
+ # Should prices that match the filter be included or excluded.
2750
+ sig do
2751
+ returns(
2752
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Operator::TaggedSymbol
2753
+ )
2754
+ end
2755
+ attr_accessor :operator
2756
+
2757
+ # The IDs or values that match this filter.
2758
+ sig { returns(T::Array[String]) }
2759
+ attr_accessor :values
2760
+
2761
+ sig do
2762
+ params(
2763
+ field:
2764
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Field::OrSymbol,
2765
+ operator:
2766
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Operator::OrSymbol,
2767
+ values: T::Array[String]
2768
+ ).returns(T.attached_class)
2769
+ end
2770
+ def self.new(
2771
+ # The property of the price to filter on.
2772
+ field:,
2773
+ # Should prices that match the filter be included or excluded.
2774
+ operator:,
2775
+ # The IDs or values that match this filter.
2776
+ values:
2777
+ )
2778
+ end
2779
+
2780
+ sig do
2781
+ override.returns(
2782
+ {
2783
+ field:
2784
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Field::TaggedSymbol,
2785
+ operator:
2786
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Operator::TaggedSymbol,
2787
+ values: T::Array[String]
2788
+ }
2789
+ )
2790
+ end
2791
+ def to_hash
2792
+ end
2793
+
2794
+ # The property of the price to filter on.
2795
+ module Field
2796
+ extend Orb::Internal::Type::Enum
2797
+
2798
+ TaggedSymbol =
2799
+ T.type_alias do
2800
+ T.all(
2801
+ Symbol,
2802
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Field
2803
+ )
2804
+ end
2805
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2806
+
2807
+ PRICE_ID =
2808
+ T.let(
2809
+ :price_id,
2810
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Field::TaggedSymbol
2811
+ )
2812
+ ITEM_ID =
2813
+ T.let(
2814
+ :item_id,
2815
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Field::TaggedSymbol
2816
+ )
2817
+ PRICE_TYPE =
2818
+ T.let(
2819
+ :price_type,
2820
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Field::TaggedSymbol
2821
+ )
2822
+ CURRENCY =
2823
+ T.let(
2824
+ :currency,
2825
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Field::TaggedSymbol
2826
+ )
2827
+ PRICING_UNIT_ID =
2828
+ T.let(
2829
+ :pricing_unit_id,
2830
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Field::TaggedSymbol
2831
+ )
2832
+
2833
+ sig do
2834
+ override.returns(
2835
+ T::Array[
2836
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Field::TaggedSymbol
2837
+ ]
2838
+ )
2839
+ end
2840
+ def self.values
2841
+ end
2842
+ end
2843
+
2844
+ # Should prices that match the filter be included or excluded.
2845
+ module Operator
2846
+ extend Orb::Internal::Type::Enum
2847
+
2848
+ TaggedSymbol =
2849
+ T.type_alias do
2850
+ T.all(
2851
+ Symbol,
2852
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Operator
2853
+ )
2854
+ end
2855
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2856
+
2857
+ INCLUDES =
2858
+ T.let(
2859
+ :includes,
2860
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Operator::TaggedSymbol
2861
+ )
2862
+ EXCLUDES =
2863
+ T.let(
2864
+ :excludes,
2865
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Operator::TaggedSymbol
2866
+ )
2867
+
2868
+ sig do
2869
+ override.returns(
2870
+ T::Array[
2871
+ Orb::Invoice::LineItem::Adjustment::Minimum::Filter::Operator::TaggedSymbol
2872
+ ]
2873
+ )
2874
+ end
2875
+ def self.values
2876
+ end
2877
+ end
2878
+ end
2209
2879
  end
2210
2880
 
2211
2881
  class Maximum < Orb::Internal::Type::BaseModel
@@ -2231,6 +2901,14 @@ module Orb
2231
2901
  sig { returns(T::Array[String]) }
2232
2902
  attr_accessor :applies_to_price_ids
2233
2903
 
2904
+ # The filters that determine which prices to apply this adjustment to.
2905
+ sig do
2906
+ returns(
2907
+ T::Array[Orb::Invoice::LineItem::Adjustment::Maximum::Filter]
2908
+ )
2909
+ end
2910
+ attr_accessor :filters
2911
+
2234
2912
  # True for adjustments that apply to an entire invocice, false for adjustments
2235
2913
  # that apply to only one price.
2236
2914
  sig { returns(T::Boolean) }
@@ -2250,6 +2928,10 @@ module Orb
2250
2928
  id: String,
2251
2929
  amount: String,
2252
2930
  applies_to_price_ids: T::Array[String],
2931
+ filters:
2932
+ T::Array[
2933
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::OrHash
2934
+ ],
2253
2935
  is_invoice_level: T::Boolean,
2254
2936
  maximum_amount: String,
2255
2937
  reason: T.nilable(String),
@@ -2262,6 +2944,8 @@ module Orb
2262
2944
  amount:,
2263
2945
  # The price IDs that this adjustment applies to.
2264
2946
  applies_to_price_ids:,
2947
+ # The filters that determine which prices to apply this adjustment to.
2948
+ filters:,
2265
2949
  # True for adjustments that apply to an entire invocice, false for adjustments
2266
2950
  # that apply to only one price.
2267
2951
  is_invoice_level:,
@@ -2281,6 +2965,10 @@ module Orb
2281
2965
  adjustment_type: Symbol,
2282
2966
  amount: String,
2283
2967
  applies_to_price_ids: T::Array[String],
2968
+ filters:
2969
+ T::Array[
2970
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter
2971
+ ],
2284
2972
  is_invoice_level: T::Boolean,
2285
2973
  maximum_amount: String,
2286
2974
  reason: T.nilable(String)
@@ -2289,6 +2977,154 @@ module Orb
2289
2977
  end
2290
2978
  def to_hash
2291
2979
  end
2980
+
2981
+ class Filter < Orb::Internal::Type::BaseModel
2982
+ OrHash =
2983
+ T.type_alias do
2984
+ T.any(
2985
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter,
2986
+ Orb::Internal::AnyHash
2987
+ )
2988
+ end
2989
+
2990
+ # The property of the price to filter on.
2991
+ sig do
2992
+ returns(
2993
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Field::TaggedSymbol
2994
+ )
2995
+ end
2996
+ attr_accessor :field
2997
+
2998
+ # Should prices that match the filter be included or excluded.
2999
+ sig do
3000
+ returns(
3001
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Operator::TaggedSymbol
3002
+ )
3003
+ end
3004
+ attr_accessor :operator
3005
+
3006
+ # The IDs or values that match this filter.
3007
+ sig { returns(T::Array[String]) }
3008
+ attr_accessor :values
3009
+
3010
+ sig do
3011
+ params(
3012
+ field:
3013
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Field::OrSymbol,
3014
+ operator:
3015
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Operator::OrSymbol,
3016
+ values: T::Array[String]
3017
+ ).returns(T.attached_class)
3018
+ end
3019
+ def self.new(
3020
+ # The property of the price to filter on.
3021
+ field:,
3022
+ # Should prices that match the filter be included or excluded.
3023
+ operator:,
3024
+ # The IDs or values that match this filter.
3025
+ values:
3026
+ )
3027
+ end
3028
+
3029
+ sig do
3030
+ override.returns(
3031
+ {
3032
+ field:
3033
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Field::TaggedSymbol,
3034
+ operator:
3035
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Operator::TaggedSymbol,
3036
+ values: T::Array[String]
3037
+ }
3038
+ )
3039
+ end
3040
+ def to_hash
3041
+ end
3042
+
3043
+ # The property of the price to filter on.
3044
+ module Field
3045
+ extend Orb::Internal::Type::Enum
3046
+
3047
+ TaggedSymbol =
3048
+ T.type_alias do
3049
+ T.all(
3050
+ Symbol,
3051
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Field
3052
+ )
3053
+ end
3054
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
3055
+
3056
+ PRICE_ID =
3057
+ T.let(
3058
+ :price_id,
3059
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Field::TaggedSymbol
3060
+ )
3061
+ ITEM_ID =
3062
+ T.let(
3063
+ :item_id,
3064
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Field::TaggedSymbol
3065
+ )
3066
+ PRICE_TYPE =
3067
+ T.let(
3068
+ :price_type,
3069
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Field::TaggedSymbol
3070
+ )
3071
+ CURRENCY =
3072
+ T.let(
3073
+ :currency,
3074
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Field::TaggedSymbol
3075
+ )
3076
+ PRICING_UNIT_ID =
3077
+ T.let(
3078
+ :pricing_unit_id,
3079
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Field::TaggedSymbol
3080
+ )
3081
+
3082
+ sig do
3083
+ override.returns(
3084
+ T::Array[
3085
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Field::TaggedSymbol
3086
+ ]
3087
+ )
3088
+ end
3089
+ def self.values
3090
+ end
3091
+ end
3092
+
3093
+ # Should prices that match the filter be included or excluded.
3094
+ module Operator
3095
+ extend Orb::Internal::Type::Enum
3096
+
3097
+ TaggedSymbol =
3098
+ T.type_alias do
3099
+ T.all(
3100
+ Symbol,
3101
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Operator
3102
+ )
3103
+ end
3104
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
3105
+
3106
+ INCLUDES =
3107
+ T.let(
3108
+ :includes,
3109
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Operator::TaggedSymbol
3110
+ )
3111
+ EXCLUDES =
3112
+ T.let(
3113
+ :excludes,
3114
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Operator::TaggedSymbol
3115
+ )
3116
+
3117
+ sig do
3118
+ override.returns(
3119
+ T::Array[
3120
+ Orb::Invoice::LineItem::Adjustment::Maximum::Filter::Operator::TaggedSymbol
3121
+ ]
3122
+ )
3123
+ end
3124
+ def self.values
3125
+ end
3126
+ end
3127
+ end
2292
3128
  end
2293
3129
 
2294
3130
  sig do
@@ -2300,43 +3136,199 @@ module Orb
2300
3136
  end
2301
3137
  end
2302
3138
 
2303
- class Maximum < Orb::Internal::Type::BaseModel
2304
- OrHash =
2305
- T.type_alias do
2306
- T.any(Orb::Invoice::LineItem::Maximum, Orb::Internal::AnyHash)
3139
+ class Maximum < Orb::Internal::Type::BaseModel
3140
+ OrHash =
3141
+ T.type_alias do
3142
+ T.any(Orb::Invoice::LineItem::Maximum, Orb::Internal::AnyHash)
3143
+ end
3144
+
3145
+ # List of price_ids that this maximum amount applies to. For plan/plan phase
3146
+ # maximums, this can be a subset of prices.
3147
+ sig { returns(T::Array[String]) }
3148
+ attr_accessor :applies_to_price_ids
3149
+
3150
+ # The filters that determine which prices to apply this maximum to.
3151
+ sig { returns(T::Array[Orb::Invoice::LineItem::Maximum::Filter]) }
3152
+ attr_accessor :filters
3153
+
3154
+ # Maximum amount applied
3155
+ sig { returns(String) }
3156
+ attr_accessor :maximum_amount
3157
+
3158
+ # This field is deprecated in favor of `adjustments`.
3159
+ sig do
3160
+ params(
3161
+ applies_to_price_ids: T::Array[String],
3162
+ filters:
3163
+ T::Array[Orb::Invoice::LineItem::Maximum::Filter::OrHash],
3164
+ maximum_amount: String
3165
+ ).returns(T.attached_class)
3166
+ end
3167
+ def self.new(
3168
+ # List of price_ids that this maximum amount applies to. For plan/plan phase
3169
+ # maximums, this can be a subset of prices.
3170
+ applies_to_price_ids:,
3171
+ # The filters that determine which prices to apply this maximum to.
3172
+ filters:,
3173
+ # Maximum amount applied
3174
+ maximum_amount:
3175
+ )
3176
+ end
3177
+
3178
+ sig do
3179
+ override.returns(
3180
+ {
3181
+ applies_to_price_ids: T::Array[String],
3182
+ filters: T::Array[Orb::Invoice::LineItem::Maximum::Filter],
3183
+ maximum_amount: String
3184
+ }
3185
+ )
3186
+ end
3187
+ def to_hash
3188
+ end
3189
+
3190
+ class Filter < Orb::Internal::Type::BaseModel
3191
+ OrHash =
3192
+ T.type_alias do
3193
+ T.any(
3194
+ Orb::Invoice::LineItem::Maximum::Filter,
3195
+ Orb::Internal::AnyHash
3196
+ )
3197
+ end
3198
+
3199
+ # The property of the price to filter on.
3200
+ sig do
3201
+ returns(
3202
+ Orb::Invoice::LineItem::Maximum::Filter::Field::TaggedSymbol
3203
+ )
3204
+ end
3205
+ attr_accessor :field
3206
+
3207
+ # Should prices that match the filter be included or excluded.
3208
+ sig do
3209
+ returns(
3210
+ Orb::Invoice::LineItem::Maximum::Filter::Operator::TaggedSymbol
3211
+ )
3212
+ end
3213
+ attr_accessor :operator
3214
+
3215
+ # The IDs or values that match this filter.
3216
+ sig { returns(T::Array[String]) }
3217
+ attr_accessor :values
3218
+
3219
+ sig do
3220
+ params(
3221
+ field: Orb::Invoice::LineItem::Maximum::Filter::Field::OrSymbol,
3222
+ operator:
3223
+ Orb::Invoice::LineItem::Maximum::Filter::Operator::OrSymbol,
3224
+ values: T::Array[String]
3225
+ ).returns(T.attached_class)
3226
+ end
3227
+ def self.new(
3228
+ # The property of the price to filter on.
3229
+ field:,
3230
+ # Should prices that match the filter be included or excluded.
3231
+ operator:,
3232
+ # The IDs or values that match this filter.
3233
+ values:
3234
+ )
3235
+ end
3236
+
3237
+ sig do
3238
+ override.returns(
3239
+ {
3240
+ field:
3241
+ Orb::Invoice::LineItem::Maximum::Filter::Field::TaggedSymbol,
3242
+ operator:
3243
+ Orb::Invoice::LineItem::Maximum::Filter::Operator::TaggedSymbol,
3244
+ values: T::Array[String]
3245
+ }
3246
+ )
3247
+ end
3248
+ def to_hash
3249
+ end
3250
+
3251
+ # The property of the price to filter on.
3252
+ module Field
3253
+ extend Orb::Internal::Type::Enum
3254
+
3255
+ TaggedSymbol =
3256
+ T.type_alias do
3257
+ T.all(Symbol, Orb::Invoice::LineItem::Maximum::Filter::Field)
3258
+ end
3259
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
3260
+
3261
+ PRICE_ID =
3262
+ T.let(
3263
+ :price_id,
3264
+ Orb::Invoice::LineItem::Maximum::Filter::Field::TaggedSymbol
3265
+ )
3266
+ ITEM_ID =
3267
+ T.let(
3268
+ :item_id,
3269
+ Orb::Invoice::LineItem::Maximum::Filter::Field::TaggedSymbol
3270
+ )
3271
+ PRICE_TYPE =
3272
+ T.let(
3273
+ :price_type,
3274
+ Orb::Invoice::LineItem::Maximum::Filter::Field::TaggedSymbol
3275
+ )
3276
+ CURRENCY =
3277
+ T.let(
3278
+ :currency,
3279
+ Orb::Invoice::LineItem::Maximum::Filter::Field::TaggedSymbol
3280
+ )
3281
+ PRICING_UNIT_ID =
3282
+ T.let(
3283
+ :pricing_unit_id,
3284
+ Orb::Invoice::LineItem::Maximum::Filter::Field::TaggedSymbol
3285
+ )
3286
+
3287
+ sig do
3288
+ override.returns(
3289
+ T::Array[
3290
+ Orb::Invoice::LineItem::Maximum::Filter::Field::TaggedSymbol
3291
+ ]
3292
+ )
3293
+ end
3294
+ def self.values
3295
+ end
2307
3296
  end
2308
3297
 
2309
- # List of price_ids that this maximum amount applies to. For plan/plan phase
2310
- # maximums, this can be a subset of prices.
2311
- sig { returns(T::Array[String]) }
2312
- attr_accessor :applies_to_price_ids
3298
+ # Should prices that match the filter be included or excluded.
3299
+ module Operator
3300
+ extend Orb::Internal::Type::Enum
2313
3301
 
2314
- # Maximum amount applied
2315
- sig { returns(String) }
2316
- attr_accessor :maximum_amount
3302
+ TaggedSymbol =
3303
+ T.type_alias do
3304
+ T.all(
3305
+ Symbol,
3306
+ Orb::Invoice::LineItem::Maximum::Filter::Operator
3307
+ )
3308
+ end
3309
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2317
3310
 
2318
- # This field is deprecated in favor of `adjustments`.
2319
- sig do
2320
- params(
2321
- applies_to_price_ids: T::Array[String],
2322
- maximum_amount: String
2323
- ).returns(T.attached_class)
2324
- end
2325
- def self.new(
2326
- # List of price_ids that this maximum amount applies to. For plan/plan phase
2327
- # maximums, this can be a subset of prices.
2328
- applies_to_price_ids:,
2329
- # Maximum amount applied
2330
- maximum_amount:
2331
- )
2332
- end
3311
+ INCLUDES =
3312
+ T.let(
3313
+ :includes,
3314
+ Orb::Invoice::LineItem::Maximum::Filter::Operator::TaggedSymbol
3315
+ )
3316
+ EXCLUDES =
3317
+ T.let(
3318
+ :excludes,
3319
+ Orb::Invoice::LineItem::Maximum::Filter::Operator::TaggedSymbol
3320
+ )
2333
3321
 
2334
- sig do
2335
- override.returns(
2336
- { applies_to_price_ids: T::Array[String], maximum_amount: String }
2337
- )
2338
- end
2339
- def to_hash
3322
+ sig do
3323
+ override.returns(
3324
+ T::Array[
3325
+ Orb::Invoice::LineItem::Maximum::Filter::Operator::TaggedSymbol
3326
+ ]
3327
+ )
3328
+ end
3329
+ def self.values
3330
+ end
3331
+ end
2340
3332
  end
2341
3333
  end
2342
3334
 
@@ -2351,6 +3343,10 @@ module Orb
2351
3343
  sig { returns(T::Array[String]) }
2352
3344
  attr_accessor :applies_to_price_ids
2353
3345
 
3346
+ # The filters that determine which prices to apply this minimum to.
3347
+ sig { returns(T::Array[Orb::Invoice::LineItem::Minimum::Filter]) }
3348
+ attr_accessor :filters
3349
+
2354
3350
  # Minimum amount applied
2355
3351
  sig { returns(String) }
2356
3352
  attr_accessor :minimum_amount
@@ -2359,6 +3355,8 @@ module Orb
2359
3355
  sig do
2360
3356
  params(
2361
3357
  applies_to_price_ids: T::Array[String],
3358
+ filters:
3359
+ T::Array[Orb::Invoice::LineItem::Minimum::Filter::OrHash],
2362
3360
  minimum_amount: String
2363
3361
  ).returns(T.attached_class)
2364
3362
  end
@@ -2366,6 +3364,8 @@ module Orb
2366
3364
  # List of price_ids that this minimum amount applies to. For plan/plan phase
2367
3365
  # minimums, this can be a subset of prices.
2368
3366
  applies_to_price_ids:,
3367
+ # The filters that determine which prices to apply this minimum to.
3368
+ filters:,
2369
3369
  # Minimum amount applied
2370
3370
  minimum_amount:
2371
3371
  )
@@ -2373,11 +3373,159 @@ module Orb
2373
3373
 
2374
3374
  sig do
2375
3375
  override.returns(
2376
- { applies_to_price_ids: T::Array[String], minimum_amount: String }
3376
+ {
3377
+ applies_to_price_ids: T::Array[String],
3378
+ filters: T::Array[Orb::Invoice::LineItem::Minimum::Filter],
3379
+ minimum_amount: String
3380
+ }
2377
3381
  )
2378
3382
  end
2379
3383
  def to_hash
2380
3384
  end
3385
+
3386
+ class Filter < Orb::Internal::Type::BaseModel
3387
+ OrHash =
3388
+ T.type_alias do
3389
+ T.any(
3390
+ Orb::Invoice::LineItem::Minimum::Filter,
3391
+ Orb::Internal::AnyHash
3392
+ )
3393
+ end
3394
+
3395
+ # The property of the price to filter on.
3396
+ sig do
3397
+ returns(
3398
+ Orb::Invoice::LineItem::Minimum::Filter::Field::TaggedSymbol
3399
+ )
3400
+ end
3401
+ attr_accessor :field
3402
+
3403
+ # Should prices that match the filter be included or excluded.
3404
+ sig do
3405
+ returns(
3406
+ Orb::Invoice::LineItem::Minimum::Filter::Operator::TaggedSymbol
3407
+ )
3408
+ end
3409
+ attr_accessor :operator
3410
+
3411
+ # The IDs or values that match this filter.
3412
+ sig { returns(T::Array[String]) }
3413
+ attr_accessor :values
3414
+
3415
+ sig do
3416
+ params(
3417
+ field: Orb::Invoice::LineItem::Minimum::Filter::Field::OrSymbol,
3418
+ operator:
3419
+ Orb::Invoice::LineItem::Minimum::Filter::Operator::OrSymbol,
3420
+ values: T::Array[String]
3421
+ ).returns(T.attached_class)
3422
+ end
3423
+ def self.new(
3424
+ # The property of the price to filter on.
3425
+ field:,
3426
+ # Should prices that match the filter be included or excluded.
3427
+ operator:,
3428
+ # The IDs or values that match this filter.
3429
+ values:
3430
+ )
3431
+ end
3432
+
3433
+ sig do
3434
+ override.returns(
3435
+ {
3436
+ field:
3437
+ Orb::Invoice::LineItem::Minimum::Filter::Field::TaggedSymbol,
3438
+ operator:
3439
+ Orb::Invoice::LineItem::Minimum::Filter::Operator::TaggedSymbol,
3440
+ values: T::Array[String]
3441
+ }
3442
+ )
3443
+ end
3444
+ def to_hash
3445
+ end
3446
+
3447
+ # The property of the price to filter on.
3448
+ module Field
3449
+ extend Orb::Internal::Type::Enum
3450
+
3451
+ TaggedSymbol =
3452
+ T.type_alias do
3453
+ T.all(Symbol, Orb::Invoice::LineItem::Minimum::Filter::Field)
3454
+ end
3455
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
3456
+
3457
+ PRICE_ID =
3458
+ T.let(
3459
+ :price_id,
3460
+ Orb::Invoice::LineItem::Minimum::Filter::Field::TaggedSymbol
3461
+ )
3462
+ ITEM_ID =
3463
+ T.let(
3464
+ :item_id,
3465
+ Orb::Invoice::LineItem::Minimum::Filter::Field::TaggedSymbol
3466
+ )
3467
+ PRICE_TYPE =
3468
+ T.let(
3469
+ :price_type,
3470
+ Orb::Invoice::LineItem::Minimum::Filter::Field::TaggedSymbol
3471
+ )
3472
+ CURRENCY =
3473
+ T.let(
3474
+ :currency,
3475
+ Orb::Invoice::LineItem::Minimum::Filter::Field::TaggedSymbol
3476
+ )
3477
+ PRICING_UNIT_ID =
3478
+ T.let(
3479
+ :pricing_unit_id,
3480
+ Orb::Invoice::LineItem::Minimum::Filter::Field::TaggedSymbol
3481
+ )
3482
+
3483
+ sig do
3484
+ override.returns(
3485
+ T::Array[
3486
+ Orb::Invoice::LineItem::Minimum::Filter::Field::TaggedSymbol
3487
+ ]
3488
+ )
3489
+ end
3490
+ def self.values
3491
+ end
3492
+ end
3493
+
3494
+ # Should prices that match the filter be included or excluded.
3495
+ module Operator
3496
+ extend Orb::Internal::Type::Enum
3497
+
3498
+ TaggedSymbol =
3499
+ T.type_alias do
3500
+ T.all(
3501
+ Symbol,
3502
+ Orb::Invoice::LineItem::Minimum::Filter::Operator
3503
+ )
3504
+ end
3505
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
3506
+
3507
+ INCLUDES =
3508
+ T.let(
3509
+ :includes,
3510
+ Orb::Invoice::LineItem::Minimum::Filter::Operator::TaggedSymbol
3511
+ )
3512
+ EXCLUDES =
3513
+ T.let(
3514
+ :excludes,
3515
+ Orb::Invoice::LineItem::Minimum::Filter::Operator::TaggedSymbol
3516
+ )
3517
+
3518
+ sig do
3519
+ override.returns(
3520
+ T::Array[
3521
+ Orb::Invoice::LineItem::Minimum::Filter::Operator::TaggedSymbol
3522
+ ]
3523
+ )
3524
+ end
3525
+ def self.values
3526
+ end
3527
+ end
3528
+ end
2381
3529
  end
2382
3530
 
2383
3531
  module SubLineItem
@@ -2911,6 +4059,10 @@ module Orb
2911
4059
  sig { returns(T::Array[String]) }
2912
4060
  attr_accessor :applies_to_price_ids
2913
4061
 
4062
+ # The filters that determine which prices to apply this maximum to.
4063
+ sig { returns(T::Array[Orb::Invoice::Maximum::Filter]) }
4064
+ attr_accessor :filters
4065
+
2914
4066
  # Maximum amount applied
2915
4067
  sig { returns(String) }
2916
4068
  attr_accessor :maximum_amount
@@ -2918,6 +4070,7 @@ module Orb
2918
4070
  sig do
2919
4071
  params(
2920
4072
  applies_to_price_ids: T::Array[String],
4073
+ filters: T::Array[Orb::Invoice::Maximum::Filter::OrHash],
2921
4074
  maximum_amount: String
2922
4075
  ).returns(T.attached_class)
2923
4076
  end
@@ -2925,6 +4078,8 @@ module Orb
2925
4078
  # List of price_ids that this maximum amount applies to. For plan/plan phase
2926
4079
  # maximums, this can be a subset of prices.
2927
4080
  applies_to_price_ids:,
4081
+ # The filters that determine which prices to apply this maximum to.
4082
+ filters:,
2928
4083
  # Maximum amount applied
2929
4084
  maximum_amount:
2930
4085
  )
@@ -2932,11 +4087,138 @@ module Orb
2932
4087
 
2933
4088
  sig do
2934
4089
  override.returns(
2935
- { applies_to_price_ids: T::Array[String], maximum_amount: String }
4090
+ {
4091
+ applies_to_price_ids: T::Array[String],
4092
+ filters: T::Array[Orb::Invoice::Maximum::Filter],
4093
+ maximum_amount: String
4094
+ }
2936
4095
  )
2937
4096
  end
2938
4097
  def to_hash
2939
4098
  end
4099
+
4100
+ class Filter < Orb::Internal::Type::BaseModel
4101
+ OrHash =
4102
+ T.type_alias do
4103
+ T.any(Orb::Invoice::Maximum::Filter, Orb::Internal::AnyHash)
4104
+ end
4105
+
4106
+ # The property of the price to filter on.
4107
+ sig { returns(Orb::Invoice::Maximum::Filter::Field::TaggedSymbol) }
4108
+ attr_accessor :field
4109
+
4110
+ # Should prices that match the filter be included or excluded.
4111
+ sig { returns(Orb::Invoice::Maximum::Filter::Operator::TaggedSymbol) }
4112
+ attr_accessor :operator
4113
+
4114
+ # The IDs or values that match this filter.
4115
+ sig { returns(T::Array[String]) }
4116
+ attr_accessor :values
4117
+
4118
+ sig do
4119
+ params(
4120
+ field: Orb::Invoice::Maximum::Filter::Field::OrSymbol,
4121
+ operator: Orb::Invoice::Maximum::Filter::Operator::OrSymbol,
4122
+ values: T::Array[String]
4123
+ ).returns(T.attached_class)
4124
+ end
4125
+ def self.new(
4126
+ # The property of the price to filter on.
4127
+ field:,
4128
+ # Should prices that match the filter be included or excluded.
4129
+ operator:,
4130
+ # The IDs or values that match this filter.
4131
+ values:
4132
+ )
4133
+ end
4134
+
4135
+ sig do
4136
+ override.returns(
4137
+ {
4138
+ field: Orb::Invoice::Maximum::Filter::Field::TaggedSymbol,
4139
+ operator: Orb::Invoice::Maximum::Filter::Operator::TaggedSymbol,
4140
+ values: T::Array[String]
4141
+ }
4142
+ )
4143
+ end
4144
+ def to_hash
4145
+ end
4146
+
4147
+ # The property of the price to filter on.
4148
+ module Field
4149
+ extend Orb::Internal::Type::Enum
4150
+
4151
+ TaggedSymbol =
4152
+ T.type_alias do
4153
+ T.all(Symbol, Orb::Invoice::Maximum::Filter::Field)
4154
+ end
4155
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4156
+
4157
+ PRICE_ID =
4158
+ T.let(
4159
+ :price_id,
4160
+ Orb::Invoice::Maximum::Filter::Field::TaggedSymbol
4161
+ )
4162
+ ITEM_ID =
4163
+ T.let(
4164
+ :item_id,
4165
+ Orb::Invoice::Maximum::Filter::Field::TaggedSymbol
4166
+ )
4167
+ PRICE_TYPE =
4168
+ T.let(
4169
+ :price_type,
4170
+ Orb::Invoice::Maximum::Filter::Field::TaggedSymbol
4171
+ )
4172
+ CURRENCY =
4173
+ T.let(
4174
+ :currency,
4175
+ Orb::Invoice::Maximum::Filter::Field::TaggedSymbol
4176
+ )
4177
+ PRICING_UNIT_ID =
4178
+ T.let(
4179
+ :pricing_unit_id,
4180
+ Orb::Invoice::Maximum::Filter::Field::TaggedSymbol
4181
+ )
4182
+
4183
+ sig do
4184
+ override.returns(
4185
+ T::Array[Orb::Invoice::Maximum::Filter::Field::TaggedSymbol]
4186
+ )
4187
+ end
4188
+ def self.values
4189
+ end
4190
+ end
4191
+
4192
+ # Should prices that match the filter be included or excluded.
4193
+ module Operator
4194
+ extend Orb::Internal::Type::Enum
4195
+
4196
+ TaggedSymbol =
4197
+ T.type_alias do
4198
+ T.all(Symbol, Orb::Invoice::Maximum::Filter::Operator)
4199
+ end
4200
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4201
+
4202
+ INCLUDES =
4203
+ T.let(
4204
+ :includes,
4205
+ Orb::Invoice::Maximum::Filter::Operator::TaggedSymbol
4206
+ )
4207
+ EXCLUDES =
4208
+ T.let(
4209
+ :excludes,
4210
+ Orb::Invoice::Maximum::Filter::Operator::TaggedSymbol
4211
+ )
4212
+
4213
+ sig do
4214
+ override.returns(
4215
+ T::Array[Orb::Invoice::Maximum::Filter::Operator::TaggedSymbol]
4216
+ )
4217
+ end
4218
+ def self.values
4219
+ end
4220
+ end
4221
+ end
2940
4222
  end
2941
4223
 
2942
4224
  class Minimum < Orb::Internal::Type::BaseModel
@@ -2948,6 +4230,10 @@ module Orb
2948
4230
  sig { returns(T::Array[String]) }
2949
4231
  attr_accessor :applies_to_price_ids
2950
4232
 
4233
+ # The filters that determine which prices to apply this minimum to.
4234
+ sig { returns(T::Array[Orb::Invoice::Minimum::Filter]) }
4235
+ attr_accessor :filters
4236
+
2951
4237
  # Minimum amount applied
2952
4238
  sig { returns(String) }
2953
4239
  attr_accessor :minimum_amount
@@ -2955,6 +4241,7 @@ module Orb
2955
4241
  sig do
2956
4242
  params(
2957
4243
  applies_to_price_ids: T::Array[String],
4244
+ filters: T::Array[Orb::Invoice::Minimum::Filter::OrHash],
2958
4245
  minimum_amount: String
2959
4246
  ).returns(T.attached_class)
2960
4247
  end
@@ -2962,6 +4249,8 @@ module Orb
2962
4249
  # List of price_ids that this minimum amount applies to. For plan/plan phase
2963
4250
  # minimums, this can be a subset of prices.
2964
4251
  applies_to_price_ids:,
4252
+ # The filters that determine which prices to apply this minimum to.
4253
+ filters:,
2965
4254
  # Minimum amount applied
2966
4255
  minimum_amount:
2967
4256
  )
@@ -2969,11 +4258,138 @@ module Orb
2969
4258
 
2970
4259
  sig do
2971
4260
  override.returns(
2972
- { applies_to_price_ids: T::Array[String], minimum_amount: String }
4261
+ {
4262
+ applies_to_price_ids: T::Array[String],
4263
+ filters: T::Array[Orb::Invoice::Minimum::Filter],
4264
+ minimum_amount: String
4265
+ }
2973
4266
  )
2974
4267
  end
2975
4268
  def to_hash
2976
4269
  end
4270
+
4271
+ class Filter < Orb::Internal::Type::BaseModel
4272
+ OrHash =
4273
+ T.type_alias do
4274
+ T.any(Orb::Invoice::Minimum::Filter, Orb::Internal::AnyHash)
4275
+ end
4276
+
4277
+ # The property of the price to filter on.
4278
+ sig { returns(Orb::Invoice::Minimum::Filter::Field::TaggedSymbol) }
4279
+ attr_accessor :field
4280
+
4281
+ # Should prices that match the filter be included or excluded.
4282
+ sig { returns(Orb::Invoice::Minimum::Filter::Operator::TaggedSymbol) }
4283
+ attr_accessor :operator
4284
+
4285
+ # The IDs or values that match this filter.
4286
+ sig { returns(T::Array[String]) }
4287
+ attr_accessor :values
4288
+
4289
+ sig do
4290
+ params(
4291
+ field: Orb::Invoice::Minimum::Filter::Field::OrSymbol,
4292
+ operator: Orb::Invoice::Minimum::Filter::Operator::OrSymbol,
4293
+ values: T::Array[String]
4294
+ ).returns(T.attached_class)
4295
+ end
4296
+ def self.new(
4297
+ # The property of the price to filter on.
4298
+ field:,
4299
+ # Should prices that match the filter be included or excluded.
4300
+ operator:,
4301
+ # The IDs or values that match this filter.
4302
+ values:
4303
+ )
4304
+ end
4305
+
4306
+ sig do
4307
+ override.returns(
4308
+ {
4309
+ field: Orb::Invoice::Minimum::Filter::Field::TaggedSymbol,
4310
+ operator: Orb::Invoice::Minimum::Filter::Operator::TaggedSymbol,
4311
+ values: T::Array[String]
4312
+ }
4313
+ )
4314
+ end
4315
+ def to_hash
4316
+ end
4317
+
4318
+ # The property of the price to filter on.
4319
+ module Field
4320
+ extend Orb::Internal::Type::Enum
4321
+
4322
+ TaggedSymbol =
4323
+ T.type_alias do
4324
+ T.all(Symbol, Orb::Invoice::Minimum::Filter::Field)
4325
+ end
4326
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4327
+
4328
+ PRICE_ID =
4329
+ T.let(
4330
+ :price_id,
4331
+ Orb::Invoice::Minimum::Filter::Field::TaggedSymbol
4332
+ )
4333
+ ITEM_ID =
4334
+ T.let(
4335
+ :item_id,
4336
+ Orb::Invoice::Minimum::Filter::Field::TaggedSymbol
4337
+ )
4338
+ PRICE_TYPE =
4339
+ T.let(
4340
+ :price_type,
4341
+ Orb::Invoice::Minimum::Filter::Field::TaggedSymbol
4342
+ )
4343
+ CURRENCY =
4344
+ T.let(
4345
+ :currency,
4346
+ Orb::Invoice::Minimum::Filter::Field::TaggedSymbol
4347
+ )
4348
+ PRICING_UNIT_ID =
4349
+ T.let(
4350
+ :pricing_unit_id,
4351
+ Orb::Invoice::Minimum::Filter::Field::TaggedSymbol
4352
+ )
4353
+
4354
+ sig do
4355
+ override.returns(
4356
+ T::Array[Orb::Invoice::Minimum::Filter::Field::TaggedSymbol]
4357
+ )
4358
+ end
4359
+ def self.values
4360
+ end
4361
+ end
4362
+
4363
+ # Should prices that match the filter be included or excluded.
4364
+ module Operator
4365
+ extend Orb::Internal::Type::Enum
4366
+
4367
+ TaggedSymbol =
4368
+ T.type_alias do
4369
+ T.all(Symbol, Orb::Invoice::Minimum::Filter::Operator)
4370
+ end
4371
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4372
+
4373
+ INCLUDES =
4374
+ T.let(
4375
+ :includes,
4376
+ Orb::Invoice::Minimum::Filter::Operator::TaggedSymbol
4377
+ )
4378
+ EXCLUDES =
4379
+ T.let(
4380
+ :excludes,
4381
+ Orb::Invoice::Minimum::Filter::Operator::TaggedSymbol
4382
+ )
4383
+
4384
+ sig do
4385
+ override.returns(
4386
+ T::Array[Orb::Invoice::Minimum::Filter::Operator::TaggedSymbol]
4387
+ )
4388
+ end
4389
+ def self.values
4390
+ end
4391
+ end
4392
+ end
2977
4393
  end
2978
4394
 
2979
4395
  class PaymentAttempt < Orb::Internal::Type::BaseModel