metronome-sdk 3.5.0 → 3.6.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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +37 -0
  3. data/README.md +1 -1
  4. data/lib/metronome_sdk/client.rb +15 -1
  5. data/lib/metronome_sdk/internal/transport/base_client.rb +2 -0
  6. data/lib/metronome_sdk/models/contract_v2.rb +362 -4
  7. data/lib/metronome_sdk/models/v1/alert_create_params.rb +1 -0
  8. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +1 -177
  9. data/lib/metronome_sdk/models/v1/contract_create_params.rb +2 -179
  10. data/lib/metronome_sdk/models/v1/contract_list_seat_balances_params.rb +119 -0
  11. data/lib/metronome_sdk/models/v1/contract_list_seat_balances_response.rb +315 -0
  12. data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +31 -1
  13. data/lib/metronome_sdk/models/v1/contracts/product_update_params.rb +31 -1
  14. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +1 -0
  15. data/lib/metronome_sdk/models/v1/customers/invoice.rb +8 -1
  16. data/lib/metronome_sdk/models/v1/customers/invoice_list_params.rb +29 -1
  17. data/lib/metronome_sdk/models/v1/package_create_params.rb +1 -18
  18. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +362 -3
  19. data/lib/metronome_sdk/resources/v1/contracts/products.rb +6 -2
  20. data/lib/metronome_sdk/resources/v1/contracts.rb +69 -2
  21. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +5 -1
  22. data/lib/metronome_sdk/resources/v1/packages.rb +1 -3
  23. data/lib/metronome_sdk/version.rb +1 -1
  24. data/lib/metronome_sdk.rb +2 -0
  25. data/rbi/metronome_sdk/models/contract_v2.rbi +763 -4
  26. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +5 -0
  27. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +0 -396
  28. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +2 -398
  29. data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_params.rbi +179 -0
  30. data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_response.rbi +714 -0
  31. data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +74 -0
  32. data/rbi/metronome_sdk/models/v1/contracts/product_update_params.rbi +74 -0
  33. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +5 -0
  34. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +9 -0
  35. data/rbi/metronome_sdk/models/v1/customers/invoice_list_params.rbi +75 -0
  36. data/rbi/metronome_sdk/models/v1/package_create_params.rbi +0 -56
  37. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +792 -4
  38. data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +18 -0
  39. data/rbi/metronome_sdk/resources/v1/contracts.rbi +81 -3
  40. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +7 -0
  41. data/rbi/metronome_sdk/resources/v1/packages.rbi +0 -3
  42. data/sig/metronome_sdk/models/contract_v2.rbs +324 -6
  43. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +3 -1
  44. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +0 -137
  45. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +0 -137
  46. data/sig/metronome_sdk/models/v1/contract_list_seat_balances_params.rbs +96 -0
  47. data/sig/metronome_sdk/models/v1/contract_list_seat_balances_response.rbs +299 -0
  48. data/sig/metronome_sdk/models/v1/contracts/product_create_params.rbs +20 -0
  49. data/sig/metronome_sdk/models/v1/contracts/product_update_params.rbs +20 -0
  50. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +3 -1
  51. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +7 -0
  52. data/sig/metronome_sdk/models/v1/customers/invoice_list_params.rbs +29 -1
  53. data/sig/metronome_sdk/models/v1/package_create_params.rbs +0 -20
  54. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +319 -6
  55. data/sig/metronome_sdk/resources/v1/contracts/products.rbs +2 -0
  56. data/sig/metronome_sdk/resources/v1/contracts.rbs +15 -0
  57. data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +2 -0
  58. data/sig/metronome_sdk/resources/v1/packages.rbs +0 -1
  59. metadata +8 -2
@@ -287,11 +287,16 @@ module MetronomeSDK
287
287
  attr_writer :spend_threshold_configuration
288
288
 
289
289
  # List of subscriptions on the contract.
290
- sig { returns(T.nilable(T::Array[MetronomeSDK::Subscription])) }
290
+ sig do
291
+ returns(T.nilable(T::Array[MetronomeSDK::ContractV2::Subscription]))
292
+ end
291
293
  attr_reader :subscriptions
292
294
 
293
295
  sig do
294
- params(subscriptions: T::Array[MetronomeSDK::Subscription::OrHash]).void
296
+ params(
297
+ subscriptions:
298
+ T::Array[MetronomeSDK::ContractV2::Subscription::OrHash]
299
+ ).void
295
300
  end
296
301
  attr_writer :subscriptions
297
302
 
@@ -356,7 +361,8 @@ module MetronomeSDK
356
361
  MetronomeSDK::ContractV2::ScheduledChargesOnUsageInvoices::OrSymbol,
357
362
  spend_threshold_configuration:
358
363
  MetronomeSDK::SpendThresholdConfigurationV2::OrHash,
359
- subscriptions: T::Array[MetronomeSDK::Subscription::OrHash],
364
+ subscriptions:
365
+ T::Array[MetronomeSDK::ContractV2::Subscription::OrHash],
360
366
  total_contract_value: Float,
361
367
  uniqueness_key: String
362
368
  ).returns(T.attached_class)
@@ -470,7 +476,7 @@ module MetronomeSDK
470
476
  MetronomeSDK::ContractV2::ScheduledChargesOnUsageInvoices::TaggedSymbol,
471
477
  spend_threshold_configuration:
472
478
  MetronomeSDK::SpendThresholdConfigurationV2,
473
- subscriptions: T::Array[MetronomeSDK::Subscription],
479
+ subscriptions: T::Array[MetronomeSDK::ContractV2::Subscription],
474
480
  total_contract_value: Float,
475
481
  uniqueness_key: String
476
482
  }
@@ -3211,6 +3217,12 @@ module MetronomeSDK
3211
3217
  sig { params(applicable_product_tags: T::Array[String]).void }
3212
3218
  attr_writer :applicable_product_tags
3213
3219
 
3220
+ sig { returns(T.nilable(Time)) }
3221
+ attr_reader :archived_at
3222
+
3223
+ sig { params(archived_at: Time).void }
3224
+ attr_writer :archived_at
3225
+
3214
3226
  # The current balance of the credit or commit. This balance reflects the amount of
3215
3227
  # credit or commit that the customer has access to use at this moment - thus,
3216
3228
  # expired and upcoming credit or commit segments contribute 0 to the balance. The
@@ -3384,6 +3396,7 @@ module MetronomeSDK
3384
3396
  applicable_contract_ids: T::Array[String],
3385
3397
  applicable_product_ids: T::Array[String],
3386
3398
  applicable_product_tags: T::Array[String],
3399
+ archived_at: Time,
3387
3400
  balance: Float,
3388
3401
  contract: MetronomeSDK::ContractV2::Credit::Contract::OrHash,
3389
3402
  created_at: Time,
@@ -3425,6 +3438,7 @@ module MetronomeSDK
3425
3438
  applicable_contract_ids: nil,
3426
3439
  applicable_product_ids: nil,
3427
3440
  applicable_product_tags: nil,
3441
+ archived_at: nil,
3428
3442
  # The current balance of the credit or commit. This balance reflects the amount of
3429
3443
  # credit or commit that the customer has access to use at this moment - thus,
3430
3444
  # expired and upcoming credit or commit segments contribute 0 to the balance. The
@@ -3478,6 +3492,7 @@ module MetronomeSDK
3478
3492
  applicable_contract_ids: T::Array[String],
3479
3493
  applicable_product_ids: T::Array[String],
3480
3494
  applicable_product_tags: T::Array[String],
3495
+ archived_at: Time,
3481
3496
  balance: Float,
3482
3497
  contract: MetronomeSDK::ContractV2::Credit::Contract,
3483
3498
  created_at: Time,
@@ -6664,6 +6679,750 @@ module MetronomeSDK
6664
6679
  def self.values
6665
6680
  end
6666
6681
  end
6682
+
6683
+ class Subscription < MetronomeSDK::Internal::Type::BaseModel
6684
+ OrHash =
6685
+ T.type_alias do
6686
+ T.any(
6687
+ MetronomeSDK::ContractV2::Subscription,
6688
+ MetronomeSDK::Internal::AnyHash
6689
+ )
6690
+ end
6691
+
6692
+ # Previous, current, and next billing periods for the subscription.
6693
+ sig { returns(MetronomeSDK::ContractV2::Subscription::BillingPeriods) }
6694
+ attr_reader :billing_periods
6695
+
6696
+ sig do
6697
+ params(
6698
+ billing_periods:
6699
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::OrHash
6700
+ ).void
6701
+ end
6702
+ attr_writer :billing_periods
6703
+
6704
+ sig do
6705
+ returns(
6706
+ MetronomeSDK::ContractV2::Subscription::CollectionSchedule::TaggedSymbol
6707
+ )
6708
+ end
6709
+ attr_accessor :collection_schedule
6710
+
6711
+ sig { returns(MetronomeSDK::ContractV2::Subscription::Proration) }
6712
+ attr_reader :proration
6713
+
6714
+ sig do
6715
+ params(
6716
+ proration: MetronomeSDK::ContractV2::Subscription::Proration::OrHash
6717
+ ).void
6718
+ end
6719
+ attr_writer :proration
6720
+
6721
+ # Determines how the subscription's quantity is controlled. Defaults to
6722
+ # QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
6723
+ # directly on the subscription. `initial_quantity` must be provided with this
6724
+ # option. Compatible with recurring commits/credits that use POOLED allocation.
6725
+ # **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
6726
+ # user_123) to increment and decrement a subscription quantity, rather than
6727
+ # directly providing the quantity. You must use a **SEAT_BASED** subscription to
6728
+ # use a linked recurring credit with an allocation per seat. `seat_config` must be
6729
+ # provided with this option.
6730
+ sig do
6731
+ returns(
6732
+ MetronomeSDK::ContractV2::Subscription::QuantityManagementMode::TaggedSymbol
6733
+ )
6734
+ end
6735
+ attr_accessor :quantity_management_mode
6736
+
6737
+ # List of quantity schedule items for the subscription. Only includes the current
6738
+ # quantity and future quantity changes.
6739
+ sig do
6740
+ returns(
6741
+ T::Array[MetronomeSDK::ContractV2::Subscription::QuantitySchedule]
6742
+ )
6743
+ end
6744
+ attr_accessor :quantity_schedule
6745
+
6746
+ sig { returns(Time) }
6747
+ attr_accessor :starting_at
6748
+
6749
+ sig do
6750
+ returns(MetronomeSDK::ContractV2::Subscription::SubscriptionRate)
6751
+ end
6752
+ attr_reader :subscription_rate
6753
+
6754
+ sig do
6755
+ params(
6756
+ subscription_rate:
6757
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::OrHash
6758
+ ).void
6759
+ end
6760
+ attr_writer :subscription_rate
6761
+
6762
+ sig { returns(T.nilable(String)) }
6763
+ attr_reader :id
6764
+
6765
+ sig { params(id: String).void }
6766
+ attr_writer :id
6767
+
6768
+ # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
6769
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
6770
+ attr_reader :custom_fields
6771
+
6772
+ sig { params(custom_fields: T::Hash[Symbol, String]).void }
6773
+ attr_writer :custom_fields
6774
+
6775
+ sig { returns(T.nilable(String)) }
6776
+ attr_reader :description
6777
+
6778
+ sig { params(description: String).void }
6779
+ attr_writer :description
6780
+
6781
+ sig { returns(T.nilable(Time)) }
6782
+ attr_reader :ending_before
6783
+
6784
+ sig { params(ending_before: Time).void }
6785
+ attr_writer :ending_before
6786
+
6787
+ sig { returns(T.nilable(String)) }
6788
+ attr_reader :fiat_credit_type_id
6789
+
6790
+ sig { params(fiat_credit_type_id: String).void }
6791
+ attr_writer :fiat_credit_type_id
6792
+
6793
+ sig { returns(T.nilable(String)) }
6794
+ attr_reader :name
6795
+
6796
+ sig { params(name: String).void }
6797
+ attr_writer :name
6798
+
6799
+ sig do
6800
+ returns(T.nilable(MetronomeSDK::ContractV2::Subscription::SeatConfig))
6801
+ end
6802
+ attr_reader :seat_config
6803
+
6804
+ sig do
6805
+ params(
6806
+ seat_config:
6807
+ MetronomeSDK::ContractV2::Subscription::SeatConfig::OrHash
6808
+ ).void
6809
+ end
6810
+ attr_writer :seat_config
6811
+
6812
+ sig do
6813
+ params(
6814
+ billing_periods:
6815
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::OrHash,
6816
+ collection_schedule:
6817
+ MetronomeSDK::ContractV2::Subscription::CollectionSchedule::OrSymbol,
6818
+ proration:
6819
+ MetronomeSDK::ContractV2::Subscription::Proration::OrHash,
6820
+ quantity_management_mode:
6821
+ MetronomeSDK::ContractV2::Subscription::QuantityManagementMode::OrSymbol,
6822
+ quantity_schedule:
6823
+ T::Array[
6824
+ MetronomeSDK::ContractV2::Subscription::QuantitySchedule::OrHash
6825
+ ],
6826
+ starting_at: Time,
6827
+ subscription_rate:
6828
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::OrHash,
6829
+ id: String,
6830
+ custom_fields: T::Hash[Symbol, String],
6831
+ description: String,
6832
+ ending_before: Time,
6833
+ fiat_credit_type_id: String,
6834
+ name: String,
6835
+ seat_config:
6836
+ MetronomeSDK::ContractV2::Subscription::SeatConfig::OrHash
6837
+ ).returns(T.attached_class)
6838
+ end
6839
+ def self.new(
6840
+ # Previous, current, and next billing periods for the subscription.
6841
+ billing_periods:,
6842
+ collection_schedule:,
6843
+ proration:,
6844
+ # Determines how the subscription's quantity is controlled. Defaults to
6845
+ # QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
6846
+ # directly on the subscription. `initial_quantity` must be provided with this
6847
+ # option. Compatible with recurring commits/credits that use POOLED allocation.
6848
+ # **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
6849
+ # user_123) to increment and decrement a subscription quantity, rather than
6850
+ # directly providing the quantity. You must use a **SEAT_BASED** subscription to
6851
+ # use a linked recurring credit with an allocation per seat. `seat_config` must be
6852
+ # provided with this option.
6853
+ quantity_management_mode:,
6854
+ # List of quantity schedule items for the subscription. Only includes the current
6855
+ # quantity and future quantity changes.
6856
+ quantity_schedule:,
6857
+ starting_at:,
6858
+ subscription_rate:,
6859
+ id: nil,
6860
+ # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
6861
+ custom_fields: nil,
6862
+ description: nil,
6863
+ ending_before: nil,
6864
+ fiat_credit_type_id: nil,
6865
+ name: nil,
6866
+ seat_config: nil
6867
+ )
6868
+ end
6869
+
6870
+ sig do
6871
+ override.returns(
6872
+ {
6873
+ billing_periods:
6874
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods,
6875
+ collection_schedule:
6876
+ MetronomeSDK::ContractV2::Subscription::CollectionSchedule::TaggedSymbol,
6877
+ proration: MetronomeSDK::ContractV2::Subscription::Proration,
6878
+ quantity_management_mode:
6879
+ MetronomeSDK::ContractV2::Subscription::QuantityManagementMode::TaggedSymbol,
6880
+ quantity_schedule:
6881
+ T::Array[
6882
+ MetronomeSDK::ContractV2::Subscription::QuantitySchedule
6883
+ ],
6884
+ starting_at: Time,
6885
+ subscription_rate:
6886
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate,
6887
+ id: String,
6888
+ custom_fields: T::Hash[Symbol, String],
6889
+ description: String,
6890
+ ending_before: Time,
6891
+ fiat_credit_type_id: String,
6892
+ name: String,
6893
+ seat_config: MetronomeSDK::ContractV2::Subscription::SeatConfig
6894
+ }
6895
+ )
6896
+ end
6897
+ def to_hash
6898
+ end
6899
+
6900
+ class BillingPeriods < MetronomeSDK::Internal::Type::BaseModel
6901
+ OrHash =
6902
+ T.type_alias do
6903
+ T.any(
6904
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods,
6905
+ MetronomeSDK::Internal::AnyHash
6906
+ )
6907
+ end
6908
+
6909
+ sig do
6910
+ returns(
6911
+ T.nilable(
6912
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Current
6913
+ )
6914
+ )
6915
+ end
6916
+ attr_reader :current
6917
+
6918
+ sig do
6919
+ params(
6920
+ current:
6921
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Current::OrHash
6922
+ ).void
6923
+ end
6924
+ attr_writer :current
6925
+
6926
+ sig do
6927
+ returns(
6928
+ T.nilable(
6929
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Next
6930
+ )
6931
+ )
6932
+ end
6933
+ attr_reader :next_
6934
+
6935
+ sig do
6936
+ params(
6937
+ next_:
6938
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Next::OrHash
6939
+ ).void
6940
+ end
6941
+ attr_writer :next_
6942
+
6943
+ sig do
6944
+ returns(
6945
+ T.nilable(
6946
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Previous
6947
+ )
6948
+ )
6949
+ end
6950
+ attr_reader :previous
6951
+
6952
+ sig do
6953
+ params(
6954
+ previous:
6955
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Previous::OrHash
6956
+ ).void
6957
+ end
6958
+ attr_writer :previous
6959
+
6960
+ # Previous, current, and next billing periods for the subscription.
6961
+ sig do
6962
+ params(
6963
+ current:
6964
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Current::OrHash,
6965
+ next_:
6966
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Next::OrHash,
6967
+ previous:
6968
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Previous::OrHash
6969
+ ).returns(T.attached_class)
6970
+ end
6971
+ def self.new(current: nil, next_: nil, previous: nil)
6972
+ end
6973
+
6974
+ sig do
6975
+ override.returns(
6976
+ {
6977
+ current:
6978
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Current,
6979
+ next_:
6980
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Next,
6981
+ previous:
6982
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Previous
6983
+ }
6984
+ )
6985
+ end
6986
+ def to_hash
6987
+ end
6988
+
6989
+ class Current < MetronomeSDK::Internal::Type::BaseModel
6990
+ OrHash =
6991
+ T.type_alias do
6992
+ T.any(
6993
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Current,
6994
+ MetronomeSDK::Internal::AnyHash
6995
+ )
6996
+ end
6997
+
6998
+ sig { returns(Time) }
6999
+ attr_accessor :ending_before
7000
+
7001
+ sig { returns(Time) }
7002
+ attr_accessor :starting_at
7003
+
7004
+ sig do
7005
+ params(ending_before: Time, starting_at: Time).returns(
7006
+ T.attached_class
7007
+ )
7008
+ end
7009
+ def self.new(ending_before:, starting_at:)
7010
+ end
7011
+
7012
+ sig { override.returns({ ending_before: Time, starting_at: Time }) }
7013
+ def to_hash
7014
+ end
7015
+ end
7016
+
7017
+ class Next < MetronomeSDK::Internal::Type::BaseModel
7018
+ OrHash =
7019
+ T.type_alias do
7020
+ T.any(
7021
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Next,
7022
+ MetronomeSDK::Internal::AnyHash
7023
+ )
7024
+ end
7025
+
7026
+ sig { returns(Time) }
7027
+ attr_accessor :ending_before
7028
+
7029
+ sig { returns(Time) }
7030
+ attr_accessor :starting_at
7031
+
7032
+ sig do
7033
+ params(ending_before: Time, starting_at: Time).returns(
7034
+ T.attached_class
7035
+ )
7036
+ end
7037
+ def self.new(ending_before:, starting_at:)
7038
+ end
7039
+
7040
+ sig { override.returns({ ending_before: Time, starting_at: Time }) }
7041
+ def to_hash
7042
+ end
7043
+ end
7044
+
7045
+ class Previous < MetronomeSDK::Internal::Type::BaseModel
7046
+ OrHash =
7047
+ T.type_alias do
7048
+ T.any(
7049
+ MetronomeSDK::ContractV2::Subscription::BillingPeriods::Previous,
7050
+ MetronomeSDK::Internal::AnyHash
7051
+ )
7052
+ end
7053
+
7054
+ sig { returns(Time) }
7055
+ attr_accessor :ending_before
7056
+
7057
+ sig { returns(Time) }
7058
+ attr_accessor :starting_at
7059
+
7060
+ sig do
7061
+ params(ending_before: Time, starting_at: Time).returns(
7062
+ T.attached_class
7063
+ )
7064
+ end
7065
+ def self.new(ending_before:, starting_at:)
7066
+ end
7067
+
7068
+ sig { override.returns({ ending_before: Time, starting_at: Time }) }
7069
+ def to_hash
7070
+ end
7071
+ end
7072
+ end
7073
+
7074
+ module CollectionSchedule
7075
+ extend MetronomeSDK::Internal::Type::Enum
7076
+
7077
+ TaggedSymbol =
7078
+ T.type_alias do
7079
+ T.all(
7080
+ Symbol,
7081
+ MetronomeSDK::ContractV2::Subscription::CollectionSchedule
7082
+ )
7083
+ end
7084
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
7085
+
7086
+ ADVANCE =
7087
+ T.let(
7088
+ :ADVANCE,
7089
+ MetronomeSDK::ContractV2::Subscription::CollectionSchedule::TaggedSymbol
7090
+ )
7091
+ ARREARS =
7092
+ T.let(
7093
+ :ARREARS,
7094
+ MetronomeSDK::ContractV2::Subscription::CollectionSchedule::TaggedSymbol
7095
+ )
7096
+
7097
+ sig do
7098
+ override.returns(
7099
+ T::Array[
7100
+ MetronomeSDK::ContractV2::Subscription::CollectionSchedule::TaggedSymbol
7101
+ ]
7102
+ )
7103
+ end
7104
+ def self.values
7105
+ end
7106
+ end
7107
+
7108
+ class Proration < MetronomeSDK::Internal::Type::BaseModel
7109
+ OrHash =
7110
+ T.type_alias do
7111
+ T.any(
7112
+ MetronomeSDK::ContractV2::Subscription::Proration,
7113
+ MetronomeSDK::Internal::AnyHash
7114
+ )
7115
+ end
7116
+
7117
+ sig do
7118
+ returns(
7119
+ MetronomeSDK::ContractV2::Subscription::Proration::InvoiceBehavior::TaggedSymbol
7120
+ )
7121
+ end
7122
+ attr_accessor :invoice_behavior
7123
+
7124
+ sig { returns(T::Boolean) }
7125
+ attr_accessor :is_prorated
7126
+
7127
+ sig do
7128
+ params(
7129
+ invoice_behavior:
7130
+ MetronomeSDK::ContractV2::Subscription::Proration::InvoiceBehavior::OrSymbol,
7131
+ is_prorated: T::Boolean
7132
+ ).returns(T.attached_class)
7133
+ end
7134
+ def self.new(invoice_behavior:, is_prorated:)
7135
+ end
7136
+
7137
+ sig do
7138
+ override.returns(
7139
+ {
7140
+ invoice_behavior:
7141
+ MetronomeSDK::ContractV2::Subscription::Proration::InvoiceBehavior::TaggedSymbol,
7142
+ is_prorated: T::Boolean
7143
+ }
7144
+ )
7145
+ end
7146
+ def to_hash
7147
+ end
7148
+
7149
+ module InvoiceBehavior
7150
+ extend MetronomeSDK::Internal::Type::Enum
7151
+
7152
+ TaggedSymbol =
7153
+ T.type_alias do
7154
+ T.all(
7155
+ Symbol,
7156
+ MetronomeSDK::ContractV2::Subscription::Proration::InvoiceBehavior
7157
+ )
7158
+ end
7159
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
7160
+
7161
+ BILL_IMMEDIATELY =
7162
+ T.let(
7163
+ :BILL_IMMEDIATELY,
7164
+ MetronomeSDK::ContractV2::Subscription::Proration::InvoiceBehavior::TaggedSymbol
7165
+ )
7166
+ BILL_ON_NEXT_COLLECTION_DATE =
7167
+ T.let(
7168
+ :BILL_ON_NEXT_COLLECTION_DATE,
7169
+ MetronomeSDK::ContractV2::Subscription::Proration::InvoiceBehavior::TaggedSymbol
7170
+ )
7171
+
7172
+ sig do
7173
+ override.returns(
7174
+ T::Array[
7175
+ MetronomeSDK::ContractV2::Subscription::Proration::InvoiceBehavior::TaggedSymbol
7176
+ ]
7177
+ )
7178
+ end
7179
+ def self.values
7180
+ end
7181
+ end
7182
+ end
7183
+
7184
+ # Determines how the subscription's quantity is controlled. Defaults to
7185
+ # QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
7186
+ # directly on the subscription. `initial_quantity` must be provided with this
7187
+ # option. Compatible with recurring commits/credits that use POOLED allocation.
7188
+ # **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
7189
+ # user_123) to increment and decrement a subscription quantity, rather than
7190
+ # directly providing the quantity. You must use a **SEAT_BASED** subscription to
7191
+ # use a linked recurring credit with an allocation per seat. `seat_config` must be
7192
+ # provided with this option.
7193
+ module QuantityManagementMode
7194
+ extend MetronomeSDK::Internal::Type::Enum
7195
+
7196
+ TaggedSymbol =
7197
+ T.type_alias do
7198
+ T.all(
7199
+ Symbol,
7200
+ MetronomeSDK::ContractV2::Subscription::QuantityManagementMode
7201
+ )
7202
+ end
7203
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
7204
+
7205
+ SEAT_BASED =
7206
+ T.let(
7207
+ :SEAT_BASED,
7208
+ MetronomeSDK::ContractV2::Subscription::QuantityManagementMode::TaggedSymbol
7209
+ )
7210
+ QUANTITY_ONLY =
7211
+ T.let(
7212
+ :QUANTITY_ONLY,
7213
+ MetronomeSDK::ContractV2::Subscription::QuantityManagementMode::TaggedSymbol
7214
+ )
7215
+
7216
+ sig do
7217
+ override.returns(
7218
+ T::Array[
7219
+ MetronomeSDK::ContractV2::Subscription::QuantityManagementMode::TaggedSymbol
7220
+ ]
7221
+ )
7222
+ end
7223
+ def self.values
7224
+ end
7225
+ end
7226
+
7227
+ class QuantitySchedule < MetronomeSDK::Internal::Type::BaseModel
7228
+ OrHash =
7229
+ T.type_alias do
7230
+ T.any(
7231
+ MetronomeSDK::ContractV2::Subscription::QuantitySchedule,
7232
+ MetronomeSDK::Internal::AnyHash
7233
+ )
7234
+ end
7235
+
7236
+ sig { returns(Float) }
7237
+ attr_accessor :quantity
7238
+
7239
+ sig { returns(Time) }
7240
+ attr_accessor :starting_at
7241
+
7242
+ sig { returns(T.nilable(Time)) }
7243
+ attr_reader :ending_before
7244
+
7245
+ sig { params(ending_before: Time).void }
7246
+ attr_writer :ending_before
7247
+
7248
+ sig do
7249
+ params(
7250
+ quantity: Float,
7251
+ starting_at: Time,
7252
+ ending_before: Time
7253
+ ).returns(T.attached_class)
7254
+ end
7255
+ def self.new(quantity:, starting_at:, ending_before: nil)
7256
+ end
7257
+
7258
+ sig do
7259
+ override.returns(
7260
+ { quantity: Float, starting_at: Time, ending_before: Time }
7261
+ )
7262
+ end
7263
+ def to_hash
7264
+ end
7265
+ end
7266
+
7267
+ class SubscriptionRate < MetronomeSDK::Internal::Type::BaseModel
7268
+ OrHash =
7269
+ T.type_alias do
7270
+ T.any(
7271
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate,
7272
+ MetronomeSDK::Internal::AnyHash
7273
+ )
7274
+ end
7275
+
7276
+ sig do
7277
+ returns(
7278
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::BillingFrequency::TaggedSymbol
7279
+ )
7280
+ end
7281
+ attr_accessor :billing_frequency
7282
+
7283
+ sig do
7284
+ returns(
7285
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::Product
7286
+ )
7287
+ end
7288
+ attr_reader :product
7289
+
7290
+ sig do
7291
+ params(
7292
+ product:
7293
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::Product::OrHash
7294
+ ).void
7295
+ end
7296
+ attr_writer :product
7297
+
7298
+ sig do
7299
+ params(
7300
+ billing_frequency:
7301
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::BillingFrequency::OrSymbol,
7302
+ product:
7303
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::Product::OrHash
7304
+ ).returns(T.attached_class)
7305
+ end
7306
+ def self.new(billing_frequency:, product:)
7307
+ end
7308
+
7309
+ sig do
7310
+ override.returns(
7311
+ {
7312
+ billing_frequency:
7313
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::BillingFrequency::TaggedSymbol,
7314
+ product:
7315
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::Product
7316
+ }
7317
+ )
7318
+ end
7319
+ def to_hash
7320
+ end
7321
+
7322
+ module BillingFrequency
7323
+ extend MetronomeSDK::Internal::Type::Enum
7324
+
7325
+ TaggedSymbol =
7326
+ T.type_alias do
7327
+ T.all(
7328
+ Symbol,
7329
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::BillingFrequency
7330
+ )
7331
+ end
7332
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
7333
+
7334
+ MONTHLY =
7335
+ T.let(
7336
+ :MONTHLY,
7337
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::BillingFrequency::TaggedSymbol
7338
+ )
7339
+ QUARTERLY =
7340
+ T.let(
7341
+ :QUARTERLY,
7342
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::BillingFrequency::TaggedSymbol
7343
+ )
7344
+ ANNUAL =
7345
+ T.let(
7346
+ :ANNUAL,
7347
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::BillingFrequency::TaggedSymbol
7348
+ )
7349
+ WEEKLY =
7350
+ T.let(
7351
+ :WEEKLY,
7352
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::BillingFrequency::TaggedSymbol
7353
+ )
7354
+
7355
+ sig do
7356
+ override.returns(
7357
+ T::Array[
7358
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::BillingFrequency::TaggedSymbol
7359
+ ]
7360
+ )
7361
+ end
7362
+ def self.values
7363
+ end
7364
+ end
7365
+
7366
+ class Product < MetronomeSDK::Internal::Type::BaseModel
7367
+ OrHash =
7368
+ T.type_alias do
7369
+ T.any(
7370
+ MetronomeSDK::ContractV2::Subscription::SubscriptionRate::Product,
7371
+ MetronomeSDK::Internal::AnyHash
7372
+ )
7373
+ end
7374
+
7375
+ sig { returns(String) }
7376
+ attr_accessor :id
7377
+
7378
+ sig { returns(String) }
7379
+ attr_accessor :name
7380
+
7381
+ sig { params(id: String, name: String).returns(T.attached_class) }
7382
+ def self.new(id:, name:)
7383
+ end
7384
+
7385
+ sig { override.returns({ id: String, name: String }) }
7386
+ def to_hash
7387
+ end
7388
+ end
7389
+ end
7390
+
7391
+ class SeatConfig < MetronomeSDK::Internal::Type::BaseModel
7392
+ OrHash =
7393
+ T.type_alias do
7394
+ T.any(
7395
+ MetronomeSDK::ContractV2::Subscription::SeatConfig,
7396
+ MetronomeSDK::Internal::AnyHash
7397
+ )
7398
+ end
7399
+
7400
+ # The property name, sent on usage events, that identifies the seat ID associated
7401
+ # with the usage event. For example, the property name might be seat_id or
7402
+ # user_id. The property must be set as a group key on billable metrics and a
7403
+ # presentation/pricing group key on contract products. This allows linked
7404
+ # recurring credits with an allocation per seat to be consumed by only one seat's
7405
+ # usage.
7406
+ sig { returns(String) }
7407
+ attr_accessor :seat_group_key
7408
+
7409
+ sig { params(seat_group_key: String).returns(T.attached_class) }
7410
+ def self.new(
7411
+ # The property name, sent on usage events, that identifies the seat ID associated
7412
+ # with the usage event. For example, the property name might be seat_id or
7413
+ # user_id. The property must be set as a group key on billable metrics and a
7414
+ # presentation/pricing group key on contract products. This allows linked
7415
+ # recurring credits with an allocation per seat to be consumed by only one seat's
7416
+ # usage.
7417
+ seat_group_key:
7418
+ )
7419
+ end
7420
+
7421
+ sig { override.returns({ seat_group_key: String }) }
7422
+ def to_hash
7423
+ end
7424
+ end
7425
+ end
6667
7426
  end
6668
7427
  end
6669
7428
  end