orb-billing 1.29.0 → 1.31.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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +566 -6
  5. data/lib/orb/models/beta_create_plan_version_params.rb +566 -6
  6. data/lib/orb/models/changed_subscription_resources.rb +2 -2
  7. data/lib/orb/models/invoice.rb +2 -2
  8. data/lib/orb/models/invoice_fetch_upcoming_response.rb +2 -2
  9. data/lib/orb/models/invoice_line_item_create_response.rb +2 -2
  10. data/lib/orb/models/per_price_cost.rb +2 -2
  11. data/lib/orb/models/plan.rb +2 -2
  12. data/lib/orb/models/plan_create_params.rb +278 -3
  13. data/lib/orb/models/plan_version.rb +2 -2
  14. data/lib/orb/models/price.rb +450 -1
  15. data/lib/orb/models/price_create_params.rb +263 -3
  16. data/lib/orb/models/price_evaluate_multiple_params.rb +273 -3
  17. data/lib/orb/models/price_evaluate_preview_events_params.rb +273 -3
  18. data/lib/orb/models/price_interval.rb +2 -2
  19. data/lib/orb/models/subscription_create_params.rb +566 -6
  20. data/lib/orb/models/subscription_price_intervals_params.rb +273 -3
  21. data/lib/orb/models/subscription_schedule_plan_change_params.rb +566 -6
  22. data/lib/orb/resources/customers/credits/top_ups.rb +14 -2
  23. data/lib/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rb +4 -1
  24. data/lib/orb/resources/dimensional_price_groups.rb +11 -2
  25. data/lib/orb/resources/items.rb +3 -1
  26. data/lib/orb/resources/plans/migrations.rb +3 -1
  27. data/lib/orb/resources/prices/external_price_id.rb +2 -2
  28. data/lib/orb/resources/prices.rb +5 -5
  29. data/lib/orb/version.rb +1 -1
  30. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +2737 -1811
  31. data/rbi/orb/models/beta_create_plan_version_params.rbi +2745 -1819
  32. data/rbi/orb/models/changed_subscription_resources.rbi +1 -0
  33. data/rbi/orb/models/invoice.rbi +1 -0
  34. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +1 -0
  35. data/rbi/orb/models/invoice_line_item_create_response.rbi +1 -0
  36. data/rbi/orb/models/per_price_cost.rbi +1 -0
  37. data/rbi/orb/models/plan.rbi +1 -0
  38. data/rbi/orb/models/plan_create_params.rbi +463 -0
  39. data/rbi/orb/models/plan_version.rbi +1 -0
  40. data/rbi/orb/models/price.rbi +805 -0
  41. data/rbi/orb/models/price_create_params.rbi +451 -0
  42. data/rbi/orb/models/price_evaluate_multiple_params.rbi +451 -0
  43. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +451 -0
  44. data/rbi/orb/models/price_interval.rbi +1 -0
  45. data/rbi/orb/models/subscription_create_params.rbi +2660 -1734
  46. data/rbi/orb/models/subscription_price_intervals_params.rbi +451 -0
  47. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +2660 -1734
  48. data/rbi/orb/resources/customers/credits/top_ups.rbi +14 -2
  49. data/rbi/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rbi +4 -1
  50. data/rbi/orb/resources/dimensional_price_groups.rbi +11 -2
  51. data/rbi/orb/resources/items.rbi +3 -1
  52. data/rbi/orb/resources/plans/migrations.rbi +3 -1
  53. data/rbi/orb/resources/prices.rbi +1 -0
  54. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +376 -0
  55. data/sig/orb/models/beta_create_plan_version_params.rbs +376 -0
  56. data/sig/orb/models/plan_create_params.rbs +188 -0
  57. data/sig/orb/models/price.rbs +332 -0
  58. data/sig/orb/models/price_create_params.rbs +178 -0
  59. data/sig/orb/models/price_evaluate_multiple_params.rbs +183 -0
  60. data/sig/orb/models/price_evaluate_preview_events_params.rbs +183 -0
  61. data/sig/orb/models/subscription_create_params.rbs +376 -0
  62. data/sig/orb/models/subscription_price_intervals_params.rbs +183 -0
  63. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +376 -0
  64. metadata +1 -1
@@ -1411,6 +1411,7 @@ module Orb
1411
1411
  Orb::Price::PackageWithAllocation::OrHash,
1412
1412
  Orb::Price::UnitWithPercent::OrHash,
1413
1413
  Orb::Price::MatrixWithAllocation::OrHash,
1414
+ Orb::Price::TieredMatrixWithAllocation::OrHash,
1414
1415
  Orb::Price::MatrixWithThresholdDiscounts::OrHash,
1415
1416
  Orb::Price::TieredWithProration::OrHash,
1416
1417
  Orb::Price::UnitWithProration::OrHash,
@@ -1216,6 +1216,7 @@ module Orb
1216
1216
  Orb::Price::PackageWithAllocation::OrHash,
1217
1217
  Orb::Price::UnitWithPercent::OrHash,
1218
1218
  Orb::Price::MatrixWithAllocation::OrHash,
1219
+ Orb::Price::TieredMatrixWithAllocation::OrHash,
1219
1220
  Orb::Price::MatrixWithThresholdDiscounts::OrHash,
1220
1221
  Orb::Price::TieredWithProration::OrHash,
1221
1222
  Orb::Price::UnitWithProration::OrHash,
@@ -1319,6 +1319,7 @@ module Orb
1319
1319
  Orb::Price::PackageWithAllocation::OrHash,
1320
1320
  Orb::Price::UnitWithPercent::OrHash,
1321
1321
  Orb::Price::MatrixWithAllocation::OrHash,
1322
+ Orb::Price::TieredMatrixWithAllocation::OrHash,
1322
1323
  Orb::Price::MatrixWithThresholdDiscounts::OrHash,
1323
1324
  Orb::Price::TieredWithProration::OrHash,
1324
1325
  Orb::Price::UnitWithProration::OrHash,
@@ -147,6 +147,7 @@ module Orb
147
147
  Orb::Price::PackageWithAllocation::OrHash,
148
148
  Orb::Price::UnitWithPercent::OrHash,
149
149
  Orb::Price::MatrixWithAllocation::OrHash,
150
+ Orb::Price::TieredMatrixWithAllocation::OrHash,
150
151
  Orb::Price::MatrixWithThresholdDiscounts::OrHash,
151
152
  Orb::Price::TieredWithProration::OrHash,
152
153
  Orb::Price::UnitWithProration::OrHash,
@@ -44,6 +44,7 @@ module Orb
44
44
  Orb::Price::PackageWithAllocation::OrHash,
45
45
  Orb::Price::UnitWithPercent::OrHash,
46
46
  Orb::Price::MatrixWithAllocation::OrHash,
47
+ Orb::Price::TieredMatrixWithAllocation::OrHash,
47
48
  Orb::Price::MatrixWithThresholdDiscounts::OrHash,
48
49
  Orb::Price::TieredWithProration::OrHash,
49
50
  Orb::Price::UnitWithProration::OrHash,
@@ -180,6 +180,7 @@ module Orb
180
180
  Orb::Price::PackageWithAllocation::OrHash,
181
181
  Orb::Price::UnitWithPercent::OrHash,
182
182
  Orb::Price::MatrixWithAllocation::OrHash,
183
+ Orb::Price::TieredMatrixWithAllocation::OrHash,
183
184
  Orb::Price::MatrixWithThresholdDiscounts::OrHash,
184
185
  Orb::Price::TieredWithProration::OrHash,
185
186
  Orb::Price::UnitWithProration::OrHash,
@@ -195,6 +195,7 @@ module Orb
195
195
  Orb::NewPlanPackageWithAllocationPrice,
196
196
  Orb::NewPlanUnitWithPercentPrice,
197
197
  Orb::NewPlanMatrixWithAllocationPrice,
198
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation,
198
199
  Orb::PlanCreateParams::Price::Price::MatrixWithThresholdDiscounts,
199
200
  Orb::PlanCreateParams::Price::Price::TieredWithProration,
200
201
  Orb::NewPlanUnitWithProrationPrice,
@@ -247,6 +248,7 @@ module Orb
247
248
  Orb::NewPlanPackageWithAllocationPrice::OrHash,
248
249
  Orb::NewPlanUnitWithPercentPrice::OrHash,
249
250
  Orb::NewPlanMatrixWithAllocationPrice::OrHash,
251
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::OrHash,
250
252
  Orb::PlanCreateParams::Price::Price::MatrixWithThresholdDiscounts::OrHash,
251
253
  Orb::PlanCreateParams::Price::Price::TieredWithProration::OrHash,
252
254
  Orb::NewPlanUnitWithProrationPrice::OrHash,
@@ -308,6 +310,7 @@ module Orb
308
310
  Orb::NewPlanPackageWithAllocationPrice,
309
311
  Orb::NewPlanUnitWithPercentPrice,
310
312
  Orb::NewPlanMatrixWithAllocationPrice,
313
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation,
311
314
  Orb::PlanCreateParams::Price::Price::MatrixWithThresholdDiscounts,
312
315
  Orb::PlanCreateParams::Price::Price::TieredWithProration,
313
316
  Orb::NewPlanUnitWithProrationPrice,
@@ -792,6 +795,7 @@ module Orb
792
795
  Orb::NewPlanPackageWithAllocationPrice,
793
796
  Orb::NewPlanUnitWithPercentPrice,
794
797
  Orb::NewPlanMatrixWithAllocationPrice,
798
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation,
795
799
  Orb::PlanCreateParams::Price::Price::MatrixWithThresholdDiscounts,
796
800
  Orb::PlanCreateParams::Price::Price::TieredWithProration,
797
801
  Orb::NewPlanUnitWithProrationPrice,
@@ -1742,6 +1746,465 @@ module Orb
1742
1746
  end
1743
1747
  end
1744
1748
 
1749
+ class TieredMatrixWithAllocation < Orb::Internal::Type::BaseModel
1750
+ OrHash =
1751
+ T.type_alias do
1752
+ T.any(
1753
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation,
1754
+ Orb::Internal::AnyHash
1755
+ )
1756
+ end
1757
+
1758
+ # The cadence to bill for this price on.
1759
+ sig do
1760
+ returns(
1761
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::Cadence::OrSymbol
1762
+ )
1763
+ end
1764
+ attr_accessor :cadence
1765
+
1766
+ # The id of the item the price will be associated with.
1767
+ sig { returns(String) }
1768
+ attr_accessor :item_id
1769
+
1770
+ # The pricing model type
1771
+ sig { returns(Symbol) }
1772
+ attr_accessor :model_type
1773
+
1774
+ # The name of the price.
1775
+ sig { returns(String) }
1776
+ attr_accessor :name
1777
+
1778
+ # Configuration for tiered_matrix_with_allocation pricing
1779
+ sig do
1780
+ returns(
1781
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::TieredMatrixWithAllocationConfig
1782
+ )
1783
+ end
1784
+ attr_reader :tiered_matrix_with_allocation_config
1785
+
1786
+ sig do
1787
+ params(
1788
+ tiered_matrix_with_allocation_config:
1789
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::TieredMatrixWithAllocationConfig::OrHash
1790
+ ).void
1791
+ end
1792
+ attr_writer :tiered_matrix_with_allocation_config
1793
+
1794
+ # The id of the billable metric for the price. Only needed if the price is
1795
+ # usage-based.
1796
+ sig { returns(T.nilable(String)) }
1797
+ attr_accessor :billable_metric_id
1798
+
1799
+ # If the Price represents a fixed cost, the price will be billed in-advance if
1800
+ # this is true, and in-arrears if this is false.
1801
+ sig { returns(T.nilable(T::Boolean)) }
1802
+ attr_accessor :billed_in_advance
1803
+
1804
+ # For custom cadence: specifies the duration of the billing period in days or
1805
+ # months.
1806
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
1807
+ attr_reader :billing_cycle_configuration
1808
+
1809
+ sig do
1810
+ params(
1811
+ billing_cycle_configuration:
1812
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
1813
+ ).void
1814
+ end
1815
+ attr_writer :billing_cycle_configuration
1816
+
1817
+ # The per unit conversion rate of the price currency to the invoicing currency.
1818
+ sig { returns(T.nilable(Float)) }
1819
+ attr_accessor :conversion_rate
1820
+
1821
+ # The configuration for the rate of the price currency to the invoicing currency.
1822
+ sig do
1823
+ returns(
1824
+ T.nilable(
1825
+ T.any(
1826
+ Orb::UnitConversionRateConfig,
1827
+ Orb::TieredConversionRateConfig
1828
+ )
1829
+ )
1830
+ )
1831
+ end
1832
+ attr_accessor :conversion_rate_config
1833
+
1834
+ # An ISO 4217 currency string, or custom pricing unit identifier, in which this
1835
+ # price is billed.
1836
+ sig { returns(T.nilable(String)) }
1837
+ attr_accessor :currency
1838
+
1839
+ # For dimensional price: specifies a price group and dimension values
1840
+ sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) }
1841
+ attr_reader :dimensional_price_configuration
1842
+
1843
+ sig do
1844
+ params(
1845
+ dimensional_price_configuration:
1846
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash)
1847
+ ).void
1848
+ end
1849
+ attr_writer :dimensional_price_configuration
1850
+
1851
+ # An alias for the price.
1852
+ sig { returns(T.nilable(String)) }
1853
+ attr_accessor :external_price_id
1854
+
1855
+ # If the Price represents a fixed cost, this represents the quantity of units
1856
+ # applied.
1857
+ sig { returns(T.nilable(Float)) }
1858
+ attr_accessor :fixed_price_quantity
1859
+
1860
+ # The property used to group this price on an invoice
1861
+ sig { returns(T.nilable(String)) }
1862
+ attr_accessor :invoice_grouping_key
1863
+
1864
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
1865
+ # If unspecified, a single invoice is produced per billing cycle.
1866
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
1867
+ attr_reader :invoicing_cycle_configuration
1868
+
1869
+ sig do
1870
+ params(
1871
+ invoicing_cycle_configuration:
1872
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
1873
+ ).void
1874
+ end
1875
+ attr_writer :invoicing_cycle_configuration
1876
+
1877
+ # The ID of the license type to associate with this price. On a usage price this
1878
+ # also marks the price as eligible to draw down from that license type's
1879
+ # allocation; a usage price created without it is billed normally. Usage prices
1880
+ # with a license type must use the `unit` model, and only draw down when their
1881
+ # currency matches the allocation's.
1882
+ sig { returns(T.nilable(String)) }
1883
+ attr_accessor :license_type_id
1884
+
1885
+ # User-specified key/value pairs for the resource. Individual keys can be removed
1886
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
1887
+ # by setting `metadata` to `null`.
1888
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
1889
+ attr_accessor :metadata
1890
+
1891
+ # A transient ID that can be used to reference this price when adding adjustments
1892
+ # in the same API call.
1893
+ sig { returns(T.nilable(String)) }
1894
+ attr_accessor :reference_id
1895
+
1896
+ sig do
1897
+ params(
1898
+ cadence:
1899
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::Cadence::OrSymbol,
1900
+ item_id: String,
1901
+ name: String,
1902
+ tiered_matrix_with_allocation_config:
1903
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::TieredMatrixWithAllocationConfig::OrHash,
1904
+ billable_metric_id: T.nilable(String),
1905
+ billed_in_advance: T.nilable(T::Boolean),
1906
+ billing_cycle_configuration:
1907
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
1908
+ conversion_rate: T.nilable(Float),
1909
+ conversion_rate_config:
1910
+ T.nilable(
1911
+ T.any(
1912
+ Orb::UnitConversionRateConfig::OrHash,
1913
+ Orb::TieredConversionRateConfig::OrHash
1914
+ )
1915
+ ),
1916
+ currency: T.nilable(String),
1917
+ dimensional_price_configuration:
1918
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash),
1919
+ external_price_id: T.nilable(String),
1920
+ fixed_price_quantity: T.nilable(Float),
1921
+ invoice_grouping_key: T.nilable(String),
1922
+ invoicing_cycle_configuration:
1923
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
1924
+ license_type_id: T.nilable(String),
1925
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
1926
+ reference_id: T.nilable(String),
1927
+ model_type: Symbol
1928
+ ).returns(T.attached_class)
1929
+ end
1930
+ def self.new(
1931
+ # The cadence to bill for this price on.
1932
+ cadence:,
1933
+ # The id of the item the price will be associated with.
1934
+ item_id:,
1935
+ # The name of the price.
1936
+ name:,
1937
+ # Configuration for tiered_matrix_with_allocation pricing
1938
+ tiered_matrix_with_allocation_config:,
1939
+ # The id of the billable metric for the price. Only needed if the price is
1940
+ # usage-based.
1941
+ billable_metric_id: nil,
1942
+ # If the Price represents a fixed cost, the price will be billed in-advance if
1943
+ # this is true, and in-arrears if this is false.
1944
+ billed_in_advance: nil,
1945
+ # For custom cadence: specifies the duration of the billing period in days or
1946
+ # months.
1947
+ billing_cycle_configuration: nil,
1948
+ # The per unit conversion rate of the price currency to the invoicing currency.
1949
+ conversion_rate: nil,
1950
+ # The configuration for the rate of the price currency to the invoicing currency.
1951
+ conversion_rate_config: nil,
1952
+ # An ISO 4217 currency string, or custom pricing unit identifier, in which this
1953
+ # price is billed.
1954
+ currency: nil,
1955
+ # For dimensional price: specifies a price group and dimension values
1956
+ dimensional_price_configuration: nil,
1957
+ # An alias for the price.
1958
+ external_price_id: nil,
1959
+ # If the Price represents a fixed cost, this represents the quantity of units
1960
+ # applied.
1961
+ fixed_price_quantity: nil,
1962
+ # The property used to group this price on an invoice
1963
+ invoice_grouping_key: nil,
1964
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
1965
+ # If unspecified, a single invoice is produced per billing cycle.
1966
+ invoicing_cycle_configuration: nil,
1967
+ # The ID of the license type to associate with this price. On a usage price this
1968
+ # also marks the price as eligible to draw down from that license type's
1969
+ # allocation; a usage price created without it is billed normally. Usage prices
1970
+ # with a license type must use the `unit` model, and only draw down when their
1971
+ # currency matches the allocation's.
1972
+ license_type_id: nil,
1973
+ # User-specified key/value pairs for the resource. Individual keys can be removed
1974
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
1975
+ # by setting `metadata` to `null`.
1976
+ metadata: nil,
1977
+ # A transient ID that can be used to reference this price when adding adjustments
1978
+ # in the same API call.
1979
+ reference_id: nil,
1980
+ # The pricing model type
1981
+ model_type: :tiered_matrix_with_allocation
1982
+ )
1983
+ end
1984
+
1985
+ sig do
1986
+ override.returns(
1987
+ {
1988
+ cadence:
1989
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::Cadence::OrSymbol,
1990
+ item_id: String,
1991
+ model_type: Symbol,
1992
+ name: String,
1993
+ tiered_matrix_with_allocation_config:
1994
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::TieredMatrixWithAllocationConfig,
1995
+ billable_metric_id: T.nilable(String),
1996
+ billed_in_advance: T.nilable(T::Boolean),
1997
+ billing_cycle_configuration:
1998
+ T.nilable(Orb::NewBillingCycleConfiguration),
1999
+ conversion_rate: T.nilable(Float),
2000
+ conversion_rate_config:
2001
+ T.nilable(
2002
+ T.any(
2003
+ Orb::UnitConversionRateConfig,
2004
+ Orb::TieredConversionRateConfig
2005
+ )
2006
+ ),
2007
+ currency: T.nilable(String),
2008
+ dimensional_price_configuration:
2009
+ T.nilable(Orb::NewDimensionalPriceConfiguration),
2010
+ external_price_id: T.nilable(String),
2011
+ fixed_price_quantity: T.nilable(Float),
2012
+ invoice_grouping_key: T.nilable(String),
2013
+ invoicing_cycle_configuration:
2014
+ T.nilable(Orb::NewBillingCycleConfiguration),
2015
+ license_type_id: T.nilable(String),
2016
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
2017
+ reference_id: T.nilable(String)
2018
+ }
2019
+ )
2020
+ end
2021
+ def to_hash
2022
+ end
2023
+
2024
+ # The cadence to bill for this price on.
2025
+ module Cadence
2026
+ extend Orb::Internal::Type::Enum
2027
+
2028
+ TaggedSymbol =
2029
+ T.type_alias do
2030
+ T.all(
2031
+ Symbol,
2032
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::Cadence
2033
+ )
2034
+ end
2035
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2036
+
2037
+ ANNUAL =
2038
+ T.let(
2039
+ :annual,
2040
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::Cadence::TaggedSymbol
2041
+ )
2042
+ SEMI_ANNUAL =
2043
+ T.let(
2044
+ :semi_annual,
2045
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::Cadence::TaggedSymbol
2046
+ )
2047
+ MONTHLY =
2048
+ T.let(
2049
+ :monthly,
2050
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::Cadence::TaggedSymbol
2051
+ )
2052
+ QUARTERLY =
2053
+ T.let(
2054
+ :quarterly,
2055
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::Cadence::TaggedSymbol
2056
+ )
2057
+ ONE_TIME =
2058
+ T.let(
2059
+ :one_time,
2060
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::Cadence::TaggedSymbol
2061
+ )
2062
+ CUSTOM =
2063
+ T.let(
2064
+ :custom,
2065
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::Cadence::TaggedSymbol
2066
+ )
2067
+
2068
+ sig do
2069
+ override.returns(
2070
+ T::Array[
2071
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::Cadence::TaggedSymbol
2072
+ ]
2073
+ )
2074
+ end
2075
+ def self.values
2076
+ end
2077
+ end
2078
+
2079
+ class TieredMatrixWithAllocationConfig < Orb::Internal::Type::BaseModel
2080
+ OrHash =
2081
+ T.type_alias do
2082
+ T.any(
2083
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::TieredMatrixWithAllocationConfig,
2084
+ Orb::Internal::AnyHash
2085
+ )
2086
+ end
2087
+
2088
+ # Usage allocation, pooled across all matrix cells
2089
+ sig { returns(String) }
2090
+ attr_accessor :allocation
2091
+
2092
+ # Per unit rate for usage whose matrix cell has no configured tiers
2093
+ sig { returns(String) }
2094
+ attr_accessor :default_unit_amount
2095
+
2096
+ # One or two event property values to evaluate matrix cells by
2097
+ sig { returns(T::Array[String]) }
2098
+ attr_accessor :dimensions
2099
+
2100
+ # Graduated tiers keyed by matrix cell; usage in a cell is tiered only against its
2101
+ # own rows
2102
+ sig do
2103
+ returns(
2104
+ T::Array[
2105
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::TieredMatrixWithAllocationConfig::Tier
2106
+ ]
2107
+ )
2108
+ end
2109
+ attr_accessor :tiers
2110
+
2111
+ # Configuration for tiered_matrix_with_allocation pricing
2112
+ sig do
2113
+ params(
2114
+ allocation: String,
2115
+ default_unit_amount: String,
2116
+ dimensions: T::Array[String],
2117
+ tiers:
2118
+ T::Array[
2119
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::TieredMatrixWithAllocationConfig::Tier::OrHash
2120
+ ]
2121
+ ).returns(T.attached_class)
2122
+ end
2123
+ def self.new(
2124
+ # Usage allocation, pooled across all matrix cells
2125
+ allocation:,
2126
+ # Per unit rate for usage whose matrix cell has no configured tiers
2127
+ default_unit_amount:,
2128
+ # One or two event property values to evaluate matrix cells by
2129
+ dimensions:,
2130
+ # Graduated tiers keyed by matrix cell; usage in a cell is tiered only against its
2131
+ # own rows
2132
+ tiers:
2133
+ )
2134
+ end
2135
+
2136
+ sig do
2137
+ override.returns(
2138
+ {
2139
+ allocation: String,
2140
+ default_unit_amount: String,
2141
+ dimensions: T::Array[String],
2142
+ tiers:
2143
+ T::Array[
2144
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::TieredMatrixWithAllocationConfig::Tier
2145
+ ]
2146
+ }
2147
+ )
2148
+ end
2149
+ def to_hash
2150
+ end
2151
+
2152
+ class Tier < Orb::Internal::Type::BaseModel
2153
+ OrHash =
2154
+ T.type_alias do
2155
+ T.any(
2156
+ Orb::PlanCreateParams::Price::Price::TieredMatrixWithAllocation::TieredMatrixWithAllocationConfig::Tier,
2157
+ Orb::Internal::AnyHash
2158
+ )
2159
+ end
2160
+
2161
+ # The matrix cell this tier applies to, as one or two dimension values
2162
+ sig { returns(T::Array[String]) }
2163
+ attr_accessor :dimension_values
2164
+
2165
+ # Exclusive tier starting value. The tier runs up to and including the next bound
2166
+ # configured for the same matrix cell.
2167
+ sig { returns(String) }
2168
+ attr_accessor :tier_lower_bound
2169
+
2170
+ # Per unit amount
2171
+ sig { returns(String) }
2172
+ attr_accessor :unit_amount
2173
+
2174
+ # Configuration for a single tier scoped to one matrix cell
2175
+ sig do
2176
+ params(
2177
+ dimension_values: T::Array[String],
2178
+ tier_lower_bound: String,
2179
+ unit_amount: String
2180
+ ).returns(T.attached_class)
2181
+ end
2182
+ def self.new(
2183
+ # The matrix cell this tier applies to, as one or two dimension values
2184
+ dimension_values:,
2185
+ # Exclusive tier starting value. The tier runs up to and including the next bound
2186
+ # configured for the same matrix cell.
2187
+ tier_lower_bound:,
2188
+ # Per unit amount
2189
+ unit_amount:
2190
+ )
2191
+ end
2192
+
2193
+ sig do
2194
+ override.returns(
2195
+ {
2196
+ dimension_values: T::Array[String],
2197
+ tier_lower_bound: String,
2198
+ unit_amount: String
2199
+ }
2200
+ )
2201
+ end
2202
+ def to_hash
2203
+ end
2204
+ end
2205
+ end
2206
+ end
2207
+
1745
2208
  class MatrixWithThresholdDiscounts < Orb::Internal::Type::BaseModel
1746
2209
  OrHash =
1747
2210
  T.type_alias do
@@ -59,6 +59,7 @@ module Orb
59
59
  Orb::Price::PackageWithAllocation::OrHash,
60
60
  Orb::Price::UnitWithPercent::OrHash,
61
61
  Orb::Price::MatrixWithAllocation::OrHash,
62
+ Orb::Price::TieredMatrixWithAllocation::OrHash,
62
63
  Orb::Price::MatrixWithThresholdDiscounts::OrHash,
63
64
  Orb::Price::TieredWithProration::OrHash,
64
65
  Orb::Price::UnitWithProration::OrHash,