metronome-sdk 3.4.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 (95) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +84 -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/internal/util.rb +22 -7
  7. data/lib/metronome_sdk/models/base_threshold_commit.rb +10 -1
  8. data/lib/metronome_sdk/models/contract_v2.rb +443 -15
  9. data/lib/metronome_sdk/models/credit.rb +74 -4
  10. data/lib/metronome_sdk/models/override.rb +9 -8
  11. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +27 -1
  12. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +28 -2
  13. data/lib/metronome_sdk/models/spend_threshold_configuration.rb +26 -1
  14. data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +30 -4
  15. data/lib/metronome_sdk/models/update_base_threshold_commit.rb +11 -1
  16. data/lib/metronome_sdk/models/v1/alert_create_params.rb +1 -0
  17. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +2 -189
  18. data/lib/metronome_sdk/models/v1/contract_create_params.rb +3 -191
  19. data/lib/metronome_sdk/models/v1/contract_list_seat_balances_params.rb +119 -0
  20. data/lib/metronome_sdk/models/v1/contract_list_seat_balances_response.rb +315 -0
  21. data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +31 -1
  22. data/lib/metronome_sdk/models/v1/contracts/product_update_params.rb +31 -1
  23. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +1 -0
  24. data/lib/metronome_sdk/models/v1/customers/invoice.rb +8 -1
  25. data/lib/metronome_sdk/models/v1/customers/invoice_list_params.rb +29 -1
  26. data/lib/metronome_sdk/models/v1/package_create_params.rb +2 -30
  27. data/lib/metronome_sdk/models/v1/package_list_response.rb +28 -9
  28. data/lib/metronome_sdk/models/v1/package_retrieve_response.rb +29 -9
  29. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +67 -20
  30. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +496 -15
  31. data/lib/metronome_sdk/resources/v1/contracts/products.rb +6 -2
  32. data/lib/metronome_sdk/resources/v1/contracts.rb +76 -2
  33. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +5 -1
  34. data/lib/metronome_sdk/resources/v1/packages.rb +1 -3
  35. data/lib/metronome_sdk/version.rb +1 -1
  36. data/lib/metronome_sdk.rb +3 -1
  37. data/rbi/metronome_sdk/internal/util.rbi +8 -0
  38. data/rbi/metronome_sdk/models/base_threshold_commit.rbi +24 -5
  39. data/rbi/metronome_sdk/models/contract_v2.rbi +916 -19
  40. data/rbi/metronome_sdk/models/credit.rbi +139 -3
  41. data/rbi/metronome_sdk/models/override.rbi +9 -12
  42. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +54 -3
  43. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +55 -4
  44. data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +54 -3
  45. data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +58 -9
  46. data/rbi/metronome_sdk/models/update_base_threshold_commit.rbi +22 -4
  47. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +5 -0
  48. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +3 -416
  49. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +5 -418
  50. data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_params.rbi +179 -0
  51. data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_response.rbi +714 -0
  52. data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +74 -0
  53. data/rbi/metronome_sdk/models/v1/contracts/product_update_params.rbi +74 -0
  54. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +5 -0
  55. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +9 -0
  56. data/rbi/metronome_sdk/models/v1/customers/invoice_list_params.rbi +75 -0
  57. data/rbi/metronome_sdk/models/v1/package_create_params.rbi +3 -76
  58. data/rbi/metronome_sdk/models/v1/package_list_response.rbi +72 -15
  59. data/rbi/metronome_sdk/models/v1/package_retrieve_response.rbi +72 -17
  60. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +133 -28
  61. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1174 -145
  62. data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +18 -0
  63. data/rbi/metronome_sdk/resources/v1/contracts.rbi +88 -3
  64. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +7 -0
  65. data/rbi/metronome_sdk/resources/v1/packages.rbi +0 -3
  66. data/sig/metronome_sdk/internal/util.rbs +4 -0
  67. data/sig/metronome_sdk/models/base_threshold_commit.rbs +13 -3
  68. data/sig/metronome_sdk/models/contract_v2.rbs +401 -16
  69. data/sig/metronome_sdk/models/credit.rbs +69 -0
  70. data/sig/metronome_sdk/models/override.rbs +8 -10
  71. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +22 -3
  72. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +23 -4
  73. data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +22 -3
  74. data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +26 -7
  75. data/sig/metronome_sdk/models/update_base_threshold_commit.rbs +15 -2
  76. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +3 -1
  77. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +3 -147
  78. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +3 -147
  79. data/sig/metronome_sdk/models/v1/contract_list_seat_balances_params.rbs +96 -0
  80. data/sig/metronome_sdk/models/v1/contract_list_seat_balances_response.rbs +299 -0
  81. data/sig/metronome_sdk/models/v1/contracts/product_create_params.rbs +20 -0
  82. data/sig/metronome_sdk/models/v1/contracts/product_update_params.rbs +20 -0
  83. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +3 -1
  84. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +7 -0
  85. data/sig/metronome_sdk/models/v1/customers/invoice_list_params.rbs +29 -1
  86. data/sig/metronome_sdk/models/v1/package_create_params.rbs +3 -30
  87. data/sig/metronome_sdk/models/v1/package_list_response.rbs +33 -15
  88. data/sig/metronome_sdk/models/v1/package_retrieve_response.rbs +33 -15
  89. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +33 -10
  90. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +409 -19
  91. data/sig/metronome_sdk/resources/v1/contracts/products.rbs +2 -0
  92. data/sig/metronome_sdk/resources/v1/contracts.rbs +15 -0
  93. data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +2 -0
  94. data/sig/metronome_sdk/resources/v1/packages.rbs +0 -1
  95. metadata +8 -2
@@ -78,7 +78,7 @@ module MetronomeSDK
78
78
  # A list of ordered events that impact the balance of a credit. For example, an
79
79
  # invoice deduction or an expiration.
80
80
  #
81
- # @return [Array<MetronomeSDK::Models::Credit::Ledger::CreditSegmentStartLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditExpirationLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCanceledLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCreditedLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditManualLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry>, nil]
81
+ # @return [Array<MetronomeSDK::Models::Credit::Ledger::CreditSegmentStartLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditExpirationLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCanceledLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCreditedLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditManualLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditRolloverLedgerEntry>, nil]
82
82
  optional :ledger, -> { MetronomeSDK::Internal::Type::ArrayOf[union: MetronomeSDK::Credit::Ledger] }
83
83
 
84
84
  # @!attribute name
@@ -111,6 +111,11 @@ module MetronomeSDK
111
111
  # @return [String, nil]
112
112
  optional :recurring_credit_id, String
113
113
 
114
+ # @!attribute rolled_over_from
115
+ #
116
+ # @return [MetronomeSDK::Models::Credit::RolledOverFrom, nil]
117
+ optional :rolled_over_from, -> { MetronomeSDK::Credit::RolledOverFrom }
118
+
114
119
  # @!attribute salesforce_opportunity_id
115
120
  # This field's availability is dependent on your client's configuration.
116
121
  #
@@ -141,7 +146,7 @@ module MetronomeSDK
141
146
  # @return [String, nil]
142
147
  optional :uniqueness_key, String
143
148
 
144
- # @!method initialize(id:, product:, type:, access_schedule: nil, applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, balance: nil, contract: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, ledger: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, recurring_credit_id: nil, salesforce_opportunity_id: nil, specifiers: nil, subscription_config: nil, uniqueness_key: nil)
149
+ # @!method initialize(id:, product:, type:, access_schedule: nil, applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, balance: nil, contract: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, ledger: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, recurring_credit_id: nil, rolled_over_from: nil, salesforce_opportunity_id: nil, specifiers: nil, subscription_config: nil, uniqueness_key: nil)
145
150
  # Some parameter documentations has been truncated, see
146
151
  # {MetronomeSDK::Models::Credit} for more details.
147
152
  #
@@ -169,7 +174,7 @@ module MetronomeSDK
169
174
  #
170
175
  # @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for credit hierarchy access control
171
176
  #
172
- # @param ledger [Array<MetronomeSDK::Models::Credit::Ledger::CreditSegmentStartLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditExpirationLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCanceledLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCreditedLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditManualLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry>] A list of ordered events that impact the balance of a credit. For example, an in
177
+ # @param ledger [Array<MetronomeSDK::Models::Credit::Ledger::CreditSegmentStartLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditExpirationLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCanceledLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCreditedLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditManualLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditRolloverLedgerEntry>] A list of ordered events that impact the balance of a credit. For example, an in
173
178
  #
174
179
  # @param name [String]
175
180
  #
@@ -181,6 +186,8 @@ module MetronomeSDK
181
186
  #
182
187
  # @param recurring_credit_id [String] The ID of the recurring credit that this credit was generated from, if applicabl
183
188
  #
189
+ # @param rolled_over_from [MetronomeSDK::Models::Credit::RolledOverFrom]
190
+ #
184
191
  # @param salesforce_opportunity_id [String] This field's availability is dependent on your client's configuration.
185
192
  #
186
193
  # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifier>] List of filters that determine what kind of customer usage draws down a commit o
@@ -244,6 +251,8 @@ module MetronomeSDK
244
251
 
245
252
  variant -> { MetronomeSDK::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry }
246
253
 
254
+ variant -> { MetronomeSDK::Credit::Ledger::CreditRolloverLedgerEntry }
255
+
247
256
  class CreditSegmentStartLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
248
257
  # @!attribute amount
249
258
  #
@@ -547,8 +556,52 @@ module MetronomeSDK
547
556
  end
548
557
  end
549
558
 
559
+ class CreditRolloverLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
560
+ # @!attribute amount
561
+ #
562
+ # @return [Float]
563
+ required :amount, Float
564
+
565
+ # @!attribute new_contract_id
566
+ #
567
+ # @return [String]
568
+ required :new_contract_id, String
569
+
570
+ # @!attribute segment_id
571
+ #
572
+ # @return [String]
573
+ required :segment_id, String
574
+
575
+ # @!attribute timestamp
576
+ #
577
+ # @return [Time]
578
+ required :timestamp, Time
579
+
580
+ # @!attribute type
581
+ #
582
+ # @return [Symbol, MetronomeSDK::Models::Credit::Ledger::CreditRolloverLedgerEntry::Type]
583
+ required :type, enum: -> { MetronomeSDK::Credit::Ledger::CreditRolloverLedgerEntry::Type }
584
+
585
+ # @!method initialize(amount:, new_contract_id:, segment_id:, timestamp:, type:)
586
+ # @param amount [Float]
587
+ # @param new_contract_id [String]
588
+ # @param segment_id [String]
589
+ # @param timestamp [Time]
590
+ # @param type [Symbol, MetronomeSDK::Models::Credit::Ledger::CreditRolloverLedgerEntry::Type]
591
+
592
+ # @see MetronomeSDK::Models::Credit::Ledger::CreditRolloverLedgerEntry#type
593
+ module Type
594
+ extend MetronomeSDK::Internal::Type::Enum
595
+
596
+ CREDIT_ROLLOVER = :CREDIT_ROLLOVER
597
+
598
+ # @!method self.values
599
+ # @return [Array<Symbol>]
600
+ end
601
+ end
602
+
550
603
  # @!method self.variants
551
- # @return [Array(MetronomeSDK::Models::Credit::Ledger::CreditSegmentStartLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditExpirationLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCanceledLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCreditedLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditManualLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry)]
604
+ # @return [Array(MetronomeSDK::Models::Credit::Ledger::CreditSegmentStartLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditExpirationLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCanceledLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCreditedLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditManualLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditRolloverLedgerEntry)]
552
605
  end
553
606
 
554
607
  # @see MetronomeSDK::Models::Credit#rate_type
@@ -562,6 +615,23 @@ module MetronomeSDK
562
615
  # @return [Array<Symbol>]
563
616
  end
564
617
 
618
+ # @see MetronomeSDK::Models::Credit#rolled_over_from
619
+ class RolledOverFrom < MetronomeSDK::Internal::Type::BaseModel
620
+ # @!attribute contract_id
621
+ #
622
+ # @return [String]
623
+ required :contract_id, String
624
+
625
+ # @!attribute credit_id
626
+ #
627
+ # @return [String]
628
+ required :credit_id, String
629
+
630
+ # @!method initialize(contract_id:, credit_id:)
631
+ # @param contract_id [String]
632
+ # @param credit_id [String]
633
+ end
634
+
565
635
  # @see MetronomeSDK::Models::Credit#subscription_config
566
636
  class SubscriptionConfig < MetronomeSDK::Internal::Type::BaseModel
567
637
  # @!attribute allocation
@@ -8,6 +8,11 @@ module MetronomeSDK
8
8
  # @return [String]
9
9
  required :id, String
10
10
 
11
+ # @!attribute created_at
12
+ #
13
+ # @return [Time]
14
+ required :created_at, Time
15
+
11
16
  # @!attribute starting_at
12
17
  #
13
18
  # @return [Time]
@@ -117,12 +122,14 @@ module MetronomeSDK
117
122
  # @return [Hash{Symbol=>Object}, nil]
118
123
  optional :value, MetronomeSDK::Internal::Type::HashOf[MetronomeSDK::Internal::Type::Unknown]
119
124
 
120
- # @!method initialize(id:, starting_at:, applicable_product_tags: nil, credit_type: nil, ending_before: nil, entitled: nil, is_commit_specific: nil, is_prorated: nil, multiplier: nil, override_specifiers: nil, override_tiers: nil, overwrite_rate: nil, price: nil, priority: nil, product: nil, quantity: nil, rate_type: nil, target: nil, tiers: nil, type: nil, value: nil)
125
+ # @!method initialize(id:, created_at:, starting_at:, applicable_product_tags: nil, credit_type: nil, ending_before: nil, entitled: nil, is_commit_specific: nil, is_prorated: nil, multiplier: nil, override_specifiers: nil, override_tiers: nil, overwrite_rate: nil, price: nil, priority: nil, product: nil, quantity: nil, rate_type: nil, target: nil, tiers: nil, type: nil, value: nil)
121
126
  # Some parameter documentations has been truncated, see
122
127
  # {MetronomeSDK::Models::Override} for more details.
123
128
  #
124
129
  # @param id [String]
125
130
  #
131
+ # @param created_at [Time]
132
+ #
126
133
  # @param starting_at [Time]
127
134
  #
128
135
  # @param applicable_product_tags [Array<String>]
@@ -199,12 +206,7 @@ module MetronomeSDK
199
206
  # @return [Array<String>, nil]
200
207
  optional :recurring_commit_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
201
208
 
202
- # @!attribute recurring_credit_ids
203
- #
204
- # @return [Array<String>, nil]
205
- optional :recurring_credit_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
206
-
207
- # @!method initialize(billing_frequency: nil, commit_ids: nil, presentation_group_values: nil, pricing_group_values: nil, product_id: nil, product_tags: nil, recurring_commit_ids: nil, recurring_credit_ids: nil)
209
+ # @!method initialize(billing_frequency: nil, commit_ids: nil, presentation_group_values: nil, pricing_group_values: nil, product_id: nil, product_tags: nil, recurring_commit_ids: nil)
208
210
  # @param billing_frequency [Symbol, MetronomeSDK::Models::Override::OverrideSpecifier::BillingFrequency]
209
211
  # @param commit_ids [Array<String>]
210
212
  # @param presentation_group_values [Hash{Symbol=>String, nil}]
@@ -212,7 +214,6 @@ module MetronomeSDK
212
214
  # @param product_id [String]
213
215
  # @param product_tags [Array<String>]
214
216
  # @param recurring_commit_ids [Array<String>]
215
- # @param recurring_credit_ids [Array<String>]
216
217
 
217
218
  # @see MetronomeSDK::Models::Override::OverrideSpecifier#billing_frequency
218
219
  module BillingFrequency
@@ -41,7 +41,13 @@ module MetronomeSDK
41
41
  # @return [String, nil]
42
42
  optional :custom_credit_type_id, String
43
43
 
44
- # @!method initialize(commit:, is_enabled:, payment_gate_config:, recharge_to_amount:, threshold_amount:, custom_credit_type_id: nil)
44
+ # @!attribute discount_configuration
45
+ #
46
+ # @return [MetronomeSDK::Models::PrepaidBalanceThresholdConfiguration::DiscountConfiguration, nil]
47
+ optional :discount_configuration,
48
+ -> { MetronomeSDK::PrepaidBalanceThresholdConfiguration::DiscountConfiguration }
49
+
50
+ # @!method initialize(commit:, is_enabled:, payment_gate_config:, recharge_to_amount:, threshold_amount:, custom_credit_type_id: nil, discount_configuration: nil)
45
51
  # Some parameter documentations has been truncated, see
46
52
  # {MetronomeSDK::Models::PrepaidBalanceThresholdConfiguration} for more details.
47
53
  #
@@ -56,6 +62,8 @@ module MetronomeSDK
56
62
  # @param threshold_amount [Float] Specify the threshold amount for the contract. Each time the contract's prepaid
57
63
  #
58
64
  # @param custom_credit_type_id [String] If provided, the threshold, recharge-to amount, and the resulting threshold comm
65
+ #
66
+ # @param discount_configuration [MetronomeSDK::Models::PrepaidBalanceThresholdConfiguration::DiscountConfiguration]
59
67
 
60
68
  # @see MetronomeSDK::Models::PrepaidBalanceThresholdConfiguration#commit
61
69
  class Commit < MetronomeSDK::Models::BaseThresholdCommit
@@ -95,6 +103,24 @@ module MetronomeSDK
95
103
  #
96
104
  # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifierInput>] List of filters that determine what kind of customer usage draws down a commit o
97
105
  end
106
+
107
+ # @see MetronomeSDK::Models::PrepaidBalanceThresholdConfiguration#discount_configuration
108
+ class DiscountConfiguration < MetronomeSDK::Internal::Type::BaseModel
109
+ # @!attribute payment_fraction
110
+ # The fraction of the original amount that the customer pays after applying the
111
+ # discount. For example, 0.85 means the customer pays 85% of the original amount
112
+ # (a 15% discount).
113
+ #
114
+ # @return [Float]
115
+ required :payment_fraction, Float
116
+
117
+ # @!method initialize(payment_fraction:)
118
+ # Some parameter documentations has been truncated, see
119
+ # {MetronomeSDK::Models::PrepaidBalanceThresholdConfiguration::DiscountConfiguration}
120
+ # for more details.
121
+ #
122
+ # @param payment_fraction [Float] The fraction of the original amount that the customer pays after applying the di
123
+ end
98
124
  end
99
125
  end
100
126
  end
@@ -41,7 +41,13 @@ module MetronomeSDK
41
41
  # @return [String, nil]
42
42
  optional :custom_credit_type_id, String
43
43
 
44
- # @!method initialize(commit:, is_enabled:, payment_gate_config:, recharge_to_amount:, threshold_amount:, custom_credit_type_id: nil)
44
+ # @!attribute discount_configuration
45
+ #
46
+ # @return [MetronomeSDK::Models::PrepaidBalanceThresholdConfigurationV2::DiscountConfiguration, nil]
47
+ optional :discount_configuration,
48
+ -> { MetronomeSDK::PrepaidBalanceThresholdConfigurationV2::DiscountConfiguration }
49
+
50
+ # @!method initialize(commit:, is_enabled:, payment_gate_config:, recharge_to_amount:, threshold_amount:, custom_credit_type_id: nil, discount_configuration: nil)
45
51
  # Some parameter documentations has been truncated, see
46
52
  # {MetronomeSDK::Models::PrepaidBalanceThresholdConfigurationV2} for more details.
47
53
  #
@@ -56,9 +62,11 @@ module MetronomeSDK
56
62
  # @param threshold_amount [Float] Specify the threshold amount for the contract. Each time the contract's balance
57
63
  #
58
64
  # @param custom_credit_type_id [String] If provided, the threshold, recharge-to amount, and the resulting threshold comm
65
+ #
66
+ # @param discount_configuration [MetronomeSDK::Models::PrepaidBalanceThresholdConfigurationV2::DiscountConfiguration]
59
67
 
60
68
  # @see MetronomeSDK::Models::PrepaidBalanceThresholdConfigurationV2#commit
61
- class Commit < MetronomeSDK::Models::UpdateBaseThresholdCommit
69
+ class Commit < MetronomeSDK::Models::BaseThresholdCommit
62
70
  # @!attribute applicable_product_ids
63
71
  # Which products the threshold commit applies to. If applicable_product_ids,
64
72
  # applicable_product_tags or specifiers are not provided, the commit applies to
@@ -97,6 +105,24 @@ module MetronomeSDK
97
105
  #
98
106
  # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifierInput>] List of filters that determine what kind of customer usage draws down a commit o
99
107
  end
108
+
109
+ # @see MetronomeSDK::Models::PrepaidBalanceThresholdConfigurationV2#discount_configuration
110
+ class DiscountConfiguration < MetronomeSDK::Internal::Type::BaseModel
111
+ # @!attribute payment_fraction
112
+ # The fraction of the original amount that the customer pays after applying the
113
+ # discount. For example, 0.85 means the customer pays 85% of the original amount
114
+ # (a 15% discount).
115
+ #
116
+ # @return [Float]
117
+ required :payment_fraction, Float
118
+
119
+ # @!method initialize(payment_fraction:)
120
+ # Some parameter documentations has been truncated, see
121
+ # {MetronomeSDK::Models::PrepaidBalanceThresholdConfigurationV2::DiscountConfiguration}
122
+ # for more details.
123
+ #
124
+ # @param payment_fraction [Float] The fraction of the original amount that the customer pays after applying the di
125
+ end
100
126
  end
101
127
  end
102
128
  end
@@ -28,7 +28,12 @@ module MetronomeSDK
28
28
  # @return [Float]
29
29
  required :threshold_amount, Float
30
30
 
31
- # @!method initialize(commit:, is_enabled:, payment_gate_config:, threshold_amount:)
31
+ # @!attribute discount_configuration
32
+ #
33
+ # @return [MetronomeSDK::Models::SpendThresholdConfiguration::DiscountConfiguration, nil]
34
+ optional :discount_configuration, -> { MetronomeSDK::SpendThresholdConfiguration::DiscountConfiguration }
35
+
36
+ # @!method initialize(commit:, is_enabled:, payment_gate_config:, threshold_amount:, discount_configuration: nil)
32
37
  # Some parameter documentations has been truncated, see
33
38
  # {MetronomeSDK::Models::SpendThresholdConfiguration} for more details.
34
39
  #
@@ -39,6 +44,26 @@ module MetronomeSDK
39
44
  # @param payment_gate_config [MetronomeSDK::Models::PaymentGateConfig]
40
45
  #
41
46
  # @param threshold_amount [Float] Specify the threshold amount for the contract. Each time the contract's usage hi
47
+ #
48
+ # @param discount_configuration [MetronomeSDK::Models::SpendThresholdConfiguration::DiscountConfiguration]
49
+
50
+ # @see MetronomeSDK::Models::SpendThresholdConfiguration#discount_configuration
51
+ class DiscountConfiguration < MetronomeSDK::Internal::Type::BaseModel
52
+ # @!attribute payment_fraction
53
+ # The fraction of the original amount that the customer pays after applying the
54
+ # discount. For example, 0.85 means the customer pays 85% of the original amount
55
+ # (a 15% discount).
56
+ #
57
+ # @return [Float]
58
+ required :payment_fraction, Float
59
+
60
+ # @!method initialize(payment_fraction:)
61
+ # Some parameter documentations has been truncated, see
62
+ # {MetronomeSDK::Models::SpendThresholdConfiguration::DiscountConfiguration} for
63
+ # more details.
64
+ #
65
+ # @param payment_fraction [Float] The fraction of the original amount that the customer pays after applying the di
66
+ end
42
67
  end
43
68
  end
44
69
  end
@@ -5,8 +5,8 @@ module MetronomeSDK
5
5
  class SpendThresholdConfigurationV2 < MetronomeSDK::Internal::Type::BaseModel
6
6
  # @!attribute commit
7
7
  #
8
- # @return [MetronomeSDK::Models::UpdateBaseThresholdCommit]
9
- required :commit, -> { MetronomeSDK::UpdateBaseThresholdCommit }
8
+ # @return [MetronomeSDK::Models::BaseThresholdCommit]
9
+ required :commit, -> { MetronomeSDK::BaseThresholdCommit }
10
10
 
11
11
  # @!attribute is_enabled
12
12
  # When set to false, the contract will not be evaluated against the
@@ -28,17 +28,43 @@ module MetronomeSDK
28
28
  # @return [Float]
29
29
  required :threshold_amount, Float
30
30
 
31
- # @!method initialize(commit:, is_enabled:, payment_gate_config:, threshold_amount:)
31
+ # @!attribute discount_configuration
32
+ #
33
+ # @return [MetronomeSDK::Models::SpendThresholdConfigurationV2::DiscountConfiguration, nil]
34
+ optional :discount_configuration,
35
+ -> { MetronomeSDK::SpendThresholdConfigurationV2::DiscountConfiguration }
36
+
37
+ # @!method initialize(commit:, is_enabled:, payment_gate_config:, threshold_amount:, discount_configuration: nil)
32
38
  # Some parameter documentations has been truncated, see
33
39
  # {MetronomeSDK::Models::SpendThresholdConfigurationV2} for more details.
34
40
  #
35
- # @param commit [MetronomeSDK::Models::UpdateBaseThresholdCommit]
41
+ # @param commit [MetronomeSDK::Models::BaseThresholdCommit]
36
42
  #
37
43
  # @param is_enabled [Boolean] When set to false, the contract will not be evaluated against the threshold_amou
38
44
  #
39
45
  # @param payment_gate_config [MetronomeSDK::Models::PaymentGateConfigV2]
40
46
  #
41
47
  # @param threshold_amount [Float] Specify the threshold amount for the contract. Each time the contract's usage hi
48
+ #
49
+ # @param discount_configuration [MetronomeSDK::Models::SpendThresholdConfigurationV2::DiscountConfiguration]
50
+
51
+ # @see MetronomeSDK::Models::SpendThresholdConfigurationV2#discount_configuration
52
+ class DiscountConfiguration < MetronomeSDK::Internal::Type::BaseModel
53
+ # @!attribute payment_fraction
54
+ # The fraction of the original amount that the customer pays after applying the
55
+ # discount. For example, 0.85 means the customer pays 85% of the original amount
56
+ # (a 15% discount).
57
+ #
58
+ # @return [Float]
59
+ required :payment_fraction, Float
60
+
61
+ # @!method initialize(payment_fraction:)
62
+ # Some parameter documentations has been truncated, see
63
+ # {MetronomeSDK::Models::SpendThresholdConfigurationV2::DiscountConfiguration} for
64
+ # more details.
65
+ #
66
+ # @param payment_fraction [Float] The fraction of the original amount that the customer pays after applying the di
67
+ end
42
68
  end
43
69
  end
44
70
  end
@@ -15,6 +15,14 @@ module MetronomeSDK
15
15
  # @return [String, nil]
16
16
  optional :name, String
17
17
 
18
+ # @!attribute priority
19
+ # The priority of the commit, used to determine drawdown order. Lower priority
20
+ # commits are consumed first. Defaults to 100 if not specified. On updates, set to
21
+ # null to clear a previously configured priority.
22
+ #
23
+ # @return [Float, nil]
24
+ optional :priority, Float, nil?: true
25
+
18
26
  # @!attribute product_id
19
27
  # The commit product that will be used to generate the line item for commit
20
28
  # payment.
@@ -22,7 +30,7 @@ module MetronomeSDK
22
30
  # @return [String, nil]
23
31
  optional :product_id, String
24
32
 
25
- # @!method initialize(description: nil, name: nil, product_id: nil)
33
+ # @!method initialize(description: nil, name: nil, priority: nil, product_id: nil)
26
34
  # Some parameter documentations has been truncated, see
27
35
  # {MetronomeSDK::Models::UpdateBaseThresholdCommit} for more details.
28
36
  #
@@ -30,6 +38,8 @@ module MetronomeSDK
30
38
  #
31
39
  # @param name [String] Specify the name of the line item for the threshold charge. If left blank, it wi
32
40
  #
41
+ # @param priority [Float, nil] The priority of the commit, used to determine drawdown order. Lower priority com
42
+ #
33
43
  # @param product_id [String] The commit product that will be used to generate the line item for commit paymen
34
44
  end
35
45
  end
@@ -200,6 +200,7 @@ module MetronomeSDK
200
200
  CONTRACT = :Contract
201
201
  COMMIT = :Commit
202
202
  CONTRACT_CREDIT = :ContractCredit
203
+ CONTRACT_CREDIT_OR_COMMIT = :ContractCreditOrCommit
203
204
 
204
205
  # @!method self.values
205
206
  # @return [Array<Symbol>]
@@ -206,12 +206,6 @@ module MetronomeSDK
206
206
  # @return [String, nil]
207
207
  optional :netsuite_sales_order_id, String
208
208
 
209
- # @!attribute payment_gate_config
210
- # optionally payment gate this commit
211
- #
212
- # @return [MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig, nil]
213
- optional :payment_gate_config, -> { MetronomeSDK::V1::ContractAmendParams::Commit::PaymentGateConfig }
214
-
215
209
  # @!attribute priority
216
210
  # If multiple commits are applicable, the one with the lower priority will apply
217
211
  # first.
@@ -246,7 +240,7 @@ module MetronomeSDK
246
240
  # @return [String, nil]
247
241
  optional :temporary_id, String
248
242
 
249
- # @!method initialize(product_id:, type:, access_schedule: nil, amount: nil, applicable_product_ids: nil, applicable_product_tags: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, invoice_schedule: nil, name: nil, netsuite_sales_order_id: nil, payment_gate_config: nil, priority: nil, rate_type: nil, rollover_fraction: nil, specifiers: nil, temporary_id: nil)
243
+ # @!method initialize(product_id:, type:, access_schedule: nil, amount: nil, applicable_product_ids: nil, applicable_product_tags: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, invoice_schedule: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, rollover_fraction: nil, specifiers: nil, temporary_id: nil)
250
244
  # Some parameter documentations has been truncated, see
251
245
  # {MetronomeSDK::Models::V1::ContractAmendParams::Commit} for more details.
252
246
  #
@@ -274,8 +268,6 @@ module MetronomeSDK
274
268
  #
275
269
  # @param netsuite_sales_order_id [String] This field's availability is dependent on your client's configuration.
276
270
  #
277
- # @param payment_gate_config [MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig] optionally payment gate this commit
278
- #
279
271
  # @param priority [Float] If multiple commits are applicable, the one with the lower priority will apply f
280
272
  #
281
273
  # @param rate_type [Symbol, MetronomeSDK::Models::V1::ContractAmendParams::Commit::RateType]
@@ -541,174 +533,6 @@ module MetronomeSDK
541
533
  end
542
534
  end
543
535
 
544
- # @see MetronomeSDK::Models::V1::ContractAmendParams::Commit#payment_gate_config
545
- class PaymentGateConfig < MetronomeSDK::Internal::Type::BaseModel
546
- # @!attribute payment_gate_type
547
- # Gate access to the commit balance based on successful collection of payment.
548
- # Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
549
- # facilitate payment using your own payment integration. Select NONE if you do not
550
- # wish to payment gate the commit balance.
551
- #
552
- # @return [Symbol, MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig::PaymentGateType]
553
- required :payment_gate_type,
554
- enum: -> { MetronomeSDK::V1::ContractAmendParams::Commit::PaymentGateConfig::PaymentGateType }
555
-
556
- # @!attribute precalculated_tax_config
557
- # Only applicable if using PRECALCULATED as your tax type.
558
- #
559
- # @return [MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig, nil]
560
- optional :precalculated_tax_config,
561
- -> { MetronomeSDK::V1::ContractAmendParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig }
562
-
563
- # @!attribute stripe_config
564
- # Only applicable if using STRIPE as your payment gate type.
565
- #
566
- # @return [MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig::StripeConfig, nil]
567
- optional :stripe_config,
568
- -> { MetronomeSDK::V1::ContractAmendParams::Commit::PaymentGateConfig::StripeConfig }
569
-
570
- # @!attribute tax_type
571
- # Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
572
- # not wish Metronome to calculate tax on your behalf. Leaving this field blank
573
- # will default to NONE.
574
- #
575
- # @return [Symbol, MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig::TaxType, nil]
576
- optional :tax_type, enum: -> { MetronomeSDK::V1::ContractAmendParams::Commit::PaymentGateConfig::TaxType }
577
-
578
- # @!method initialize(payment_gate_type:, precalculated_tax_config: nil, stripe_config: nil, tax_type: nil)
579
- # Some parameter documentations has been truncated, see
580
- # {MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig} for
581
- # more details.
582
- #
583
- # optionally payment gate this commit
584
- #
585
- # @param payment_gate_type [Symbol, MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig::PaymentGateType] Gate access to the commit balance based on successful collection of payment. Sel
586
- #
587
- # @param precalculated_tax_config [MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig] Only applicable if using PRECALCULATED as your tax type.
588
- #
589
- # @param stripe_config [MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig::StripeConfig] Only applicable if using STRIPE as your payment gate type.
590
- #
591
- # @param tax_type [Symbol, MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig::TaxType] Stripe tax is only supported for Stripe payment gateway. Select NONE if you do n
592
-
593
- # Gate access to the commit balance based on successful collection of payment.
594
- # Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
595
- # facilitate payment using your own payment integration. Select NONE if you do not
596
- # wish to payment gate the commit balance.
597
- #
598
- # @see MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig#payment_gate_type
599
- module PaymentGateType
600
- extend MetronomeSDK::Internal::Type::Enum
601
-
602
- NONE = :NONE
603
- STRIPE = :STRIPE
604
- EXTERNAL = :EXTERNAL
605
-
606
- # @!method self.values
607
- # @return [Array<Symbol>]
608
- end
609
-
610
- # @see MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig#precalculated_tax_config
611
- class PrecalculatedTaxConfig < MetronomeSDK::Internal::Type::BaseModel
612
- # @!attribute tax_amount
613
- # Amount of tax to be applied. This should be in the same currency and
614
- # denomination as the commit's invoice schedule
615
- #
616
- # @return [Float]
617
- required :tax_amount, Float
618
-
619
- # @!attribute tax_name
620
- # Name of the tax to be applied. This may be used in an invoice line item
621
- # description.
622
- #
623
- # @return [String, nil]
624
- optional :tax_name, String
625
-
626
- # @!method initialize(tax_amount:, tax_name: nil)
627
- # Some parameter documentations has been truncated, see
628
- # {MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig}
629
- # for more details.
630
- #
631
- # Only applicable if using PRECALCULATED as your tax type.
632
- #
633
- # @param tax_amount [Float] Amount of tax to be applied. This should be in the same currency and denominatio
634
- #
635
- # @param tax_name [String] Name of the tax to be applied. This may be used in an invoice line item descript
636
- end
637
-
638
- # @see MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig#stripe_config
639
- class StripeConfig < MetronomeSDK::Internal::Type::BaseModel
640
- # @!attribute payment_type
641
- # If left blank, will default to INVOICE
642
- #
643
- # @return [Symbol, MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig::StripeConfig::PaymentType]
644
- required :payment_type,
645
- enum: -> { MetronomeSDK::V1::ContractAmendParams::Commit::PaymentGateConfig::StripeConfig::PaymentType }
646
-
647
- # @!attribute invoice_metadata
648
- # Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
649
- # your payment type.
650
- #
651
- # @return [Hash{Symbol=>String}, nil]
652
- optional :invoice_metadata, MetronomeSDK::Internal::Type::HashOf[String]
653
-
654
- # @!attribute on_session_payment
655
- # If true, the payment will be made assuming the customer is present (i.e. on
656
- # session).
657
- #
658
- # If false, the payment will be made assuming the customer is not present (i.e.
659
- # off session). For cardholders from a country with an e-mandate requirement (e.g.
660
- # India), the payment may be declined.
661
- #
662
- # If left blank, will default to false.
663
- #
664
- # @return [Boolean, nil]
665
- optional :on_session_payment, MetronomeSDK::Internal::Type::Boolean
666
-
667
- # @!method initialize(payment_type:, invoice_metadata: nil, on_session_payment: nil)
668
- # Some parameter documentations has been truncated, see
669
- # {MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig::StripeConfig}
670
- # for more details.
671
- #
672
- # Only applicable if using STRIPE as your payment gate type.
673
- #
674
- # @param payment_type [Symbol, MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig::StripeConfig::PaymentType] If left blank, will default to INVOICE
675
- #
676
- # @param invoice_metadata [Hash{Symbol=>String}] Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
677
- #
678
- # @param on_session_payment [Boolean] If true, the payment will be made assuming the customer is present (i.e. on sess
679
-
680
- # If left blank, will default to INVOICE
681
- #
682
- # @see MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig::StripeConfig#payment_type
683
- module PaymentType
684
- extend MetronomeSDK::Internal::Type::Enum
685
-
686
- INVOICE = :INVOICE
687
- PAYMENT_INTENT = :PAYMENT_INTENT
688
-
689
- # @!method self.values
690
- # @return [Array<Symbol>]
691
- end
692
- end
693
-
694
- # Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
695
- # not wish Metronome to calculate tax on your behalf. Leaving this field blank
696
- # will default to NONE.
697
- #
698
- # @see MetronomeSDK::Models::V1::ContractAmendParams::Commit::PaymentGateConfig#tax_type
699
- module TaxType
700
- extend MetronomeSDK::Internal::Type::Enum
701
-
702
- NONE = :NONE
703
- STRIPE = :STRIPE
704
- ANROK = :ANROK
705
- PRECALCULATED = :PRECALCULATED
706
-
707
- # @!method self.values
708
- # @return [Array<Symbol>]
709
- end
710
- end
711
-
712
536
  # @see MetronomeSDK::Models::V1::ContractAmendParams::Commit#rate_type
713
537
  module RateType
714
538
  extend MetronomeSDK::Internal::Type::Enum
@@ -1300,16 +1124,7 @@ module MetronomeSDK
1300
1124
  # @return [Array<String>, nil]
1301
1125
  optional :recurring_commit_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
1302
1126
 
1303
- # @!attribute recurring_credit_ids
1304
- # Can only be used for commit specific overrides. Must be used in conjunction with
1305
- # one of `product_id`, `product_tags`, `pricing_group_values`, or
1306
- # `presentation_group_values`. If provided, the override will only apply to
1307
- # credits created by the specified recurring credit ids.
1308
- #
1309
- # @return [Array<String>, nil]
1310
- optional :recurring_credit_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
1311
-
1312
- # @!method initialize(billing_frequency: nil, commit_ids: nil, presentation_group_values: nil, pricing_group_values: nil, product_id: nil, product_tags: nil, recurring_commit_ids: nil, recurring_credit_ids: nil)
1127
+ # @!method initialize(billing_frequency: nil, commit_ids: nil, presentation_group_values: nil, pricing_group_values: nil, product_id: nil, product_tags: nil, recurring_commit_ids: nil)
1313
1128
  # Some parameter documentations has been truncated, see
1314
1129
  # {MetronomeSDK::Models::V1::ContractAmendParams::Override::OverrideSpecifier} for
1315
1130
  # more details.
@@ -1327,8 +1142,6 @@ module MetronomeSDK
1327
1142
  # @param product_tags [Array<String>] If provided, the override will only apply to products with all the specified tag
1328
1143
  #
1329
1144
  # @param recurring_commit_ids [Array<String>] Can only be used for commit specific overrides. Must be used in conjunction with
1330
- #
1331
- # @param recurring_credit_ids [Array<String>] Can only be used for commit specific overrides. Must be used in conjunction with
1332
1145
 
1333
1146
  # @see MetronomeSDK::Models::V1::ContractAmendParams::Override::OverrideSpecifier#billing_frequency
1334
1147
  module BillingFrequency