metronome-sdk 3.6.0 → 3.8.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 (141) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +54 -0
  3. data/README.md +1 -1
  4. data/lib/metronome_sdk/internal/transport/base_client.rb +4 -1
  5. data/lib/metronome_sdk/internal/type/enum.rb +0 -25
  6. data/lib/metronome_sdk/models/commit.rb +36 -1
  7. data/lib/metronome_sdk/models/contract.rb +140 -1
  8. data/lib/metronome_sdk/models/contract_v2.rb +457 -8
  9. data/lib/metronome_sdk/models/contract_without_amendments.rb +320 -5
  10. data/lib/metronome_sdk/models/credit.rb +10 -1
  11. data/lib/metronome_sdk/models/override.rb +7 -1
  12. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +113 -2
  13. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +105 -2
  14. data/lib/metronome_sdk/models/spend_threshold_configuration.rb +33 -1
  15. data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +33 -1
  16. data/lib/metronome_sdk/models/subscription.rb +90 -2
  17. data/lib/metronome_sdk/models/v1/alert_create_params.rb +127 -1
  18. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +46 -5
  19. data/lib/metronome_sdk/models/v1/contract_create_params.rb +436 -12
  20. data/lib/metronome_sdk/models/v1/contract_create_response.rb +1308 -3
  21. data/lib/metronome_sdk/models/v1/contract_get_subscription_seats_history_params.rb +88 -0
  22. data/lib/metronome_sdk/models/v1/contract_get_subscription_seats_history_response.rb +62 -0
  23. data/lib/metronome_sdk/models/v1/contract_list_seat_balances_params.rb +10 -1
  24. data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +127 -1
  25. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +130 -3
  26. data/lib/metronome_sdk/models/v1/customers/invoice_list_params.rb +10 -1
  27. data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +2 -0
  28. data/lib/metronome_sdk/models/v1/package_create_params.rb +394 -11
  29. data/lib/metronome_sdk/models/v1/package_list_response.rb +374 -8
  30. data/lib/metronome_sdk/models/v1/package_retrieve_response.rb +378 -8
  31. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +817 -13
  32. data/lib/metronome_sdk/models/v2/contract_edit_response.rb +4310 -3
  33. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +600 -10
  34. data/lib/metronome_sdk/resources/v1/alerts.rb +3 -1
  35. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb +4 -0
  36. data/lib/metronome_sdk/resources/v1/contracts.rb +71 -2
  37. data/lib/metronome_sdk/resources/v1/customers/alerts.rb +4 -2
  38. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +3 -1
  39. data/lib/metronome_sdk/resources/v1/dashboards.rb +7 -2
  40. data/lib/metronome_sdk/resources/v1/packages.rb +6 -5
  41. data/lib/metronome_sdk/resources/v1.rb +0 -4
  42. data/lib/metronome_sdk/resources/v2/contracts.rb +5 -1
  43. data/lib/metronome_sdk/version.rb +1 -1
  44. data/lib/metronome_sdk.rb +2 -8
  45. data/rbi/metronome_sdk/models/commit.rbi +61 -0
  46. data/rbi/metronome_sdk/models/contract.rbi +354 -0
  47. data/rbi/metronome_sdk/models/contract_v2.rbi +1132 -11
  48. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +831 -0
  49. data/rbi/metronome_sdk/models/credit.rbi +13 -0
  50. data/rbi/metronome_sdk/models/override.rbi +9 -0
  51. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +299 -6
  52. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +287 -6
  53. data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +78 -3
  54. data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +78 -3
  55. data/rbi/metronome_sdk/models/subscription.rbi +212 -3
  56. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +373 -0
  57. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +81 -6
  58. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +1095 -17
  59. data/rbi/metronome_sdk/models/v1/contract_create_response.rbi +2911 -4
  60. data/rbi/metronome_sdk/models/v1/contract_get_subscription_seats_history_params.rbi +112 -0
  61. data/rbi/metronome_sdk/models/v1/contract_get_subscription_seats_history_response.rbi +119 -0
  62. data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_params.rbi +13 -0
  63. data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +360 -0
  64. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +379 -2
  65. data/rbi/metronome_sdk/models/v1/customers/invoice_list_params.rbi +13 -0
  66. data/rbi/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbi +10 -0
  67. data/rbi/metronome_sdk/models/v1/package_create_params.rbi +1049 -42
  68. data/rbi/metronome_sdk/models/v1/package_list_response.rbi +1051 -54
  69. data/rbi/metronome_sdk/models/v1/package_retrieve_response.rbi +1051 -54
  70. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +2130 -114
  71. data/rbi/metronome_sdk/models/v2/contract_edit_response.rbi +9749 -4
  72. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1567 -82
  73. data/rbi/metronome_sdk/resources/v1/alerts.rbi +8 -0
  74. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbi +4 -0
  75. data/rbi/metronome_sdk/resources/v1/contracts.rbi +77 -0
  76. data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +8 -1
  77. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +4 -0
  78. data/rbi/metronome_sdk/resources/v1/dashboards.rbi +7 -2
  79. data/rbi/metronome_sdk/resources/v1/packages.rbi +8 -4
  80. data/rbi/metronome_sdk/resources/v1.rbi +0 -3
  81. data/rbi/metronome_sdk/resources/v2/contracts.rbi +10 -0
  82. data/sig/metronome_sdk/models/commit.rbs +26 -0
  83. data/sig/metronome_sdk/models/contract.rbs +151 -0
  84. data/sig/metronome_sdk/models/contract_v2.rbs +448 -5
  85. data/sig/metronome_sdk/models/contract_without_amendments.rbs +320 -2
  86. data/sig/metronome_sdk/models/credit.rbs +7 -0
  87. data/sig/metronome_sdk/models/override.rbs +7 -0
  88. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +116 -6
  89. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +116 -6
  90. data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +31 -3
  91. data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +31 -3
  92. data/sig/metronome_sdk/models/subscription.rbs +88 -3
  93. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +144 -0
  94. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +26 -0
  95. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +412 -5
  96. data/sig/metronome_sdk/models/v1/contract_create_response.rbs +1210 -4
  97. data/sig/metronome_sdk/models/v1/contract_get_subscription_seats_history_params.rbs +63 -0
  98. data/sig/metronome_sdk/models/v1/contract_get_subscription_seats_history_response.rbs +59 -0
  99. data/sig/metronome_sdk/models/v1/contract_list_seat_balances_params.rbs +7 -0
  100. data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +141 -0
  101. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +150 -0
  102. data/sig/metronome_sdk/models/v1/customers/invoice_list_params.rbs +8 -1
  103. data/sig/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbs +4 -0
  104. data/sig/metronome_sdk/models/v1/package_create_params.rbs +386 -5
  105. data/sig/metronome_sdk/models/v1/package_list_response.rbs +380 -5
  106. data/sig/metronome_sdk/models/v1/package_retrieve_response.rbs +378 -5
  107. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +751 -14
  108. data/sig/metronome_sdk/models/v2/contract_edit_response.rbs +4215 -4
  109. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +569 -14
  110. data/sig/metronome_sdk/resources/v1/alerts.rbs +1 -0
  111. data/sig/metronome_sdk/resources/v1/contracts.rbs +14 -0
  112. data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +1 -0
  113. data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +1 -0
  114. data/sig/metronome_sdk/resources/v1/packages.rbs +1 -0
  115. data/sig/metronome_sdk/resources/v1.rbs +0 -2
  116. data/sig/metronome_sdk/resources/v2/contracts.rbs +2 -0
  117. metadata +8 -26
  118. data/lib/metronome_sdk/models/v1/payment.rb +0 -196
  119. data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +0 -28
  120. data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +0 -18
  121. data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +0 -28
  122. data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +0 -18
  123. data/lib/metronome_sdk/models/v1/payment_list_params.rb +0 -53
  124. data/lib/metronome_sdk/models/v1/payment_status.rb +0 -19
  125. data/lib/metronome_sdk/resources/v1/payments.rb +0 -102
  126. data/rbi/metronome_sdk/models/v1/payment.rbi +0 -403
  127. data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +0 -48
  128. data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +0 -35
  129. data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +0 -48
  130. data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +0 -35
  131. data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +0 -91
  132. data/rbi/metronome_sdk/models/v1/payment_status.rbi +0 -33
  133. data/rbi/metronome_sdk/resources/v1/payments.rbi +0 -72
  134. data/sig/metronome_sdk/models/v1/payment.rbs +0 -243
  135. data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +0 -30
  136. data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +0 -15
  137. data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +0 -30
  138. data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +0 -15
  139. data/sig/metronome_sdk/models/v1/payment_list_params.rbs +0 -56
  140. data/sig/metronome_sdk/models/v1/payment_status.rbs +0 -19
  141. data/sig/metronome_sdk/resources/v1/payments.rbs +0 -30
@@ -1913,6 +1913,12 @@ module MetronomeSDK
1913
1913
  )
1914
1914
  end
1915
1915
 
1916
+ sig { returns(T.nilable(T::Array[String])) }
1917
+ attr_reader :any_commit_or_credit_ids
1918
+
1919
+ sig { params(any_commit_or_credit_ids: T::Array[String]).void }
1920
+ attr_writer :any_commit_or_credit_ids
1921
+
1916
1922
  sig do
1917
1923
  returns(
1918
1924
  T.nilable(
@@ -1972,6 +1978,7 @@ module MetronomeSDK
1972
1978
 
1973
1979
  sig do
1974
1980
  params(
1981
+ any_commit_or_credit_ids: T::Array[String],
1975
1982
  billing_frequency:
1976
1983
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddOverride::OverrideSpecifier::BillingFrequency::OrSymbol,
1977
1984
  commit_ids: T::Array[String],
@@ -1983,6 +1990,7 @@ module MetronomeSDK
1983
1990
  ).returns(T.attached_class)
1984
1991
  end
1985
1992
  def self.new(
1993
+ any_commit_or_credit_ids: nil,
1986
1994
  billing_frequency: nil,
1987
1995
  commit_ids: nil,
1988
1996
  presentation_group_values: nil,
@@ -1996,6 +2004,7 @@ module MetronomeSDK
1996
2004
  sig do
1997
2005
  override.returns(
1998
2006
  {
2007
+ any_commit_or_credit_ids: T::Array[String],
1999
2008
  billing_frequency:
2000
2009
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddOverride::OverrideSpecifier::BillingFrequency::TaggedSymbol,
2001
2010
  commit_ids: T::Array[String],
@@ -2504,6 +2513,26 @@ module MetronomeSDK
2504
2513
  end
2505
2514
  attr_writer :proration
2506
2515
 
2516
+ # Rounding configuration for prorated recurring commit amounts.
2517
+ sig do
2518
+ returns(
2519
+ T.nilable(
2520
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding
2521
+ )
2522
+ )
2523
+ end
2524
+ attr_reader :proration_rounding
2525
+
2526
+ sig do
2527
+ params(
2528
+ proration_rounding:
2529
+ T.nilable(
2530
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::OrHash
2531
+ )
2532
+ ).void
2533
+ end
2534
+ attr_writer :proration_rounding
2535
+
2507
2536
  # The frequency at which the recurring commits will be created. If not provided: -
2508
2537
  # The commits will be created on the usage invoice frequency. If provided: - The
2509
2538
  # period defined in the duration will correspond to this frequency. - Commits will
@@ -2591,6 +2620,10 @@ module MetronomeSDK
2591
2620
  netsuite_sales_order_id: String,
2592
2621
  proration:
2593
2622
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::Proration::OrSymbol,
2623
+ proration_rounding:
2624
+ T.nilable(
2625
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::OrHash
2626
+ ),
2594
2627
  recurrence_frequency:
2595
2628
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::RecurrenceFrequency::OrSymbol,
2596
2629
  rollover_fraction: Float,
@@ -2632,6 +2665,8 @@ module MetronomeSDK
2632
2665
  # Determines whether the first and last commit will be prorated. If not provided,
2633
2666
  # the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
2634
2667
  proration: nil,
2668
+ # Rounding configuration for prorated recurring commit amounts.
2669
+ proration_rounding: nil,
2635
2670
  # The frequency at which the recurring commits will be created. If not provided: -
2636
2671
  # The commits will be created on the usage invoice frequency. If provided: - The
2637
2672
  # period defined in the duration will correspond to this frequency. - Commits will
@@ -2679,6 +2714,10 @@ module MetronomeSDK
2679
2714
  netsuite_sales_order_id: String,
2680
2715
  proration:
2681
2716
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::Proration::TaggedSymbol,
2717
+ proration_rounding:
2718
+ T.nilable(
2719
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding
2720
+ ),
2682
2721
  recurrence_frequency:
2683
2722
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::RecurrenceFrequency::TaggedSymbol,
2684
2723
  rollover_fraction: Float,
@@ -2978,6 +3017,255 @@ module MetronomeSDK
2978
3017
  end
2979
3018
  end
2980
3019
 
3020
+ class ProrationRounding < MetronomeSDK::Internal::Type::BaseModel
3021
+ OrHash =
3022
+ T.type_alias do
3023
+ T.any(
3024
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding,
3025
+ MetronomeSDK::Internal::AnyHash
3026
+ )
3027
+ end
3028
+
3029
+ sig do
3030
+ returns(
3031
+ T.nilable(
3032
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Access
3033
+ )
3034
+ )
3035
+ end
3036
+ attr_reader :access
3037
+
3038
+ sig do
3039
+ params(
3040
+ access:
3041
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Access::OrHash
3042
+ ).void
3043
+ end
3044
+ attr_writer :access
3045
+
3046
+ sig do
3047
+ returns(
3048
+ T.nilable(
3049
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Invoice
3050
+ )
3051
+ )
3052
+ end
3053
+ attr_reader :invoice
3054
+
3055
+ sig do
3056
+ params(
3057
+ invoice:
3058
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Invoice::OrHash
3059
+ ).void
3060
+ end
3061
+ attr_writer :invoice
3062
+
3063
+ # Rounding configuration for prorated recurring commit amounts.
3064
+ sig do
3065
+ params(
3066
+ access:
3067
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Access::OrHash,
3068
+ invoice:
3069
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Invoice::OrHash
3070
+ ).returns(T.attached_class)
3071
+ end
3072
+ def self.new(access: nil, invoice: nil)
3073
+ end
3074
+
3075
+ sig do
3076
+ override.returns(
3077
+ {
3078
+ access:
3079
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Access,
3080
+ invoice:
3081
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Invoice
3082
+ }
3083
+ )
3084
+ end
3085
+ def to_hash
3086
+ end
3087
+
3088
+ class Access < MetronomeSDK::Internal::Type::BaseModel
3089
+ OrHash =
3090
+ T.type_alias do
3091
+ T.any(
3092
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Access,
3093
+ MetronomeSDK::Internal::AnyHash
3094
+ )
3095
+ end
3096
+
3097
+ # Number of decimal places to round to. Applied directly to the stored monetary
3098
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
3099
+ # nearest 100 in the stored unit).
3100
+ sig { returns(Float) }
3101
+ attr_accessor :decimal_places
3102
+
3103
+ sig do
3104
+ returns(
3105
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
3106
+ )
3107
+ end
3108
+ attr_accessor :rounding_method
3109
+
3110
+ sig do
3111
+ params(
3112
+ decimal_places: Float,
3113
+ rounding_method:
3114
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Access::RoundingMethod::OrSymbol
3115
+ ).returns(T.attached_class)
3116
+ end
3117
+ def self.new(
3118
+ # Number of decimal places to round to. Applied directly to the stored monetary
3119
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
3120
+ # nearest 100 in the stored unit).
3121
+ decimal_places:,
3122
+ rounding_method:
3123
+ )
3124
+ end
3125
+
3126
+ sig do
3127
+ override.returns(
3128
+ {
3129
+ decimal_places: Float,
3130
+ rounding_method:
3131
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
3132
+ }
3133
+ )
3134
+ end
3135
+ def to_hash
3136
+ end
3137
+
3138
+ module RoundingMethod
3139
+ extend MetronomeSDK::Internal::Type::Enum
3140
+
3141
+ TaggedSymbol =
3142
+ T.type_alias do
3143
+ T.all(
3144
+ Symbol,
3145
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Access::RoundingMethod
3146
+ )
3147
+ end
3148
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
3149
+
3150
+ HALF_UP =
3151
+ T.let(
3152
+ :HALF_UP,
3153
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
3154
+ )
3155
+ FLOOR =
3156
+ T.let(
3157
+ :FLOOR,
3158
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
3159
+ )
3160
+ CEILING =
3161
+ T.let(
3162
+ :CEILING,
3163
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
3164
+ )
3165
+
3166
+ sig do
3167
+ override.returns(
3168
+ T::Array[
3169
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
3170
+ ]
3171
+ )
3172
+ end
3173
+ def self.values
3174
+ end
3175
+ end
3176
+ end
3177
+
3178
+ class Invoice < MetronomeSDK::Internal::Type::BaseModel
3179
+ OrHash =
3180
+ T.type_alias do
3181
+ T.any(
3182
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Invoice,
3183
+ MetronomeSDK::Internal::AnyHash
3184
+ )
3185
+ end
3186
+
3187
+ # Number of decimal places to round to. Applied directly to the stored monetary
3188
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
3189
+ # nearest 100 in the stored unit).
3190
+ sig { returns(Float) }
3191
+ attr_accessor :decimal_places
3192
+
3193
+ sig do
3194
+ returns(
3195
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
3196
+ )
3197
+ end
3198
+ attr_accessor :rounding_method
3199
+
3200
+ sig do
3201
+ params(
3202
+ decimal_places: Float,
3203
+ rounding_method:
3204
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Invoice::RoundingMethod::OrSymbol
3205
+ ).returns(T.attached_class)
3206
+ end
3207
+ def self.new(
3208
+ # Number of decimal places to round to. Applied directly to the stored monetary
3209
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
3210
+ # nearest 100 in the stored unit).
3211
+ decimal_places:,
3212
+ rounding_method:
3213
+ )
3214
+ end
3215
+
3216
+ sig do
3217
+ override.returns(
3218
+ {
3219
+ decimal_places: Float,
3220
+ rounding_method:
3221
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
3222
+ }
3223
+ )
3224
+ end
3225
+ def to_hash
3226
+ end
3227
+
3228
+ module RoundingMethod
3229
+ extend MetronomeSDK::Internal::Type::Enum
3230
+
3231
+ TaggedSymbol =
3232
+ T.type_alias do
3233
+ T.all(
3234
+ Symbol,
3235
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Invoice::RoundingMethod
3236
+ )
3237
+ end
3238
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
3239
+
3240
+ HALF_UP =
3241
+ T.let(
3242
+ :HALF_UP,
3243
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
3244
+ )
3245
+ FLOOR =
3246
+ T.let(
3247
+ :FLOOR,
3248
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
3249
+ )
3250
+ CEILING =
3251
+ T.let(
3252
+ :CEILING,
3253
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
3254
+ )
3255
+
3256
+ sig do
3257
+ override.returns(
3258
+ T::Array[
3259
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
3260
+ ]
3261
+ )
3262
+ end
3263
+ def self.values
3264
+ end
3265
+ end
3266
+ end
3267
+ end
3268
+
2981
3269
  # The frequency at which the recurring commits will be created. If not provided: -
2982
3270
  # The commits will be created on the usage invoice frequency. If provided: - The
2983
3271
  # period defined in the duration will correspond to this frequency. - Commits will
@@ -3015,6 +3303,11 @@ module MetronomeSDK
3015
3303
  :WEEKLY,
3016
3304
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::RecurrenceFrequency::TaggedSymbol
3017
3305
  )
3306
+ DAILY =
3307
+ T.let(
3308
+ :DAILY,
3309
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCommit::RecurrenceFrequency::TaggedSymbol
3310
+ )
3018
3311
 
3019
3312
  sig do
3020
3313
  override.returns(
@@ -3195,6 +3488,26 @@ module MetronomeSDK
3195
3488
  end
3196
3489
  attr_writer :proration
3197
3490
 
3491
+ # Rounding configuration for prorated recurring credit amounts.
3492
+ sig do
3493
+ returns(
3494
+ T.nilable(
3495
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding
3496
+ )
3497
+ )
3498
+ end
3499
+ attr_reader :proration_rounding
3500
+
3501
+ sig do
3502
+ params(
3503
+ proration_rounding:
3504
+ T.nilable(
3505
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::OrHash
3506
+ )
3507
+ ).void
3508
+ end
3509
+ attr_writer :proration_rounding
3510
+
3198
3511
  # The frequency at which the recurring commits will be created. If not provided: -
3199
3512
  # The commits will be created on the usage invoice frequency. If provided: - The
3200
3513
  # period defined in the duration will correspond to this frequency. - Commits will
@@ -3280,6 +3593,10 @@ module MetronomeSDK
3280
3593
  netsuite_sales_order_id: String,
3281
3594
  proration:
3282
3595
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::Proration::OrSymbol,
3596
+ proration_rounding:
3597
+ T.nilable(
3598
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::OrHash
3599
+ ),
3283
3600
  recurrence_frequency:
3284
3601
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency::OrSymbol,
3285
3602
  rollover_fraction: Float,
@@ -3319,6 +3636,8 @@ module MetronomeSDK
3319
3636
  # Determines whether the first and last commit will be prorated. If not provided,
3320
3637
  # the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
3321
3638
  proration: nil,
3639
+ # Rounding configuration for prorated recurring credit amounts.
3640
+ proration_rounding: nil,
3322
3641
  # The frequency at which the recurring commits will be created. If not provided: -
3323
3642
  # The commits will be created on the usage invoice frequency. If provided: - The
3324
3643
  # period defined in the duration will correspond to this frequency. - Commits will
@@ -3364,6 +3683,10 @@ module MetronomeSDK
3364
3683
  netsuite_sales_order_id: String,
3365
3684
  proration:
3366
3685
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::Proration::TaggedSymbol,
3686
+ proration_rounding:
3687
+ T.nilable(
3688
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding
3689
+ ),
3367
3690
  recurrence_frequency:
3368
3691
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency::TaggedSymbol,
3369
3692
  rollover_fraction: Float,
@@ -3625,57 +3948,200 @@ module MetronomeSDK
3625
3948
  end
3626
3949
  end
3627
3950
 
3628
- # The frequency at which the recurring commits will be created. If not provided: -
3629
- # The commits will be created on the usage invoice frequency. If provided: - The
3630
- # period defined in the duration will correspond to this frequency. - Commits will
3631
- # be created aligned with the recurring commit's starting_at rather than the usage
3632
- # invoice dates.
3633
- module RecurrenceFrequency
3634
- extend MetronomeSDK::Internal::Type::Enum
3635
-
3636
- TaggedSymbol =
3951
+ class ProrationRounding < MetronomeSDK::Internal::Type::BaseModel
3952
+ OrHash =
3637
3953
  T.type_alias do
3638
- T.all(
3639
- Symbol,
3640
- MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency
3954
+ T.any(
3955
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding,
3956
+ MetronomeSDK::Internal::AnyHash
3641
3957
  )
3642
3958
  end
3643
- OrSymbol = T.type_alias { T.any(Symbol, String) }
3644
-
3645
- MONTHLY =
3646
- T.let(
3647
- :MONTHLY,
3648
- MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency::TaggedSymbol
3649
- )
3650
- QUARTERLY =
3651
- T.let(
3652
- :QUARTERLY,
3653
- MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency::TaggedSymbol
3654
- )
3655
- ANNUAL =
3656
- T.let(
3657
- :ANNUAL,
3658
- MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency::TaggedSymbol
3659
- )
3660
- WEEKLY =
3661
- T.let(
3662
- :WEEKLY,
3663
- MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency::TaggedSymbol
3664
- )
3665
3959
 
3666
3960
  sig do
3667
- override.returns(
3668
- T::Array[
3669
- MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency::TaggedSymbol
3670
- ]
3961
+ returns(
3962
+ T.nilable(
3963
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::Access
3964
+ )
3671
3965
  )
3672
3966
  end
3673
- def self.values
3674
- end
3675
- end
3676
- end
3967
+ attr_reader :access
3677
3968
 
3678
- class AddResellerRoyalty < MetronomeSDK::Internal::Type::BaseModel
3969
+ sig do
3970
+ params(
3971
+ access:
3972
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::Access::OrHash
3973
+ ).void
3974
+ end
3975
+ attr_writer :access
3976
+
3977
+ # Rounding configuration for prorated recurring credit amounts.
3978
+ sig do
3979
+ params(
3980
+ access:
3981
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::Access::OrHash
3982
+ ).returns(T.attached_class)
3983
+ end
3984
+ def self.new(access: nil)
3985
+ end
3986
+
3987
+ sig do
3988
+ override.returns(
3989
+ {
3990
+ access:
3991
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::Access
3992
+ }
3993
+ )
3994
+ end
3995
+ def to_hash
3996
+ end
3997
+
3998
+ class Access < MetronomeSDK::Internal::Type::BaseModel
3999
+ OrHash =
4000
+ T.type_alias do
4001
+ T.any(
4002
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::Access,
4003
+ MetronomeSDK::Internal::AnyHash
4004
+ )
4005
+ end
4006
+
4007
+ # Number of decimal places to round to. Applied directly to the stored monetary
4008
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
4009
+ # nearest 100 in the stored unit).
4010
+ sig { returns(Float) }
4011
+ attr_accessor :decimal_places
4012
+
4013
+ sig do
4014
+ returns(
4015
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
4016
+ )
4017
+ end
4018
+ attr_accessor :rounding_method
4019
+
4020
+ sig do
4021
+ params(
4022
+ decimal_places: Float,
4023
+ rounding_method:
4024
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::Access::RoundingMethod::OrSymbol
4025
+ ).returns(T.attached_class)
4026
+ end
4027
+ def self.new(
4028
+ # Number of decimal places to round to. Applied directly to the stored monetary
4029
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
4030
+ # nearest 100 in the stored unit).
4031
+ decimal_places:,
4032
+ rounding_method:
4033
+ )
4034
+ end
4035
+
4036
+ sig do
4037
+ override.returns(
4038
+ {
4039
+ decimal_places: Float,
4040
+ rounding_method:
4041
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
4042
+ }
4043
+ )
4044
+ end
4045
+ def to_hash
4046
+ end
4047
+
4048
+ module RoundingMethod
4049
+ extend MetronomeSDK::Internal::Type::Enum
4050
+
4051
+ TaggedSymbol =
4052
+ T.type_alias do
4053
+ T.all(
4054
+ Symbol,
4055
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::Access::RoundingMethod
4056
+ )
4057
+ end
4058
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4059
+
4060
+ HALF_UP =
4061
+ T.let(
4062
+ :HALF_UP,
4063
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
4064
+ )
4065
+ FLOOR =
4066
+ T.let(
4067
+ :FLOOR,
4068
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
4069
+ )
4070
+ CEILING =
4071
+ T.let(
4072
+ :CEILING,
4073
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
4074
+ )
4075
+
4076
+ sig do
4077
+ override.returns(
4078
+ T::Array[
4079
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
4080
+ ]
4081
+ )
4082
+ end
4083
+ def self.values
4084
+ end
4085
+ end
4086
+ end
4087
+ end
4088
+
4089
+ # The frequency at which the recurring commits will be created. If not provided: -
4090
+ # The commits will be created on the usage invoice frequency. If provided: - The
4091
+ # period defined in the duration will correspond to this frequency. - Commits will
4092
+ # be created aligned with the recurring commit's starting_at rather than the usage
4093
+ # invoice dates.
4094
+ module RecurrenceFrequency
4095
+ extend MetronomeSDK::Internal::Type::Enum
4096
+
4097
+ TaggedSymbol =
4098
+ T.type_alias do
4099
+ T.all(
4100
+ Symbol,
4101
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency
4102
+ )
4103
+ end
4104
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4105
+
4106
+ MONTHLY =
4107
+ T.let(
4108
+ :MONTHLY,
4109
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency::TaggedSymbol
4110
+ )
4111
+ QUARTERLY =
4112
+ T.let(
4113
+ :QUARTERLY,
4114
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency::TaggedSymbol
4115
+ )
4116
+ ANNUAL =
4117
+ T.let(
4118
+ :ANNUAL,
4119
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency::TaggedSymbol
4120
+ )
4121
+ WEEKLY =
4122
+ T.let(
4123
+ :WEEKLY,
4124
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency::TaggedSymbol
4125
+ )
4126
+ DAILY =
4127
+ T.let(
4128
+ :DAILY,
4129
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency::TaggedSymbol
4130
+ )
4131
+
4132
+ sig do
4133
+ override.returns(
4134
+ T::Array[
4135
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddRecurringCredit::RecurrenceFrequency::TaggedSymbol
4136
+ ]
4137
+ )
4138
+ end
4139
+ def self.values
4140
+ end
4141
+ end
4142
+ end
4143
+
4144
+ class AddResellerRoyalty < MetronomeSDK::Internal::Type::BaseModel
3679
4145
  OrHash =
3680
4146
  T.type_alias do
3681
4147
  T.any(
@@ -4071,6 +4537,23 @@ module MetronomeSDK
4071
4537
  sig { params(id: String).void }
4072
4538
  attr_writer :id
4073
4539
 
4540
+ sig do
4541
+ returns(
4542
+ T.nilable(
4543
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::BillingCycleConfig
4544
+ )
4545
+ )
4546
+ end
4547
+ attr_reader :billing_cycle_config
4548
+
4549
+ sig do
4550
+ params(
4551
+ billing_cycle_config:
4552
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::BillingCycleConfig::OrHash
4553
+ ).void
4554
+ end
4555
+ attr_writer :billing_cycle_config
4556
+
4074
4557
  # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
4075
4558
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
4076
4559
  attr_reader :custom_fields
@@ -4137,6 +4620,8 @@ module MetronomeSDK
4137
4620
  subscription_rate:
4138
4621
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::SubscriptionRate::OrHash,
4139
4622
  id: String,
4623
+ billing_cycle_config:
4624
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::BillingCycleConfig::OrHash,
4140
4625
  custom_fields: T::Hash[Symbol, String],
4141
4626
  description: String,
4142
4627
  ending_before: Time,
@@ -4167,6 +4652,7 @@ module MetronomeSDK
4167
4652
  starting_at:,
4168
4653
  subscription_rate:,
4169
4654
  id: nil,
4655
+ billing_cycle_config: nil,
4170
4656
  # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
4171
4657
  custom_fields: nil,
4172
4658
  description: nil,
@@ -4196,6 +4682,8 @@ module MetronomeSDK
4196
4682
  subscription_rate:
4197
4683
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::SubscriptionRate,
4198
4684
  id: String,
4685
+ billing_cycle_config:
4686
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::BillingCycleConfig,
4199
4687
  custom_fields: T::Hash[Symbol, String],
4200
4688
  description: String,
4201
4689
  ending_before: Time,
@@ -4442,14 +4930,33 @@ module MetronomeSDK
4442
4930
  sig { returns(T::Boolean) }
4443
4931
  attr_accessor :is_prorated
4444
4932
 
4933
+ sig do
4934
+ returns(
4935
+ T.nilable(
4936
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::Rounding
4937
+ )
4938
+ )
4939
+ end
4940
+ attr_reader :rounding
4941
+
4942
+ sig do
4943
+ params(
4944
+ rounding:
4945
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::Rounding::OrHash
4946
+ ).void
4947
+ end
4948
+ attr_writer :rounding
4949
+
4445
4950
  sig do
4446
4951
  params(
4447
4952
  invoice_behavior:
4448
4953
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::InvoiceBehavior::OrSymbol,
4449
- is_prorated: T::Boolean
4954
+ is_prorated: T::Boolean,
4955
+ rounding:
4956
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::Rounding::OrHash
4450
4957
  ).returns(T.attached_class)
4451
4958
  end
4452
- def self.new(invoice_behavior:, is_prorated:)
4959
+ def self.new(invoice_behavior:, is_prorated:, rounding: nil)
4453
4960
  end
4454
4961
 
4455
4962
  sig do
@@ -4457,7 +4964,9 @@ module MetronomeSDK
4457
4964
  {
4458
4965
  invoice_behavior:
4459
4966
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::InvoiceBehavior::TaggedSymbol,
4460
- is_prorated: T::Boolean
4967
+ is_prorated: T::Boolean,
4968
+ rounding:
4969
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::Rounding
4461
4970
  }
4462
4971
  )
4463
4972
  end
@@ -4497,6 +5006,96 @@ module MetronomeSDK
4497
5006
  def self.values
4498
5007
  end
4499
5008
  end
5009
+
5010
+ class Rounding < MetronomeSDK::Internal::Type::BaseModel
5011
+ OrHash =
5012
+ T.type_alias do
5013
+ T.any(
5014
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::Rounding,
5015
+ MetronomeSDK::Internal::AnyHash
5016
+ )
5017
+ end
5018
+
5019
+ # Number of decimal places to round to. Applied directly to the stored monetary
5020
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
5021
+ # nearest 100 in the stored unit).
5022
+ sig { returns(Float) }
5023
+ attr_accessor :decimal_places
5024
+
5025
+ sig do
5026
+ returns(
5027
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::Rounding::RoundingMethod::TaggedSymbol
5028
+ )
5029
+ end
5030
+ attr_accessor :rounding_method
5031
+
5032
+ sig do
5033
+ params(
5034
+ decimal_places: Float,
5035
+ rounding_method:
5036
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::Rounding::RoundingMethod::OrSymbol
5037
+ ).returns(T.attached_class)
5038
+ end
5039
+ def self.new(
5040
+ # Number of decimal places to round to. Applied directly to the stored monetary
5041
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
5042
+ # nearest 100 in the stored unit).
5043
+ decimal_places:,
5044
+ rounding_method:
5045
+ )
5046
+ end
5047
+
5048
+ sig do
5049
+ override.returns(
5050
+ {
5051
+ decimal_places: Float,
5052
+ rounding_method:
5053
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::Rounding::RoundingMethod::TaggedSymbol
5054
+ }
5055
+ )
5056
+ end
5057
+ def to_hash
5058
+ end
5059
+
5060
+ module RoundingMethod
5061
+ extend MetronomeSDK::Internal::Type::Enum
5062
+
5063
+ TaggedSymbol =
5064
+ T.type_alias do
5065
+ T.all(
5066
+ Symbol,
5067
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::Rounding::RoundingMethod
5068
+ )
5069
+ end
5070
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
5071
+
5072
+ HALF_UP =
5073
+ T.let(
5074
+ :HALF_UP,
5075
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::Rounding::RoundingMethod::TaggedSymbol
5076
+ )
5077
+ FLOOR =
5078
+ T.let(
5079
+ :FLOOR,
5080
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::Rounding::RoundingMethod::TaggedSymbol
5081
+ )
5082
+ CEILING =
5083
+ T.let(
5084
+ :CEILING,
5085
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::Rounding::RoundingMethod::TaggedSymbol
5086
+ )
5087
+
5088
+ sig do
5089
+ override.returns(
5090
+ T::Array[
5091
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::Proration::Rounding::RoundingMethod::TaggedSymbol
5092
+ ]
5093
+ )
5094
+ end
5095
+ def self.values
5096
+ end
5097
+ end
5098
+ end
4500
5099
  end
4501
5100
 
4502
5101
  # Determines how the subscription's quantity is controlled. Defaults to
@@ -4708,41 +5307,128 @@ module MetronomeSDK
4708
5307
  end
4709
5308
  end
4710
5309
 
4711
- class SeatConfig < MetronomeSDK::Internal::Type::BaseModel
5310
+ class BillingCycleConfig < MetronomeSDK::Internal::Type::BaseModel
4712
5311
  OrHash =
4713
5312
  T.type_alias do
4714
5313
  T.any(
4715
- MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::SeatConfig,
5314
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::BillingCycleConfig,
4716
5315
  MetronomeSDK::Internal::AnyHash
4717
5316
  )
4718
5317
  end
4719
5318
 
4720
- # The property name, sent on usage events, that identifies the seat ID associated
4721
- # with the usage event. For example, the property name might be seat_id or
4722
- # user_id. The property must be set as a group key on billable metrics and a
4723
- # presentation/pricing group key on contract products. This allows linked
4724
- # recurring credits with an allocation per seat to be consumed by only one seat's
4725
- # usage.
4726
- sig { returns(String) }
4727
- attr_accessor :seat_group_key
5319
+ # The date this subscription's billing cycle is anchored to.
5320
+ sig { returns(Time) }
5321
+ attr_accessor :anchor_date
4728
5322
 
4729
- sig { params(seat_group_key: String).returns(T.attached_class) }
5323
+ # Controls whether this subscription consolidates onto usage invoices or gets its
5324
+ # own scheduled invoice.
5325
+ sig do
5326
+ returns(
5327
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::BillingCycleConfig::InvoicePlacement::TaggedSymbol
5328
+ )
5329
+ end
5330
+ attr_accessor :invoice_placement
5331
+
5332
+ sig do
5333
+ params(
5334
+ anchor_date: Time,
5335
+ invoice_placement:
5336
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::BillingCycleConfig::InvoicePlacement::OrSymbol
5337
+ ).returns(T.attached_class)
5338
+ end
4730
5339
  def self.new(
4731
- # The property name, sent on usage events, that identifies the seat ID associated
4732
- # with the usage event. For example, the property name might be seat_id or
4733
- # user_id. The property must be set as a group key on billable metrics and a
4734
- # presentation/pricing group key on contract products. This allows linked
4735
- # recurring credits with an allocation per seat to be consumed by only one seat's
4736
- # usage.
4737
- seat_group_key:
5340
+ # The date this subscription's billing cycle is anchored to.
5341
+ anchor_date:,
5342
+ # Controls whether this subscription consolidates onto usage invoices or gets its
5343
+ # own scheduled invoice.
5344
+ invoice_placement:
4738
5345
  )
4739
5346
  end
4740
5347
 
4741
- sig { override.returns({ seat_group_key: String }) }
5348
+ sig do
5349
+ override.returns(
5350
+ {
5351
+ anchor_date: Time,
5352
+ invoice_placement:
5353
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::BillingCycleConfig::InvoicePlacement::TaggedSymbol
5354
+ }
5355
+ )
5356
+ end
4742
5357
  def to_hash
4743
5358
  end
4744
- end
4745
- end
5359
+
5360
+ # Controls whether this subscription consolidates onto usage invoices or gets its
5361
+ # own scheduled invoice.
5362
+ module InvoicePlacement
5363
+ extend MetronomeSDK::Internal::Type::Enum
5364
+
5365
+ TaggedSymbol =
5366
+ T.type_alias do
5367
+ T.all(
5368
+ Symbol,
5369
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::BillingCycleConfig::InvoicePlacement
5370
+ )
5371
+ end
5372
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
5373
+
5374
+ ON_SCHEDULED_INVOICE =
5375
+ T.let(
5376
+ :ON_SCHEDULED_INVOICE,
5377
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::BillingCycleConfig::InvoicePlacement::TaggedSymbol
5378
+ )
5379
+ ON_USAGE_INVOICE =
5380
+ T.let(
5381
+ :ON_USAGE_INVOICE,
5382
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::BillingCycleConfig::InvoicePlacement::TaggedSymbol
5383
+ )
5384
+
5385
+ sig do
5386
+ override.returns(
5387
+ T::Array[
5388
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::BillingCycleConfig::InvoicePlacement::TaggedSymbol
5389
+ ]
5390
+ )
5391
+ end
5392
+ def self.values
5393
+ end
5394
+ end
5395
+ end
5396
+
5397
+ class SeatConfig < MetronomeSDK::Internal::Type::BaseModel
5398
+ OrHash =
5399
+ T.type_alias do
5400
+ T.any(
5401
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::AddSubscription::SeatConfig,
5402
+ MetronomeSDK::Internal::AnyHash
5403
+ )
5404
+ end
5405
+
5406
+ # The property name, sent on usage events, that identifies the seat ID associated
5407
+ # with the usage event. For example, the property name might be seat_id or
5408
+ # user_id. The property must be set as a group key on billable metrics and a
5409
+ # presentation/pricing group key on contract products. This allows linked
5410
+ # recurring credits with an allocation per seat to be consumed by only one seat's
5411
+ # usage.
5412
+ sig { returns(String) }
5413
+ attr_accessor :seat_group_key
5414
+
5415
+ sig { params(seat_group_key: String).returns(T.attached_class) }
5416
+ def self.new(
5417
+ # The property name, sent on usage events, that identifies the seat ID associated
5418
+ # with the usage event. For example, the property name might be seat_id or
5419
+ # user_id. The property must be set as a group key on billable metrics and a
5420
+ # presentation/pricing group key on contract products. This allows linked
5421
+ # recurring credits with an allocation per seat to be consumed by only one seat's
5422
+ # usage.
5423
+ seat_group_key:
5424
+ )
5425
+ end
5426
+
5427
+ sig { override.returns({ seat_group_key: String }) }
5428
+ def to_hash
5429
+ end
5430
+ end
5431
+ end
4746
5432
 
4747
5433
  class AddUsageFilter < MetronomeSDK::Internal::Type::BaseModel
4748
5434
  OrHash =
@@ -6700,6 +7386,19 @@ module MetronomeSDK
6700
7386
  sig { params(threshold_amount: Float).void }
6701
7387
  attr_writer :threshold_amount
6702
7388
 
7389
+ # Determines which balances are excluded from remaining balance calculation for
7390
+ # threshold billing.
7391
+ sig do
7392
+ returns(
7393
+ T.nilable(
7394
+ T::Array[
7395
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier
7396
+ ]
7397
+ )
7398
+ )
7399
+ end
7400
+ attr_accessor :threshold_balance_specifiers
7401
+
6703
7402
  sig do
6704
7403
  params(
6705
7404
  commit:
@@ -6712,7 +7411,13 @@ module MetronomeSDK
6712
7411
  is_enabled: T::Boolean,
6713
7412
  payment_gate_config: MetronomeSDK::PaymentGateConfigV2::OrHash,
6714
7413
  recharge_to_amount: Float,
6715
- threshold_amount: Float
7414
+ threshold_amount: Float,
7415
+ threshold_balance_specifiers:
7416
+ T.nilable(
7417
+ T::Array[
7418
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::OrHash
7419
+ ]
7420
+ )
6716
7421
  ).returns(T.attached_class)
6717
7422
  end
6718
7423
  def self.new(
@@ -6730,7 +7435,10 @@ module MetronomeSDK
6730
7435
  recharge_to_amount: nil,
6731
7436
  # Specify the threshold amount for the contract. Each time the contract's balance
6732
7437
  # lowers to this amount, a threshold charge will be initiated.
6733
- threshold_amount: nil
7438
+ threshold_amount: nil,
7439
+ # Determines which balances are excluded from remaining balance calculation for
7440
+ # threshold billing.
7441
+ threshold_balance_specifiers: nil
6734
7442
  )
6735
7443
  end
6736
7444
 
@@ -6747,7 +7455,13 @@ module MetronomeSDK
6747
7455
  is_enabled: T::Boolean,
6748
7456
  payment_gate_config: MetronomeSDK::PaymentGateConfigV2,
6749
7457
  recharge_to_amount: Float,
6750
- threshold_amount: Float
7458
+ threshold_amount: Float,
7459
+ threshold_balance_specifiers:
7460
+ T.nilable(
7461
+ T::Array[
7462
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier
7463
+ ]
7464
+ )
6751
7465
  }
6752
7466
  )
6753
7467
  end
@@ -6836,6 +7550,26 @@ module MetronomeSDK
6836
7550
  )
6837
7551
  end
6838
7552
 
7553
+ # Update the discount cap. Set to null to remove an existing cap.
7554
+ sig do
7555
+ returns(
7556
+ T.nilable(
7557
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::DiscountConfiguration::Cap
7558
+ )
7559
+ )
7560
+ end
7561
+ attr_reader :cap
7562
+
7563
+ sig do
7564
+ params(
7565
+ cap:
7566
+ T.nilable(
7567
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::DiscountConfiguration::Cap::OrHash
7568
+ )
7569
+ ).void
7570
+ end
7571
+ attr_writer :cap
7572
+
6839
7573
  # The fraction of the original amount that the customer pays after applying the
6840
7574
  # discount. Set to null to remove the discount fraction. For example, 0.85 means
6841
7575
  # the customer pays 85% of the original amount (a 15% discount).
@@ -6843,11 +7577,17 @@ module MetronomeSDK
6843
7577
  attr_accessor :payment_fraction
6844
7578
 
6845
7579
  sig do
6846
- params(payment_fraction: T.nilable(Float)).returns(
6847
- T.attached_class
6848
- )
7580
+ params(
7581
+ cap:
7582
+ T.nilable(
7583
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::DiscountConfiguration::Cap::OrHash
7584
+ ),
7585
+ payment_fraction: T.nilable(Float)
7586
+ ).returns(T.attached_class)
6849
7587
  end
6850
7588
  def self.new(
7589
+ # Update the discount cap. Set to null to remove an existing cap.
7590
+ cap: nil,
6851
7591
  # The fraction of the original amount that the customer pays after applying the
6852
7592
  # discount. Set to null to remove the discount fraction. For example, 0.85 means
6853
7593
  # the customer pays 85% of the original amount (a 15% discount).
@@ -6855,9 +7595,231 @@ module MetronomeSDK
6855
7595
  )
6856
7596
  end
6857
7597
 
6858
- sig { override.returns({ payment_fraction: T.nilable(Float) }) }
7598
+ sig do
7599
+ override.returns(
7600
+ {
7601
+ cap:
7602
+ T.nilable(
7603
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::DiscountConfiguration::Cap
7604
+ ),
7605
+ payment_fraction: T.nilable(Float)
7606
+ }
7607
+ )
7608
+ end
7609
+ def to_hash
7610
+ end
7611
+
7612
+ class Cap < MetronomeSDK::Internal::Type::BaseModel
7613
+ OrHash =
7614
+ T.type_alias do
7615
+ T.any(
7616
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::DiscountConfiguration::Cap,
7617
+ MetronomeSDK::Internal::AnyHash
7618
+ )
7619
+ end
7620
+
7621
+ # Accumulated spend ceiling above which the discount stops applying.
7622
+ sig { returns(Float) }
7623
+ attr_accessor :amount
7624
+
7625
+ # Alias of the spend tracker this cap is measured against.
7626
+ sig { returns(String) }
7627
+ attr_accessor :spend_tracker_alias
7628
+
7629
+ # Update the discount cap. Set to null to remove an existing cap.
7630
+ sig do
7631
+ params(amount: Float, spend_tracker_alias: String).returns(
7632
+ T.attached_class
7633
+ )
7634
+ end
7635
+ def self.new(
7636
+ # Accumulated spend ceiling above which the discount stops applying.
7637
+ amount:,
7638
+ # Alias of the spend tracker this cap is measured against.
7639
+ spend_tracker_alias:
7640
+ )
7641
+ end
7642
+
7643
+ sig do
7644
+ override.returns(
7645
+ { amount: Float, spend_tracker_alias: String }
7646
+ )
7647
+ end
7648
+ def to_hash
7649
+ end
7650
+ end
7651
+ end
7652
+
7653
+ class ThresholdBalanceSpecifier < MetronomeSDK::Internal::Type::BaseModel
7654
+ OrHash =
7655
+ T.type_alias do
7656
+ T.any(
7657
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier,
7658
+ MetronomeSDK::Internal::AnyHash
7659
+ )
7660
+ end
7661
+
7662
+ sig do
7663
+ returns(
7664
+ T::Array[
7665
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude
7666
+ ]
7667
+ )
7668
+ end
7669
+ attr_accessor :exclude
7670
+
7671
+ sig do
7672
+ params(
7673
+ exclude:
7674
+ T::Array[
7675
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::OrHash
7676
+ ]
7677
+ ).returns(T.attached_class)
7678
+ end
7679
+ def self.new(exclude:)
7680
+ end
7681
+
7682
+ sig do
7683
+ override.returns(
7684
+ {
7685
+ exclude:
7686
+ T::Array[
7687
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude
7688
+ ]
7689
+ }
7690
+ )
7691
+ end
6859
7692
  def to_hash
6860
7693
  end
7694
+
7695
+ class Exclude < MetronomeSDK::Internal::Type::BaseModel
7696
+ OrHash =
7697
+ T.type_alias do
7698
+ T.any(
7699
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude,
7700
+ MetronomeSDK::Internal::AnyHash
7701
+ )
7702
+ end
7703
+
7704
+ sig do
7705
+ returns(
7706
+ T::Array[
7707
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter
7708
+ ]
7709
+ )
7710
+ end
7711
+ attr_accessor :custom_field_filters
7712
+
7713
+ sig do
7714
+ params(
7715
+ custom_field_filters:
7716
+ T::Array[
7717
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter::OrHash
7718
+ ]
7719
+ ).returns(T.attached_class)
7720
+ end
7721
+ def self.new(custom_field_filters:)
7722
+ end
7723
+
7724
+ sig do
7725
+ override.returns(
7726
+ {
7727
+ custom_field_filters:
7728
+ T::Array[
7729
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter
7730
+ ]
7731
+ }
7732
+ )
7733
+ end
7734
+ def to_hash
7735
+ end
7736
+
7737
+ class CustomFieldFilter < MetronomeSDK::Internal::Type::BaseModel
7738
+ OrHash =
7739
+ T.type_alias do
7740
+ T.any(
7741
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter,
7742
+ MetronomeSDK::Internal::AnyHash
7743
+ )
7744
+ end
7745
+
7746
+ sig do
7747
+ returns(
7748
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter::Entity::TaggedSymbol
7749
+ )
7750
+ end
7751
+ attr_accessor :entity
7752
+
7753
+ sig { returns(String) }
7754
+ attr_accessor :key
7755
+
7756
+ sig { returns(String) }
7757
+ attr_accessor :value
7758
+
7759
+ sig do
7760
+ params(
7761
+ entity:
7762
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter::Entity::OrSymbol,
7763
+ key: String,
7764
+ value: String
7765
+ ).returns(T.attached_class)
7766
+ end
7767
+ def self.new(entity:, key:, value:)
7768
+ end
7769
+
7770
+ sig do
7771
+ override.returns(
7772
+ {
7773
+ entity:
7774
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter::Entity::TaggedSymbol,
7775
+ key: String,
7776
+ value: String
7777
+ }
7778
+ )
7779
+ end
7780
+ def to_hash
7781
+ end
7782
+
7783
+ module Entity
7784
+ extend MetronomeSDK::Internal::Type::Enum
7785
+
7786
+ TaggedSymbol =
7787
+ T.type_alias do
7788
+ T.all(
7789
+ Symbol,
7790
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter::Entity
7791
+ )
7792
+ end
7793
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
7794
+
7795
+ COMMIT =
7796
+ T.let(
7797
+ :Commit,
7798
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter::Entity::TaggedSymbol
7799
+ )
7800
+ CONTRACT_CREDIT =
7801
+ T.let(
7802
+ :ContractCredit,
7803
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter::Entity::TaggedSymbol
7804
+ )
7805
+ CONTRACT_CREDIT_OR_COMMIT =
7806
+ T.let(
7807
+ :ContractCreditOrCommit,
7808
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter::Entity::TaggedSymbol
7809
+ )
7810
+
7811
+ sig do
7812
+ override.returns(
7813
+ T::Array[
7814
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter::Entity::TaggedSymbol
7815
+ ]
7816
+ )
7817
+ end
7818
+ def self.values
7819
+ end
7820
+ end
7821
+ end
7822
+ end
6861
7823
  end
6862
7824
  end
6863
7825
 
@@ -6913,6 +7875,26 @@ module MetronomeSDK
6913
7875
  end
6914
7876
  attr_writer :invoice_amount
6915
7877
 
7878
+ # Rounding configuration for prorated recurring commit amounts.
7879
+ sig do
7880
+ returns(
7881
+ T.nilable(
7882
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding
7883
+ )
7884
+ )
7885
+ end
7886
+ attr_reader :proration_rounding
7887
+
7888
+ sig do
7889
+ params(
7890
+ proration_rounding:
7891
+ T.nilable(
7892
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::OrHash
7893
+ )
7894
+ ).void
7895
+ end
7896
+ attr_writer :proration_rounding
7897
+
6916
7898
  sig do
6917
7899
  returns(
6918
7900
  T.nilable(
@@ -6938,6 +7920,10 @@ module MetronomeSDK
6938
7920
  ending_before: Time,
6939
7921
  invoice_amount:
6940
7922
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::InvoiceAmount::OrHash,
7923
+ proration_rounding:
7924
+ T.nilable(
7925
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::OrHash
7926
+ ),
6941
7927
  rate_type:
6942
7928
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::RateType::OrSymbol
6943
7929
  ).returns(T.attached_class)
@@ -6947,6 +7933,8 @@ module MetronomeSDK
6947
7933
  access_amount: nil,
6948
7934
  ending_before: nil,
6949
7935
  invoice_amount: nil,
7936
+ # Rounding configuration for prorated recurring commit amounts.
7937
+ proration_rounding: nil,
6950
7938
  rate_type: nil
6951
7939
  )
6952
7940
  end
@@ -6960,6 +7948,10 @@ module MetronomeSDK
6960
7948
  ending_before: Time,
6961
7949
  invoice_amount:
6962
7950
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::InvoiceAmount,
7951
+ proration_rounding:
7952
+ T.nilable(
7953
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding
7954
+ ),
6963
7955
  rate_type:
6964
7956
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::RateType::TaggedSymbol
6965
7957
  }
@@ -7036,10 +8028,259 @@ module MetronomeSDK
7036
8028
  end
7037
8029
  end
7038
8030
 
7039
- module RateType
7040
- extend MetronomeSDK::Internal::Type::Enum
7041
-
7042
- TaggedSymbol =
8031
+ class ProrationRounding < MetronomeSDK::Internal::Type::BaseModel
8032
+ OrHash =
8033
+ T.type_alias do
8034
+ T.any(
8035
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding,
8036
+ MetronomeSDK::Internal::AnyHash
8037
+ )
8038
+ end
8039
+
8040
+ sig do
8041
+ returns(
8042
+ T.nilable(
8043
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Access
8044
+ )
8045
+ )
8046
+ end
8047
+ attr_reader :access
8048
+
8049
+ sig do
8050
+ params(
8051
+ access:
8052
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Access::OrHash
8053
+ ).void
8054
+ end
8055
+ attr_writer :access
8056
+
8057
+ sig do
8058
+ returns(
8059
+ T.nilable(
8060
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Invoice
8061
+ )
8062
+ )
8063
+ end
8064
+ attr_reader :invoice
8065
+
8066
+ sig do
8067
+ params(
8068
+ invoice:
8069
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Invoice::OrHash
8070
+ ).void
8071
+ end
8072
+ attr_writer :invoice
8073
+
8074
+ # Rounding configuration for prorated recurring commit amounts.
8075
+ sig do
8076
+ params(
8077
+ access:
8078
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Access::OrHash,
8079
+ invoice:
8080
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Invoice::OrHash
8081
+ ).returns(T.attached_class)
8082
+ end
8083
+ def self.new(access: nil, invoice: nil)
8084
+ end
8085
+
8086
+ sig do
8087
+ override.returns(
8088
+ {
8089
+ access:
8090
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Access,
8091
+ invoice:
8092
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Invoice
8093
+ }
8094
+ )
8095
+ end
8096
+ def to_hash
8097
+ end
8098
+
8099
+ class Access < MetronomeSDK::Internal::Type::BaseModel
8100
+ OrHash =
8101
+ T.type_alias do
8102
+ T.any(
8103
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Access,
8104
+ MetronomeSDK::Internal::AnyHash
8105
+ )
8106
+ end
8107
+
8108
+ # Number of decimal places to round to. Applied directly to the stored monetary
8109
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
8110
+ # nearest 100 in the stored unit).
8111
+ sig { returns(Float) }
8112
+ attr_accessor :decimal_places
8113
+
8114
+ sig do
8115
+ returns(
8116
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
8117
+ )
8118
+ end
8119
+ attr_accessor :rounding_method
8120
+
8121
+ sig do
8122
+ params(
8123
+ decimal_places: Float,
8124
+ rounding_method:
8125
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Access::RoundingMethod::OrSymbol
8126
+ ).returns(T.attached_class)
8127
+ end
8128
+ def self.new(
8129
+ # Number of decimal places to round to. Applied directly to the stored monetary
8130
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
8131
+ # nearest 100 in the stored unit).
8132
+ decimal_places:,
8133
+ rounding_method:
8134
+ )
8135
+ end
8136
+
8137
+ sig do
8138
+ override.returns(
8139
+ {
8140
+ decimal_places: Float,
8141
+ rounding_method:
8142
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
8143
+ }
8144
+ )
8145
+ end
8146
+ def to_hash
8147
+ end
8148
+
8149
+ module RoundingMethod
8150
+ extend MetronomeSDK::Internal::Type::Enum
8151
+
8152
+ TaggedSymbol =
8153
+ T.type_alias do
8154
+ T.all(
8155
+ Symbol,
8156
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Access::RoundingMethod
8157
+ )
8158
+ end
8159
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
8160
+
8161
+ HALF_UP =
8162
+ T.let(
8163
+ :HALF_UP,
8164
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
8165
+ )
8166
+ FLOOR =
8167
+ T.let(
8168
+ :FLOOR,
8169
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
8170
+ )
8171
+ CEILING =
8172
+ T.let(
8173
+ :CEILING,
8174
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
8175
+ )
8176
+
8177
+ sig do
8178
+ override.returns(
8179
+ T::Array[
8180
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
8181
+ ]
8182
+ )
8183
+ end
8184
+ def self.values
8185
+ end
8186
+ end
8187
+ end
8188
+
8189
+ class Invoice < MetronomeSDK::Internal::Type::BaseModel
8190
+ OrHash =
8191
+ T.type_alias do
8192
+ T.any(
8193
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Invoice,
8194
+ MetronomeSDK::Internal::AnyHash
8195
+ )
8196
+ end
8197
+
8198
+ # Number of decimal places to round to. Applied directly to the stored monetary
8199
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
8200
+ # nearest 100 in the stored unit).
8201
+ sig { returns(Float) }
8202
+ attr_accessor :decimal_places
8203
+
8204
+ sig do
8205
+ returns(
8206
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
8207
+ )
8208
+ end
8209
+ attr_accessor :rounding_method
8210
+
8211
+ sig do
8212
+ params(
8213
+ decimal_places: Float,
8214
+ rounding_method:
8215
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Invoice::RoundingMethod::OrSymbol
8216
+ ).returns(T.attached_class)
8217
+ end
8218
+ def self.new(
8219
+ # Number of decimal places to round to. Applied directly to the stored monetary
8220
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
8221
+ # nearest 100 in the stored unit).
8222
+ decimal_places:,
8223
+ rounding_method:
8224
+ )
8225
+ end
8226
+
8227
+ sig do
8228
+ override.returns(
8229
+ {
8230
+ decimal_places: Float,
8231
+ rounding_method:
8232
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
8233
+ }
8234
+ )
8235
+ end
8236
+ def to_hash
8237
+ end
8238
+
8239
+ module RoundingMethod
8240
+ extend MetronomeSDK::Internal::Type::Enum
8241
+
8242
+ TaggedSymbol =
8243
+ T.type_alias do
8244
+ T.all(
8245
+ Symbol,
8246
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Invoice::RoundingMethod
8247
+ )
8248
+ end
8249
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
8250
+
8251
+ HALF_UP =
8252
+ T.let(
8253
+ :HALF_UP,
8254
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
8255
+ )
8256
+ FLOOR =
8257
+ T.let(
8258
+ :FLOOR,
8259
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
8260
+ )
8261
+ CEILING =
8262
+ T.let(
8263
+ :CEILING,
8264
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
8265
+ )
8266
+
8267
+ sig do
8268
+ override.returns(
8269
+ T::Array[
8270
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
8271
+ ]
8272
+ )
8273
+ end
8274
+ def self.values
8275
+ end
8276
+ end
8277
+ end
8278
+ end
8279
+
8280
+ module RateType
8281
+ extend MetronomeSDK::Internal::Type::Enum
8282
+
8283
+ TaggedSymbol =
7043
8284
  T.type_alias do
7044
8285
  T.all(
7045
8286
  Symbol,
@@ -7106,6 +8347,26 @@ module MetronomeSDK
7106
8347
  sig { params(ending_before: Time).void }
7107
8348
  attr_writer :ending_before
7108
8349
 
8350
+ # Rounding configuration for prorated recurring credit amounts.
8351
+ sig do
8352
+ returns(
8353
+ T.nilable(
8354
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding
8355
+ )
8356
+ )
8357
+ end
8358
+ attr_reader :proration_rounding
8359
+
8360
+ sig do
8361
+ params(
8362
+ proration_rounding:
8363
+ T.nilable(
8364
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::OrHash
8365
+ )
8366
+ ).void
8367
+ end
8368
+ attr_writer :proration_rounding
8369
+
7109
8370
  sig do
7110
8371
  returns(
7111
8372
  T.nilable(
@@ -7129,6 +8390,10 @@ module MetronomeSDK
7129
8390
  access_amount:
7130
8391
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::AccessAmount::OrHash,
7131
8392
  ending_before: Time,
8393
+ proration_rounding:
8394
+ T.nilable(
8395
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::OrHash
8396
+ ),
7132
8397
  rate_type:
7133
8398
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::RateType::OrSymbol
7134
8399
  ).returns(T.attached_class)
@@ -7137,6 +8402,8 @@ module MetronomeSDK
7137
8402
  id:,
7138
8403
  access_amount: nil,
7139
8404
  ending_before: nil,
8405
+ # Rounding configuration for prorated recurring credit amounts.
8406
+ proration_rounding: nil,
7140
8407
  rate_type: nil
7141
8408
  )
7142
8409
  end
@@ -7148,6 +8415,10 @@ module MetronomeSDK
7148
8415
  access_amount:
7149
8416
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::AccessAmount,
7150
8417
  ending_before: Time,
8418
+ proration_rounding:
8419
+ T.nilable(
8420
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding
8421
+ ),
7151
8422
  rate_type:
7152
8423
  MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::RateType::TaggedSymbol
7153
8424
  }
@@ -7190,6 +8461,144 @@ module MetronomeSDK
7190
8461
  end
7191
8462
  end
7192
8463
 
8464
+ class ProrationRounding < MetronomeSDK::Internal::Type::BaseModel
8465
+ OrHash =
8466
+ T.type_alias do
8467
+ T.any(
8468
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding,
8469
+ MetronomeSDK::Internal::AnyHash
8470
+ )
8471
+ end
8472
+
8473
+ sig do
8474
+ returns(
8475
+ T.nilable(
8476
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::Access
8477
+ )
8478
+ )
8479
+ end
8480
+ attr_reader :access
8481
+
8482
+ sig do
8483
+ params(
8484
+ access:
8485
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::Access::OrHash
8486
+ ).void
8487
+ end
8488
+ attr_writer :access
8489
+
8490
+ # Rounding configuration for prorated recurring credit amounts.
8491
+ sig do
8492
+ params(
8493
+ access:
8494
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::Access::OrHash
8495
+ ).returns(T.attached_class)
8496
+ end
8497
+ def self.new(access: nil)
8498
+ end
8499
+
8500
+ sig do
8501
+ override.returns(
8502
+ {
8503
+ access:
8504
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::Access
8505
+ }
8506
+ )
8507
+ end
8508
+ def to_hash
8509
+ end
8510
+
8511
+ class Access < MetronomeSDK::Internal::Type::BaseModel
8512
+ OrHash =
8513
+ T.type_alias do
8514
+ T.any(
8515
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::Access,
8516
+ MetronomeSDK::Internal::AnyHash
8517
+ )
8518
+ end
8519
+
8520
+ # Number of decimal places to round to. Applied directly to the stored monetary
8521
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
8522
+ # nearest 100 in the stored unit).
8523
+ sig { returns(Float) }
8524
+ attr_accessor :decimal_places
8525
+
8526
+ sig do
8527
+ returns(
8528
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
8529
+ )
8530
+ end
8531
+ attr_accessor :rounding_method
8532
+
8533
+ sig do
8534
+ params(
8535
+ decimal_places: Float,
8536
+ rounding_method:
8537
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::Access::RoundingMethod::OrSymbol
8538
+ ).returns(T.attached_class)
8539
+ end
8540
+ def self.new(
8541
+ # Number of decimal places to round to. Applied directly to the stored monetary
8542
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
8543
+ # nearest 100 in the stored unit).
8544
+ decimal_places:,
8545
+ rounding_method:
8546
+ )
8547
+ end
8548
+
8549
+ sig do
8550
+ override.returns(
8551
+ {
8552
+ decimal_places: Float,
8553
+ rounding_method:
8554
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
8555
+ }
8556
+ )
8557
+ end
8558
+ def to_hash
8559
+ end
8560
+
8561
+ module RoundingMethod
8562
+ extend MetronomeSDK::Internal::Type::Enum
8563
+
8564
+ TaggedSymbol =
8565
+ T.type_alias do
8566
+ T.all(
8567
+ Symbol,
8568
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::Access::RoundingMethod
8569
+ )
8570
+ end
8571
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
8572
+
8573
+ HALF_UP =
8574
+ T.let(
8575
+ :HALF_UP,
8576
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
8577
+ )
8578
+ FLOOR =
8579
+ T.let(
8580
+ :FLOOR,
8581
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
8582
+ )
8583
+ CEILING =
8584
+ T.let(
8585
+ :CEILING,
8586
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
8587
+ )
8588
+
8589
+ sig do
8590
+ override.returns(
8591
+ T::Array[
8592
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateRecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
8593
+ ]
8594
+ )
8595
+ end
8596
+ def self.values
8597
+ end
8598
+ end
8599
+ end
8600
+ end
8601
+
7193
8602
  module RateType
7194
8603
  extend MetronomeSDK::Internal::Type::Enum
7195
8604
 
@@ -7705,6 +9114,26 @@ module MetronomeSDK
7705
9114
  )
7706
9115
  end
7707
9116
 
9117
+ # Update the discount cap. Set to null to remove an existing cap.
9118
+ sig do
9119
+ returns(
9120
+ T.nilable(
9121
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSpendThresholdConfiguration::DiscountConfiguration::Cap
9122
+ )
9123
+ )
9124
+ end
9125
+ attr_reader :cap
9126
+
9127
+ sig do
9128
+ params(
9129
+ cap:
9130
+ T.nilable(
9131
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSpendThresholdConfiguration::DiscountConfiguration::Cap::OrHash
9132
+ )
9133
+ ).void
9134
+ end
9135
+ attr_writer :cap
9136
+
7708
9137
  # The fraction of the original amount that the customer pays after applying the
7709
9138
  # discount. Set to null to remove the discount fraction. For example, 0.85 means
7710
9139
  # the customer pays 85% of the original amount (a 15% discount).
@@ -7712,11 +9141,17 @@ module MetronomeSDK
7712
9141
  attr_accessor :payment_fraction
7713
9142
 
7714
9143
  sig do
7715
- params(payment_fraction: T.nilable(Float)).returns(
7716
- T.attached_class
7717
- )
9144
+ params(
9145
+ cap:
9146
+ T.nilable(
9147
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSpendThresholdConfiguration::DiscountConfiguration::Cap::OrHash
9148
+ ),
9149
+ payment_fraction: T.nilable(Float)
9150
+ ).returns(T.attached_class)
7718
9151
  end
7719
9152
  def self.new(
9153
+ # Update the discount cap. Set to null to remove an existing cap.
9154
+ cap: nil,
7720
9155
  # The fraction of the original amount that the customer pays after applying the
7721
9156
  # discount. Set to null to remove the discount fraction. For example, 0.85 means
7722
9157
  # the customer pays 85% of the original amount (a 15% discount).
@@ -7724,9 +9159,59 @@ module MetronomeSDK
7724
9159
  )
7725
9160
  end
7726
9161
 
7727
- sig { override.returns({ payment_fraction: T.nilable(Float) }) }
9162
+ sig do
9163
+ override.returns(
9164
+ {
9165
+ cap:
9166
+ T.nilable(
9167
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSpendThresholdConfiguration::DiscountConfiguration::Cap
9168
+ ),
9169
+ payment_fraction: T.nilable(Float)
9170
+ }
9171
+ )
9172
+ end
7728
9173
  def to_hash
7729
9174
  end
9175
+
9176
+ class Cap < MetronomeSDK::Internal::Type::BaseModel
9177
+ OrHash =
9178
+ T.type_alias do
9179
+ T.any(
9180
+ MetronomeSDK::Models::V2::ContractGetEditHistoryResponse::Data::UpdateSpendThresholdConfiguration::DiscountConfiguration::Cap,
9181
+ MetronomeSDK::Internal::AnyHash
9182
+ )
9183
+ end
9184
+
9185
+ # Accumulated spend ceiling above which the discount stops applying.
9186
+ sig { returns(Float) }
9187
+ attr_accessor :amount
9188
+
9189
+ # Alias of the spend tracker this cap is measured against.
9190
+ sig { returns(String) }
9191
+ attr_accessor :spend_tracker_alias
9192
+
9193
+ # Update the discount cap. Set to null to remove an existing cap.
9194
+ sig do
9195
+ params(amount: Float, spend_tracker_alias: String).returns(
9196
+ T.attached_class
9197
+ )
9198
+ end
9199
+ def self.new(
9200
+ # Accumulated spend ceiling above which the discount stops applying.
9201
+ amount:,
9202
+ # Alias of the spend tracker this cap is measured against.
9203
+ spend_tracker_alias:
9204
+ )
9205
+ end
9206
+
9207
+ sig do
9208
+ override.returns(
9209
+ { amount: Float, spend_tracker_alias: String }
9210
+ )
9211
+ end
9212
+ def to_hash
9213
+ end
9214
+ end
7730
9215
  end
7731
9216
  end
7732
9217