orb-billing 1.24.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/orb/models/alert.rb +4 -2
  5. data/lib/orb/models/alert_update_params.rb +5 -3
  6. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +530 -6
  7. data/lib/orb/models/beta_create_plan_version_params.rb +526 -6
  8. data/lib/orb/models/changed_subscription_resources.rb +5 -5
  9. data/lib/orb/models/invoice.rb +5 -5
  10. data/lib/orb/models/invoice_fetch_upcoming_response.rb +5 -5
  11. data/lib/orb/models/invoice_issue_summary_response.rb +3 -3
  12. data/lib/orb/models/invoice_line_item_create_response.rb +2 -2
  13. data/lib/orb/models/invoice_list_summary_response.rb +3 -3
  14. data/lib/orb/models/per_price_cost.rb +2 -2
  15. data/lib/orb/models/plan.rb +2 -2
  16. data/lib/orb/models/plan_create_params.rb +259 -3
  17. data/lib/orb/models/plan_version.rb +2 -2
  18. data/lib/orb/models/price.rb +433 -1
  19. data/lib/orb/models/price_create_params.rb +244 -3
  20. data/lib/orb/models/price_evaluate_multiple_params.rb +255 -3
  21. data/lib/orb/models/price_evaluate_preview_events_params.rb +255 -3
  22. data/lib/orb/models/price_interval.rb +2 -2
  23. data/lib/orb/models/subscription_create_params.rb +521 -6
  24. data/lib/orb/models/subscription_price_intervals_params.rb +251 -3
  25. data/lib/orb/models/subscription_schedule_plan_change_params.rb +530 -6
  26. data/lib/orb/resources/alerts.rb +5 -2
  27. data/lib/orb/resources/customers/costs.rb +20 -0
  28. data/lib/orb/resources/licenses/external_licenses.rb +7 -0
  29. data/lib/orb/resources/licenses/usage.rb +3 -0
  30. data/lib/orb/resources/prices/external_price_id.rb +2 -2
  31. data/lib/orb/resources/prices.rb +5 -5
  32. data/lib/orb/resources/subscriptions.rb +39 -6
  33. data/lib/orb/version.rb +1 -1
  34. data/rbi/orb/models/alert.rbi +6 -2
  35. data/rbi/orb/models/alert_update_params.rbi +8 -4
  36. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +2789 -1903
  37. data/rbi/orb/models/beta_create_plan_version_params.rbi +2788 -1902
  38. data/rbi/orb/models/changed_subscription_resources.rbi +7 -6
  39. data/rbi/orb/models/invoice.rbi +7 -6
  40. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +7 -6
  41. data/rbi/orb/models/invoice_issue_summary_response.rbi +6 -6
  42. data/rbi/orb/models/invoice_line_item_create_response.rbi +1 -0
  43. data/rbi/orb/models/invoice_list_summary_response.rbi +6 -6
  44. data/rbi/orb/models/per_price_cost.rbi +1 -0
  45. data/rbi/orb/models/plan.rbi +1 -0
  46. data/rbi/orb/models/plan_create_params.rbi +443 -0
  47. data/rbi/orb/models/plan_version.rbi +1 -0
  48. data/rbi/orb/models/price.rbi +766 -0
  49. data/rbi/orb/models/price_create_params.rbi +431 -0
  50. data/rbi/orb/models/price_evaluate_multiple_params.rbi +431 -0
  51. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +431 -0
  52. data/rbi/orb/models/price_interval.rbi +1 -0
  53. data/rbi/orb/models/subscription_create_params.rbi +2489 -1603
  54. data/rbi/orb/models/subscription_price_intervals_params.rbi +431 -0
  55. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +2483 -1597
  56. data/rbi/orb/resources/alerts.rbi +8 -3
  57. data/rbi/orb/resources/customers/costs.rbi +20 -0
  58. data/rbi/orb/resources/licenses/external_licenses.rbi +7 -0
  59. data/rbi/orb/resources/licenses/usage.rbi +3 -0
  60. data/rbi/orb/resources/prices.rbi +1 -0
  61. data/rbi/orb/resources/subscriptions.rbi +39 -6
  62. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +366 -0
  63. data/sig/orb/models/beta_create_plan_version_params.rbs +366 -0
  64. data/sig/orb/models/plan_create_params.rbs +183 -0
  65. data/sig/orb/models/price.rbs +327 -0
  66. data/sig/orb/models/price_create_params.rbs +173 -0
  67. data/sig/orb/models/price_evaluate_multiple_params.rbs +178 -0
  68. data/sig/orb/models/price_evaluate_preview_events_params.rbs +178 -0
  69. data/sig/orb/models/subscription_create_params.rbs +366 -0
  70. data/sig/orb/models/subscription_price_intervals_params.rbs +178 -0
  71. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +366 -0
  72. metadata +2 -2
@@ -28,6 +28,7 @@ module Orb
28
28
  Orb::Price::TieredPackage,
29
29
  Orb::Price::TieredWithMinimum,
30
30
  Orb::Price::GroupedTiered,
31
+ Orb::Price::GroupedTieredMatrix,
31
32
  Orb::Price::TieredPackageWithMinimum,
32
33
  Orb::Price::PackageWithAllocation,
33
34
  Orb::Price::UnitWithPercent,
@@ -6557,6 +6558,771 @@ module Orb
6557
6558
  end
6558
6559
  end
6559
6560
 
6561
+ class GroupedTieredMatrix < Orb::Internal::Type::BaseModel
6562
+ OrHash =
6563
+ T.type_alias do
6564
+ T.any(Orb::Price::GroupedTieredMatrix, Orb::Internal::AnyHash)
6565
+ end
6566
+
6567
+ sig { returns(String) }
6568
+ attr_accessor :id
6569
+
6570
+ sig { returns(T.nilable(Orb::BillableMetricTiny)) }
6571
+ attr_reader :billable_metric
6572
+
6573
+ sig do
6574
+ params(
6575
+ billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash)
6576
+ ).void
6577
+ end
6578
+ attr_writer :billable_metric
6579
+
6580
+ sig { returns(Orb::BillingCycleConfiguration) }
6581
+ attr_reader :billing_cycle_configuration
6582
+
6583
+ sig do
6584
+ params(
6585
+ billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash
6586
+ ).void
6587
+ end
6588
+ attr_writer :billing_cycle_configuration
6589
+
6590
+ sig do
6591
+ returns(Orb::Price::GroupedTieredMatrix::BillingMode::TaggedSymbol)
6592
+ end
6593
+ attr_accessor :billing_mode
6594
+
6595
+ sig { returns(Orb::Price::GroupedTieredMatrix::Cadence::TaggedSymbol) }
6596
+ attr_accessor :cadence
6597
+
6598
+ sig do
6599
+ returns(
6600
+ T.nilable(
6601
+ T::Array[Orb::Price::GroupedTieredMatrix::CompositePriceFilter]
6602
+ )
6603
+ )
6604
+ end
6605
+ attr_accessor :composite_price_filters
6606
+
6607
+ sig { returns(T.nilable(Float)) }
6608
+ attr_accessor :conversion_rate
6609
+
6610
+ sig { returns(T.nilable(Orb::ConversionRateConfig::Variants)) }
6611
+ attr_accessor :conversion_rate_config
6612
+
6613
+ sig { returns(Time) }
6614
+ attr_accessor :created_at
6615
+
6616
+ sig { returns(T.nilable(Orb::Allocation)) }
6617
+ attr_reader :credit_allocation
6618
+
6619
+ sig do
6620
+ params(credit_allocation: T.nilable(Orb::Allocation::OrHash)).void
6621
+ end
6622
+ attr_writer :credit_allocation
6623
+
6624
+ sig { returns(String) }
6625
+ attr_accessor :currency
6626
+
6627
+ sig { returns(T.nilable(Orb::Discount::Variants)) }
6628
+ attr_accessor :discount
6629
+
6630
+ sig { returns(T.nilable(String)) }
6631
+ attr_accessor :external_price_id
6632
+
6633
+ sig { returns(T.nilable(Float)) }
6634
+ attr_accessor :fixed_price_quantity
6635
+
6636
+ # Configuration for grouped_tiered_matrix pricing
6637
+ sig do
6638
+ returns(Orb::Price::GroupedTieredMatrix::GroupedTieredMatrixConfig)
6639
+ end
6640
+ attr_reader :grouped_tiered_matrix_config
6641
+
6642
+ sig do
6643
+ params(
6644
+ grouped_tiered_matrix_config:
6645
+ Orb::Price::GroupedTieredMatrix::GroupedTieredMatrixConfig::OrHash
6646
+ ).void
6647
+ end
6648
+ attr_writer :grouped_tiered_matrix_config
6649
+
6650
+ sig { returns(T.nilable(String)) }
6651
+ attr_accessor :invoice_grouping_key
6652
+
6653
+ sig { returns(T.nilable(Orb::BillingCycleConfiguration)) }
6654
+ attr_reader :invoicing_cycle_configuration
6655
+
6656
+ sig do
6657
+ params(
6658
+ invoicing_cycle_configuration:
6659
+ T.nilable(Orb::BillingCycleConfiguration::OrHash)
6660
+ ).void
6661
+ end
6662
+ attr_writer :invoicing_cycle_configuration
6663
+
6664
+ # A minimal representation of an Item containing only the essential identifying
6665
+ # information.
6666
+ sig { returns(Orb::ItemSlim) }
6667
+ attr_reader :item
6668
+
6669
+ sig { params(item: Orb::ItemSlim::OrHash).void }
6670
+ attr_writer :item
6671
+
6672
+ sig { returns(T.nilable(Orb::Maximum)) }
6673
+ attr_reader :maximum
6674
+
6675
+ sig { params(maximum: T.nilable(Orb::Maximum::OrHash)).void }
6676
+ attr_writer :maximum
6677
+
6678
+ sig { returns(T.nilable(String)) }
6679
+ attr_accessor :maximum_amount
6680
+
6681
+ # User specified key-value pairs for the resource. If not present, this defaults
6682
+ # to an empty dictionary. Individual keys can be removed by setting the value to
6683
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
6684
+ # `null`.
6685
+ sig { returns(T::Hash[Symbol, String]) }
6686
+ attr_accessor :metadata
6687
+
6688
+ sig { returns(T.nilable(Orb::Minimum)) }
6689
+ attr_reader :minimum
6690
+
6691
+ sig { params(minimum: T.nilable(Orb::Minimum::OrHash)).void }
6692
+ attr_writer :minimum
6693
+
6694
+ sig { returns(T.nilable(String)) }
6695
+ attr_accessor :minimum_amount
6696
+
6697
+ # The pricing model type
6698
+ sig { returns(Symbol) }
6699
+ attr_accessor :model_type
6700
+
6701
+ sig { returns(String) }
6702
+ attr_accessor :name
6703
+
6704
+ sig { returns(T.nilable(Integer)) }
6705
+ attr_accessor :plan_phase_order
6706
+
6707
+ sig do
6708
+ returns(Orb::Price::GroupedTieredMatrix::PriceType::TaggedSymbol)
6709
+ end
6710
+ attr_accessor :price_type
6711
+
6712
+ # The price id this price replaces. This price will take the place of the replaced
6713
+ # price in plan version migrations.
6714
+ sig { returns(T.nilable(String)) }
6715
+ attr_accessor :replaces_price_id
6716
+
6717
+ sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) }
6718
+ attr_reader :dimensional_price_configuration
6719
+
6720
+ sig do
6721
+ params(
6722
+ dimensional_price_configuration:
6723
+ T.nilable(Orb::DimensionalPriceConfiguration::OrHash)
6724
+ ).void
6725
+ end
6726
+ attr_writer :dimensional_price_configuration
6727
+
6728
+ # The LicenseType resource represents a type of license that can be assigned to
6729
+ # users. License types are used during billing by grouping metrics on the
6730
+ # configured grouping key.
6731
+ sig { returns(T.nilable(Orb::Price::GroupedTieredMatrix::LicenseType)) }
6732
+ attr_reader :license_type
6733
+
6734
+ sig do
6735
+ params(
6736
+ license_type:
6737
+ T.nilable(Orb::Price::GroupedTieredMatrix::LicenseType::OrHash)
6738
+ ).void
6739
+ end
6740
+ attr_writer :license_type
6741
+
6742
+ sig do
6743
+ params(
6744
+ id: String,
6745
+ billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash),
6746
+ billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash,
6747
+ billing_mode:
6748
+ Orb::Price::GroupedTieredMatrix::BillingMode::OrSymbol,
6749
+ cadence: Orb::Price::GroupedTieredMatrix::Cadence::OrSymbol,
6750
+ composite_price_filters:
6751
+ T.nilable(
6752
+ T::Array[
6753
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::OrHash
6754
+ ]
6755
+ ),
6756
+ conversion_rate: T.nilable(Float),
6757
+ conversion_rate_config:
6758
+ T.nilable(
6759
+ T.any(
6760
+ Orb::UnitConversionRateConfig::OrHash,
6761
+ Orb::TieredConversionRateConfig::OrHash
6762
+ )
6763
+ ),
6764
+ created_at: Time,
6765
+ credit_allocation: T.nilable(Orb::Allocation::OrHash),
6766
+ currency: String,
6767
+ discount:
6768
+ T.nilable(
6769
+ T.any(
6770
+ Orb::PercentageDiscount::OrHash,
6771
+ Orb::TrialDiscount::OrHash,
6772
+ Orb::UsageDiscount::OrHash,
6773
+ Orb::AmountDiscount::OrHash,
6774
+ Orb::Discount::TieredPercentage::OrHash
6775
+ )
6776
+ ),
6777
+ external_price_id: T.nilable(String),
6778
+ fixed_price_quantity: T.nilable(Float),
6779
+ grouped_tiered_matrix_config:
6780
+ Orb::Price::GroupedTieredMatrix::GroupedTieredMatrixConfig::OrHash,
6781
+ invoice_grouping_key: T.nilable(String),
6782
+ invoicing_cycle_configuration:
6783
+ T.nilable(Orb::BillingCycleConfiguration::OrHash),
6784
+ item: Orb::ItemSlim::OrHash,
6785
+ maximum: T.nilable(Orb::Maximum::OrHash),
6786
+ maximum_amount: T.nilable(String),
6787
+ metadata: T::Hash[Symbol, String],
6788
+ minimum: T.nilable(Orb::Minimum::OrHash),
6789
+ minimum_amount: T.nilable(String),
6790
+ name: String,
6791
+ plan_phase_order: T.nilable(Integer),
6792
+ price_type: Orb::Price::GroupedTieredMatrix::PriceType::OrSymbol,
6793
+ replaces_price_id: T.nilable(String),
6794
+ dimensional_price_configuration:
6795
+ T.nilable(Orb::DimensionalPriceConfiguration::OrHash),
6796
+ license_type:
6797
+ T.nilable(Orb::Price::GroupedTieredMatrix::LicenseType::OrHash),
6798
+ model_type: Symbol
6799
+ ).returns(T.attached_class)
6800
+ end
6801
+ def self.new(
6802
+ id:,
6803
+ billable_metric:,
6804
+ billing_cycle_configuration:,
6805
+ billing_mode:,
6806
+ cadence:,
6807
+ composite_price_filters:,
6808
+ conversion_rate:,
6809
+ conversion_rate_config:,
6810
+ created_at:,
6811
+ credit_allocation:,
6812
+ currency:,
6813
+ discount:,
6814
+ external_price_id:,
6815
+ fixed_price_quantity:,
6816
+ # Configuration for grouped_tiered_matrix pricing
6817
+ grouped_tiered_matrix_config:,
6818
+ invoice_grouping_key:,
6819
+ invoicing_cycle_configuration:,
6820
+ # A minimal representation of an Item containing only the essential identifying
6821
+ # information.
6822
+ item:,
6823
+ maximum:,
6824
+ maximum_amount:,
6825
+ # User specified key-value pairs for the resource. If not present, this defaults
6826
+ # to an empty dictionary. Individual keys can be removed by setting the value to
6827
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
6828
+ # `null`.
6829
+ metadata:,
6830
+ minimum:,
6831
+ minimum_amount:,
6832
+ name:,
6833
+ plan_phase_order:,
6834
+ price_type:,
6835
+ # The price id this price replaces. This price will take the place of the replaced
6836
+ # price in plan version migrations.
6837
+ replaces_price_id:,
6838
+ dimensional_price_configuration: nil,
6839
+ # The LicenseType resource represents a type of license that can be assigned to
6840
+ # users. License types are used during billing by grouping metrics on the
6841
+ # configured grouping key.
6842
+ license_type: nil,
6843
+ # The pricing model type
6844
+ model_type: :grouped_tiered_matrix
6845
+ )
6846
+ end
6847
+
6848
+ sig do
6849
+ override.returns(
6850
+ {
6851
+ id: String,
6852
+ billable_metric: T.nilable(Orb::BillableMetricTiny),
6853
+ billing_cycle_configuration: Orb::BillingCycleConfiguration,
6854
+ billing_mode:
6855
+ Orb::Price::GroupedTieredMatrix::BillingMode::TaggedSymbol,
6856
+ cadence: Orb::Price::GroupedTieredMatrix::Cadence::TaggedSymbol,
6857
+ composite_price_filters:
6858
+ T.nilable(
6859
+ T::Array[
6860
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter
6861
+ ]
6862
+ ),
6863
+ conversion_rate: T.nilable(Float),
6864
+ conversion_rate_config:
6865
+ T.nilable(Orb::ConversionRateConfig::Variants),
6866
+ created_at: Time,
6867
+ credit_allocation: T.nilable(Orb::Allocation),
6868
+ currency: String,
6869
+ discount: T.nilable(Orb::Discount::Variants),
6870
+ external_price_id: T.nilable(String),
6871
+ fixed_price_quantity: T.nilable(Float),
6872
+ grouped_tiered_matrix_config:
6873
+ Orb::Price::GroupedTieredMatrix::GroupedTieredMatrixConfig,
6874
+ invoice_grouping_key: T.nilable(String),
6875
+ invoicing_cycle_configuration:
6876
+ T.nilable(Orb::BillingCycleConfiguration),
6877
+ item: Orb::ItemSlim,
6878
+ maximum: T.nilable(Orb::Maximum),
6879
+ maximum_amount: T.nilable(String),
6880
+ metadata: T::Hash[Symbol, String],
6881
+ minimum: T.nilable(Orb::Minimum),
6882
+ minimum_amount: T.nilable(String),
6883
+ model_type: Symbol,
6884
+ name: String,
6885
+ plan_phase_order: T.nilable(Integer),
6886
+ price_type:
6887
+ Orb::Price::GroupedTieredMatrix::PriceType::TaggedSymbol,
6888
+ replaces_price_id: T.nilable(String),
6889
+ dimensional_price_configuration:
6890
+ T.nilable(Orb::DimensionalPriceConfiguration),
6891
+ license_type:
6892
+ T.nilable(Orb::Price::GroupedTieredMatrix::LicenseType)
6893
+ }
6894
+ )
6895
+ end
6896
+ def to_hash
6897
+ end
6898
+
6899
+ module BillingMode
6900
+ extend Orb::Internal::Type::Enum
6901
+
6902
+ TaggedSymbol =
6903
+ T.type_alias do
6904
+ T.all(Symbol, Orb::Price::GroupedTieredMatrix::BillingMode)
6905
+ end
6906
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
6907
+
6908
+ IN_ADVANCE =
6909
+ T.let(
6910
+ :in_advance,
6911
+ Orb::Price::GroupedTieredMatrix::BillingMode::TaggedSymbol
6912
+ )
6913
+ IN_ARREAR =
6914
+ T.let(
6915
+ :in_arrear,
6916
+ Orb::Price::GroupedTieredMatrix::BillingMode::TaggedSymbol
6917
+ )
6918
+
6919
+ sig do
6920
+ override.returns(
6921
+ T::Array[
6922
+ Orb::Price::GroupedTieredMatrix::BillingMode::TaggedSymbol
6923
+ ]
6924
+ )
6925
+ end
6926
+ def self.values
6927
+ end
6928
+ end
6929
+
6930
+ module Cadence
6931
+ extend Orb::Internal::Type::Enum
6932
+
6933
+ TaggedSymbol =
6934
+ T.type_alias do
6935
+ T.all(Symbol, Orb::Price::GroupedTieredMatrix::Cadence)
6936
+ end
6937
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
6938
+
6939
+ ONE_TIME =
6940
+ T.let(
6941
+ :one_time,
6942
+ Orb::Price::GroupedTieredMatrix::Cadence::TaggedSymbol
6943
+ )
6944
+ MONTHLY =
6945
+ T.let(
6946
+ :monthly,
6947
+ Orb::Price::GroupedTieredMatrix::Cadence::TaggedSymbol
6948
+ )
6949
+ QUARTERLY =
6950
+ T.let(
6951
+ :quarterly,
6952
+ Orb::Price::GroupedTieredMatrix::Cadence::TaggedSymbol
6953
+ )
6954
+ SEMI_ANNUAL =
6955
+ T.let(
6956
+ :semi_annual,
6957
+ Orb::Price::GroupedTieredMatrix::Cadence::TaggedSymbol
6958
+ )
6959
+ ANNUAL =
6960
+ T.let(
6961
+ :annual,
6962
+ Orb::Price::GroupedTieredMatrix::Cadence::TaggedSymbol
6963
+ )
6964
+ CUSTOM =
6965
+ T.let(
6966
+ :custom,
6967
+ Orb::Price::GroupedTieredMatrix::Cadence::TaggedSymbol
6968
+ )
6969
+
6970
+ sig do
6971
+ override.returns(
6972
+ T::Array[Orb::Price::GroupedTieredMatrix::Cadence::TaggedSymbol]
6973
+ )
6974
+ end
6975
+ def self.values
6976
+ end
6977
+ end
6978
+
6979
+ class CompositePriceFilter < Orb::Internal::Type::BaseModel
6980
+ OrHash =
6981
+ T.type_alias do
6982
+ T.any(
6983
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter,
6984
+ Orb::Internal::AnyHash
6985
+ )
6986
+ end
6987
+
6988
+ # The property of the price to filter on.
6989
+ sig do
6990
+ returns(
6991
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Field::TaggedSymbol
6992
+ )
6993
+ end
6994
+ attr_accessor :field
6995
+
6996
+ # Should prices that match the filter be included or excluded.
6997
+ sig do
6998
+ returns(
6999
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Operator::TaggedSymbol
7000
+ )
7001
+ end
7002
+ attr_accessor :operator
7003
+
7004
+ # The IDs or values that match this filter.
7005
+ sig { returns(T::Array[String]) }
7006
+ attr_accessor :values
7007
+
7008
+ sig do
7009
+ params(
7010
+ field:
7011
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Field::OrSymbol,
7012
+ operator:
7013
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Operator::OrSymbol,
7014
+ values: T::Array[String]
7015
+ ).returns(T.attached_class)
7016
+ end
7017
+ def self.new(
7018
+ # The property of the price to filter on.
7019
+ field:,
7020
+ # Should prices that match the filter be included or excluded.
7021
+ operator:,
7022
+ # The IDs or values that match this filter.
7023
+ values:
7024
+ )
7025
+ end
7026
+
7027
+ sig do
7028
+ override.returns(
7029
+ {
7030
+ field:
7031
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Field::TaggedSymbol,
7032
+ operator:
7033
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Operator::TaggedSymbol,
7034
+ values: T::Array[String]
7035
+ }
7036
+ )
7037
+ end
7038
+ def to_hash
7039
+ end
7040
+
7041
+ # The property of the price to filter on.
7042
+ module Field
7043
+ extend Orb::Internal::Type::Enum
7044
+
7045
+ TaggedSymbol =
7046
+ T.type_alias do
7047
+ T.all(
7048
+ Symbol,
7049
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Field
7050
+ )
7051
+ end
7052
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
7053
+
7054
+ PRICE_ID =
7055
+ T.let(
7056
+ :price_id,
7057
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Field::TaggedSymbol
7058
+ )
7059
+ ITEM_ID =
7060
+ T.let(
7061
+ :item_id,
7062
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Field::TaggedSymbol
7063
+ )
7064
+ PRICE_TYPE =
7065
+ T.let(
7066
+ :price_type,
7067
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Field::TaggedSymbol
7068
+ )
7069
+ CURRENCY =
7070
+ T.let(
7071
+ :currency,
7072
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Field::TaggedSymbol
7073
+ )
7074
+ PRICING_UNIT_ID =
7075
+ T.let(
7076
+ :pricing_unit_id,
7077
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Field::TaggedSymbol
7078
+ )
7079
+
7080
+ sig do
7081
+ override.returns(
7082
+ T::Array[
7083
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Field::TaggedSymbol
7084
+ ]
7085
+ )
7086
+ end
7087
+ def self.values
7088
+ end
7089
+ end
7090
+
7091
+ # Should prices that match the filter be included or excluded.
7092
+ module Operator
7093
+ extend Orb::Internal::Type::Enum
7094
+
7095
+ TaggedSymbol =
7096
+ T.type_alias do
7097
+ T.all(
7098
+ Symbol,
7099
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Operator
7100
+ )
7101
+ end
7102
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
7103
+
7104
+ INCLUDES =
7105
+ T.let(
7106
+ :includes,
7107
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Operator::TaggedSymbol
7108
+ )
7109
+ EXCLUDES =
7110
+ T.let(
7111
+ :excludes,
7112
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Operator::TaggedSymbol
7113
+ )
7114
+
7115
+ sig do
7116
+ override.returns(
7117
+ T::Array[
7118
+ Orb::Price::GroupedTieredMatrix::CompositePriceFilter::Operator::TaggedSymbol
7119
+ ]
7120
+ )
7121
+ end
7122
+ def self.values
7123
+ end
7124
+ end
7125
+ end
7126
+
7127
+ class GroupedTieredMatrixConfig < Orb::Internal::Type::BaseModel
7128
+ OrHash =
7129
+ T.type_alias do
7130
+ T.any(
7131
+ Orb::Price::GroupedTieredMatrix::GroupedTieredMatrixConfig,
7132
+ Orb::Internal::AnyHash
7133
+ )
7134
+ end
7135
+
7136
+ # Per unit rate for usage whose dimension value has no configured tiers
7137
+ sig { returns(String) }
7138
+ attr_accessor :default_unit_amount
7139
+
7140
+ # The billable metric property used to group usage before tiering
7141
+ sig { returns(String) }
7142
+ attr_accessor :dimension
7143
+
7144
+ # Graduated tiers keyed by dimension value; usage for a value is tiered only
7145
+ # against its own rows
7146
+ sig do
7147
+ returns(
7148
+ T::Array[
7149
+ Orb::Price::GroupedTieredMatrix::GroupedTieredMatrixConfig::Tier
7150
+ ]
7151
+ )
7152
+ end
7153
+ attr_accessor :tiers
7154
+
7155
+ # Configuration for grouped_tiered_matrix pricing
7156
+ sig do
7157
+ params(
7158
+ default_unit_amount: String,
7159
+ dimension: String,
7160
+ tiers:
7161
+ T::Array[
7162
+ Orb::Price::GroupedTieredMatrix::GroupedTieredMatrixConfig::Tier::OrHash
7163
+ ]
7164
+ ).returns(T.attached_class)
7165
+ end
7166
+ def self.new(
7167
+ # Per unit rate for usage whose dimension value has no configured tiers
7168
+ default_unit_amount:,
7169
+ # The billable metric property used to group usage before tiering
7170
+ dimension:,
7171
+ # Graduated tiers keyed by dimension value; usage for a value is tiered only
7172
+ # against its own rows
7173
+ tiers:
7174
+ )
7175
+ end
7176
+
7177
+ sig do
7178
+ override.returns(
7179
+ {
7180
+ default_unit_amount: String,
7181
+ dimension: String,
7182
+ tiers:
7183
+ T::Array[
7184
+ Orb::Price::GroupedTieredMatrix::GroupedTieredMatrixConfig::Tier
7185
+ ]
7186
+ }
7187
+ )
7188
+ end
7189
+ def to_hash
7190
+ end
7191
+
7192
+ class Tier < Orb::Internal::Type::BaseModel
7193
+ OrHash =
7194
+ T.type_alias do
7195
+ T.any(
7196
+ Orb::Price::GroupedTieredMatrix::GroupedTieredMatrixConfig::Tier,
7197
+ Orb::Internal::AnyHash
7198
+ )
7199
+ end
7200
+
7201
+ # The dimension value this tier applies to
7202
+ sig { returns(String) }
7203
+ attr_accessor :dimension_value
7204
+
7205
+ sig { returns(String) }
7206
+ attr_accessor :tier_lower_bound
7207
+
7208
+ # Per unit amount
7209
+ sig { returns(String) }
7210
+ attr_accessor :unit_amount
7211
+
7212
+ # Configuration for a single tier scoped to a dimension value
7213
+ sig do
7214
+ params(
7215
+ dimension_value: String,
7216
+ tier_lower_bound: String,
7217
+ unit_amount: String
7218
+ ).returns(T.attached_class)
7219
+ end
7220
+ def self.new(
7221
+ # The dimension value this tier applies to
7222
+ dimension_value:,
7223
+ tier_lower_bound:,
7224
+ # Per unit amount
7225
+ unit_amount:
7226
+ )
7227
+ end
7228
+
7229
+ sig do
7230
+ override.returns(
7231
+ {
7232
+ dimension_value: String,
7233
+ tier_lower_bound: String,
7234
+ unit_amount: String
7235
+ }
7236
+ )
7237
+ end
7238
+ def to_hash
7239
+ end
7240
+ end
7241
+ end
7242
+
7243
+ module PriceType
7244
+ extend Orb::Internal::Type::Enum
7245
+
7246
+ TaggedSymbol =
7247
+ T.type_alias do
7248
+ T.all(Symbol, Orb::Price::GroupedTieredMatrix::PriceType)
7249
+ end
7250
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
7251
+
7252
+ USAGE_PRICE =
7253
+ T.let(
7254
+ :usage_price,
7255
+ Orb::Price::GroupedTieredMatrix::PriceType::TaggedSymbol
7256
+ )
7257
+ FIXED_PRICE =
7258
+ T.let(
7259
+ :fixed_price,
7260
+ Orb::Price::GroupedTieredMatrix::PriceType::TaggedSymbol
7261
+ )
7262
+ COMPOSITE_PRICE =
7263
+ T.let(
7264
+ :composite_price,
7265
+ Orb::Price::GroupedTieredMatrix::PriceType::TaggedSymbol
7266
+ )
7267
+
7268
+ sig do
7269
+ override.returns(
7270
+ T::Array[Orb::Price::GroupedTieredMatrix::PriceType::TaggedSymbol]
7271
+ )
7272
+ end
7273
+ def self.values
7274
+ end
7275
+ end
7276
+
7277
+ class LicenseType < Orb::Internal::Type::BaseModel
7278
+ OrHash =
7279
+ T.type_alias do
7280
+ T.any(
7281
+ Orb::Price::GroupedTieredMatrix::LicenseType,
7282
+ Orb::Internal::AnyHash
7283
+ )
7284
+ end
7285
+
7286
+ # The Orb-assigned unique identifier for the license type.
7287
+ sig { returns(String) }
7288
+ attr_accessor :id
7289
+
7290
+ # The key used for grouping licenses of this type. This is typically a user
7291
+ # identifier field.
7292
+ sig { returns(String) }
7293
+ attr_accessor :grouping_key
7294
+
7295
+ # The name of the license type.
7296
+ sig { returns(String) }
7297
+ attr_accessor :name
7298
+
7299
+ # The LicenseType resource represents a type of license that can be assigned to
7300
+ # users. License types are used during billing by grouping metrics on the
7301
+ # configured grouping key.
7302
+ sig do
7303
+ params(id: String, grouping_key: String, name: String).returns(
7304
+ T.attached_class
7305
+ )
7306
+ end
7307
+ def self.new(
7308
+ # The Orb-assigned unique identifier for the license type.
7309
+ id:,
7310
+ # The key used for grouping licenses of this type. This is typically a user
7311
+ # identifier field.
7312
+ grouping_key:,
7313
+ # The name of the license type.
7314
+ name:
7315
+ )
7316
+ end
7317
+
7318
+ sig do
7319
+ override.returns({ id: String, grouping_key: String, name: String })
7320
+ end
7321
+ def to_hash
7322
+ end
7323
+ end
7324
+ end
7325
+
6560
7326
  class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel
6561
7327
  OrHash =
6562
7328
  T.type_alias do