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
@@ -7,11 +7,4318 @@ module MetronomeSDK
7
7
  class ContractEditResponse < MetronomeSDK::Internal::Type::BaseModel
8
8
  # @!attribute data
9
9
  #
10
- # @return [MetronomeSDK::Models::ID]
11
- required :data, -> { MetronomeSDK::ID }
10
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data]
11
+ required :data, -> { MetronomeSDK::Models::V2::ContractEditResponse::Data }
12
12
 
13
13
  # @!method initialize(data:)
14
- # @param data [MetronomeSDK::Models::ID]
14
+ # @param data [MetronomeSDK::Models::V2::ContractEditResponse::Data]
15
+
16
+ # @see MetronomeSDK::Models::V2::ContractEditResponse#data
17
+ class Data < MetronomeSDK::Internal::Type::BaseModel
18
+ # @!attribute id
19
+ #
20
+ # @return [String]
21
+ required :id, String
22
+
23
+ # @!attribute edit
24
+ #
25
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit, nil]
26
+ optional :edit, -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit }
27
+
28
+ # @!method initialize(id:, edit: nil)
29
+ # @param id [String]
30
+ # @param edit [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit]
31
+
32
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data#edit
33
+ class Edit < MetronomeSDK::Internal::Type::BaseModel
34
+ # @!attribute id
35
+ #
36
+ # @return [String]
37
+ required :id, String
38
+
39
+ # @!attribute add_commits
40
+ #
41
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit>, nil]
42
+ optional :add_commits,
43
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit] }
44
+
45
+ # @!attribute add_credits
46
+ #
47
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit>, nil]
48
+ optional :add_credits,
49
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit] }
50
+
51
+ # @!attribute add_discounts
52
+ #
53
+ # @return [Array<MetronomeSDK::Models::Discount>, nil]
54
+ optional :add_discounts, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Discount] }
55
+
56
+ # @!attribute add_overrides
57
+ #
58
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride>, nil]
59
+ optional :add_overrides,
60
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride] }
61
+
62
+ # @!attribute add_prepaid_balance_threshold_configuration
63
+ #
64
+ # @return [MetronomeSDK::Models::PrepaidBalanceThresholdConfigurationV2, nil]
65
+ optional :add_prepaid_balance_threshold_configuration,
66
+ -> { MetronomeSDK::PrepaidBalanceThresholdConfigurationV2 }
67
+
68
+ # @!attribute add_pro_services
69
+ #
70
+ # @return [Array<MetronomeSDK::Models::ProService>, nil]
71
+ optional :add_pro_services, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ProService] }
72
+
73
+ # @!attribute add_recurring_commits
74
+ #
75
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit>, nil]
76
+ optional :add_recurring_commits,
77
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit] }
78
+
79
+ # @!attribute add_recurring_credits
80
+ #
81
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit>, nil]
82
+ optional :add_recurring_credits,
83
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit] }
84
+
85
+ # @!attribute add_reseller_royalties
86
+ #
87
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddResellerRoyalty>, nil]
88
+ optional :add_reseller_royalties,
89
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddResellerRoyalty] }
90
+
91
+ # @!attribute add_scheduled_charges
92
+ #
93
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddScheduledCharge>, nil]
94
+ optional :add_scheduled_charges,
95
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddScheduledCharge] }
96
+
97
+ # @!attribute add_spend_threshold_configuration
98
+ #
99
+ # @return [MetronomeSDK::Models::SpendThresholdConfigurationV2, nil]
100
+ optional :add_spend_threshold_configuration, -> { MetronomeSDK::SpendThresholdConfigurationV2 }
101
+
102
+ # @!attribute add_subscriptions
103
+ # List of subscriptions on the contract.
104
+ #
105
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription>, nil]
106
+ optional :add_subscriptions,
107
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription] }
108
+
109
+ # @!attribute add_usage_filters
110
+ #
111
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddUsageFilter>, nil]
112
+ optional :add_usage_filters,
113
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddUsageFilter] }
114
+
115
+ # @!attribute archive_commits
116
+ #
117
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::ArchiveCommit>, nil]
118
+ optional :archive_commits,
119
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::ArchiveCommit] }
120
+
121
+ # @!attribute archive_credits
122
+ #
123
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::ArchiveCredit>, nil]
124
+ optional :archive_credits,
125
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::ArchiveCredit] }
126
+
127
+ # @!attribute archive_scheduled_charges
128
+ #
129
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::ArchiveScheduledCharge>, nil]
130
+ optional :archive_scheduled_charges,
131
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::ArchiveScheduledCharge] }
132
+
133
+ # @!attribute remove_overrides
134
+ #
135
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::RemoveOverride>, nil]
136
+ optional :remove_overrides,
137
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::RemoveOverride] }
138
+
139
+ # @!attribute timestamp
140
+ #
141
+ # @return [Time, nil]
142
+ optional :timestamp, Time
143
+
144
+ # @!attribute uniqueness_key
145
+ # Prevents the creation of duplicates. If a request to create a record is made
146
+ # with a previously used uniqueness key, a new record will not be created and the
147
+ # request will fail with a 409 error.
148
+ #
149
+ # @return [String, nil]
150
+ optional :uniqueness_key, String
151
+
152
+ # @!attribute update_commits
153
+ #
154
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit>, nil]
155
+ optional :update_commits,
156
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit] }
157
+
158
+ # @!attribute update_contract_end_date
159
+ #
160
+ # @return [Time, nil]
161
+ optional :update_contract_end_date, Time
162
+
163
+ # @!attribute update_contract_name
164
+ # Value to update the contract name to. If not provided, the contract name will
165
+ # remain unchanged.
166
+ #
167
+ # @return [String, nil]
168
+ optional :update_contract_name, String, nil?: true
169
+
170
+ # @!attribute update_credits
171
+ #
172
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit>, nil]
173
+ optional :update_credits,
174
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit] }
175
+
176
+ # @!attribute update_discounts
177
+ #
178
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount>, nil]
179
+ optional :update_discounts,
180
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount] }
181
+
182
+ # @!attribute update_prepaid_balance_threshold_configuration
183
+ #
184
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration, nil]
185
+ optional :update_prepaid_balance_threshold_configuration,
186
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration }
187
+
188
+ # @!attribute update_recurring_commits
189
+ #
190
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit>, nil]
191
+ optional :update_recurring_commits,
192
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit] }
193
+
194
+ # @!attribute update_recurring_credits
195
+ #
196
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit>, nil]
197
+ optional :update_recurring_credits,
198
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit] }
199
+
200
+ # @!attribute update_refund_invoices
201
+ #
202
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRefundInvoice>, nil]
203
+ optional :update_refund_invoices,
204
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRefundInvoice] }
205
+
206
+ # @!attribute update_scheduled_charges
207
+ #
208
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge>, nil]
209
+ optional :update_scheduled_charges,
210
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge] }
211
+
212
+ # @!attribute update_spend_threshold_configuration
213
+ #
214
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSpendThresholdConfiguration, nil]
215
+ optional :update_spend_threshold_configuration,
216
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSpendThresholdConfiguration }
217
+
218
+ # @!attribute update_subscriptions
219
+ # Optional list of subscriptions to update.
220
+ #
221
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription>, nil]
222
+ optional :update_subscriptions,
223
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription] }
224
+
225
+ # @!method initialize(id:, add_commits: nil, add_credits: nil, add_discounts: nil, add_overrides: nil, add_prepaid_balance_threshold_configuration: nil, add_pro_services: nil, add_recurring_commits: nil, add_recurring_credits: nil, add_reseller_royalties: nil, add_scheduled_charges: nil, add_spend_threshold_configuration: nil, add_subscriptions: nil, add_usage_filters: nil, archive_commits: nil, archive_credits: nil, archive_scheduled_charges: nil, remove_overrides: nil, timestamp: nil, uniqueness_key: nil, update_commits: nil, update_contract_end_date: nil, update_contract_name: nil, update_credits: nil, update_discounts: nil, update_prepaid_balance_threshold_configuration: nil, update_recurring_commits: nil, update_recurring_credits: nil, update_refund_invoices: nil, update_scheduled_charges: nil, update_spend_threshold_configuration: nil, update_subscriptions: nil)
226
+ # Some parameter documentations has been truncated, see
227
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit} for more details.
228
+ #
229
+ # @param id [String]
230
+ #
231
+ # @param add_commits [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit>]
232
+ #
233
+ # @param add_credits [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit>]
234
+ #
235
+ # @param add_discounts [Array<MetronomeSDK::Models::Discount>]
236
+ #
237
+ # @param add_overrides [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride>]
238
+ #
239
+ # @param add_prepaid_balance_threshold_configuration [MetronomeSDK::Models::PrepaidBalanceThresholdConfigurationV2]
240
+ #
241
+ # @param add_pro_services [Array<MetronomeSDK::Models::ProService>]
242
+ #
243
+ # @param add_recurring_commits [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit>]
244
+ #
245
+ # @param add_recurring_credits [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit>]
246
+ #
247
+ # @param add_reseller_royalties [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddResellerRoyalty>]
248
+ #
249
+ # @param add_scheduled_charges [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddScheduledCharge>]
250
+ #
251
+ # @param add_spend_threshold_configuration [MetronomeSDK::Models::SpendThresholdConfigurationV2]
252
+ #
253
+ # @param add_subscriptions [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription>] List of subscriptions on the contract.
254
+ #
255
+ # @param add_usage_filters [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddUsageFilter>]
256
+ #
257
+ # @param archive_commits [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::ArchiveCommit>]
258
+ #
259
+ # @param archive_credits [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::ArchiveCredit>]
260
+ #
261
+ # @param archive_scheduled_charges [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::ArchiveScheduledCharge>]
262
+ #
263
+ # @param remove_overrides [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::RemoveOverride>]
264
+ #
265
+ # @param timestamp [Time]
266
+ #
267
+ # @param uniqueness_key [String] Prevents the creation of duplicates. If a request to create a record is made wit
268
+ #
269
+ # @param update_commits [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit>]
270
+ #
271
+ # @param update_contract_end_date [Time]
272
+ #
273
+ # @param update_contract_name [String, nil] Value to update the contract name to. If not provided, the contract name will re
274
+ #
275
+ # @param update_credits [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit>]
276
+ #
277
+ # @param update_discounts [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount>]
278
+ #
279
+ # @param update_prepaid_balance_threshold_configuration [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration]
280
+ #
281
+ # @param update_recurring_commits [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit>]
282
+ #
283
+ # @param update_recurring_credits [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit>]
284
+ #
285
+ # @param update_refund_invoices [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRefundInvoice>]
286
+ #
287
+ # @param update_scheduled_charges [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge>]
288
+ #
289
+ # @param update_spend_threshold_configuration [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSpendThresholdConfiguration]
290
+ #
291
+ # @param update_subscriptions [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription>] Optional list of subscriptions to update.
292
+
293
+ class AddCommit < MetronomeSDK::Internal::Type::BaseModel
294
+ # @!attribute id
295
+ #
296
+ # @return [String]
297
+ required :id, String
298
+
299
+ # @!attribute product
300
+ #
301
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::Product]
302
+ required :product, -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::Product }
303
+
304
+ # @!attribute type
305
+ #
306
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::Type]
307
+ required :type, enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::Type }
308
+
309
+ # @!attribute access_schedule
310
+ # The schedule that the customer will gain access to the credits purposed with
311
+ # this commit.
312
+ #
313
+ # @return [MetronomeSDK::Models::ScheduleDuration, nil]
314
+ optional :access_schedule, -> { MetronomeSDK::ScheduleDuration }
315
+
316
+ # @!attribute applicable_product_ids
317
+ #
318
+ # @return [Array<String>, nil]
319
+ optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
320
+
321
+ # @!attribute applicable_product_tags
322
+ #
323
+ # @return [Array<String>, nil]
324
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
325
+
326
+ # @!attribute description
327
+ #
328
+ # @return [String, nil]
329
+ optional :description, String
330
+
331
+ # @!attribute hierarchy_configuration
332
+ # Optional configuration for commit hierarchy access control
333
+ #
334
+ # @return [MetronomeSDK::Models::CommitHierarchyConfiguration, nil]
335
+ optional :hierarchy_configuration, -> { MetronomeSDK::CommitHierarchyConfiguration }
336
+
337
+ # @!attribute invoice_schedule
338
+ # The schedule that the customer will be invoiced for this commit.
339
+ #
340
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::InvoiceSchedule, nil]
341
+ optional :invoice_schedule,
342
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::InvoiceSchedule }
343
+
344
+ # @!attribute name
345
+ #
346
+ # @return [String, nil]
347
+ optional :name, String
348
+
349
+ # @!attribute netsuite_sales_order_id
350
+ # This field's availability is dependent on your client's configuration.
351
+ #
352
+ # @return [String, nil]
353
+ optional :netsuite_sales_order_id, String
354
+
355
+ # @!attribute priority
356
+ # If multiple credits or commits are applicable, the one with the lower priority
357
+ # will apply first.
358
+ #
359
+ # @return [Float, nil]
360
+ optional :priority, Float
361
+
362
+ # @!attribute rate_type
363
+ #
364
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::RateType, nil]
365
+ optional :rate_type,
366
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::RateType }
367
+
368
+ # @!attribute rollover_fraction
369
+ #
370
+ # @return [Float, nil]
371
+ optional :rollover_fraction, Float
372
+
373
+ # @!attribute salesforce_opportunity_id
374
+ # This field's availability is dependent on your client's configuration.
375
+ #
376
+ # @return [String, nil]
377
+ optional :salesforce_opportunity_id, String
378
+
379
+ # @!attribute specifiers
380
+ # List of filters that determine what kind of customer usage draws down a commit
381
+ # or credit. A customer's usage needs to meet the condition of at least one of the
382
+ # specifiers to contribute to a commit's or credit's drawdown. This field cannot
383
+ # be used together with `applicable_product_ids` or `applicable_product_tags`.
384
+ # Instead, to target usage by product or product tag, pass those values in the
385
+ # body of `specifiers`.
386
+ #
387
+ # @return [Array<MetronomeSDK::Models::CommitSpecifierInput>, nil]
388
+ optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifierInput] }
389
+
390
+ # @!method initialize(id:, product:, type:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, description: nil, hierarchy_configuration: nil, invoice_schedule: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, rollover_fraction: nil, salesforce_opportunity_id: nil, specifiers: nil)
391
+ # Some parameter documentations has been truncated, see
392
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit} for more
393
+ # details.
394
+ #
395
+ # @param id [String]
396
+ #
397
+ # @param product [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::Product]
398
+ #
399
+ # @param type [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::Type]
400
+ #
401
+ # @param access_schedule [MetronomeSDK::Models::ScheduleDuration] The schedule that the customer will gain access to the credits purposed with thi
402
+ #
403
+ # @param applicable_product_ids [Array<String>]
404
+ #
405
+ # @param applicable_product_tags [Array<String>]
406
+ #
407
+ # @param description [String]
408
+ #
409
+ # @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for commit hierarchy access control
410
+ #
411
+ # @param invoice_schedule [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::InvoiceSchedule] The schedule that the customer will be invoiced for this commit.
412
+ #
413
+ # @param name [String]
414
+ #
415
+ # @param netsuite_sales_order_id [String] This field's availability is dependent on your client's configuration.
416
+ #
417
+ # @param priority [Float] If multiple credits or commits are applicable, the one with the lower priority w
418
+ #
419
+ # @param rate_type [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::RateType]
420
+ #
421
+ # @param rollover_fraction [Float]
422
+ #
423
+ # @param salesforce_opportunity_id [String] This field's availability is dependent on your client's configuration.
424
+ #
425
+ # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifierInput>] List of filters that determine what kind of customer usage draws down a commit o
426
+
427
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit#product
428
+ class Product < MetronomeSDK::Internal::Type::BaseModel
429
+ # @!attribute id
430
+ #
431
+ # @return [String]
432
+ required :id, String
433
+
434
+ # @!attribute name
435
+ #
436
+ # @return [String]
437
+ required :name, String
438
+
439
+ # @!method initialize(id:, name:)
440
+ # @param id [String]
441
+ # @param name [String]
442
+ end
443
+
444
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit#type
445
+ module Type
446
+ extend MetronomeSDK::Internal::Type::Enum
447
+
448
+ PREPAID = :PREPAID
449
+ POSTPAID = :POSTPAID
450
+
451
+ # @!method self.values
452
+ # @return [Array<Symbol>]
453
+ end
454
+
455
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit#invoice_schedule
456
+ class InvoiceSchedule < MetronomeSDK::Internal::Type::BaseModel
457
+ # @!attribute credit_type
458
+ #
459
+ # @return [MetronomeSDK::Models::CreditTypeData, nil]
460
+ optional :credit_type, -> { MetronomeSDK::CreditTypeData }
461
+
462
+ # @!attribute do_not_invoice
463
+ # If true, this schedule will not generate an invoice.
464
+ #
465
+ # @return [Boolean, nil]
466
+ optional :do_not_invoice, MetronomeSDK::Internal::Type::Boolean
467
+
468
+ # @!attribute schedule_items
469
+ #
470
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::InvoiceSchedule::ScheduleItem>, nil]
471
+ optional :schedule_items,
472
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::InvoiceSchedule::ScheduleItem] }
473
+
474
+ # @!method initialize(credit_type: nil, do_not_invoice: nil, schedule_items: nil)
475
+ # The schedule that the customer will be invoiced for this commit.
476
+ #
477
+ # @param credit_type [MetronomeSDK::Models::CreditTypeData]
478
+ #
479
+ # @param do_not_invoice [Boolean] If true, this schedule will not generate an invoice.
480
+ #
481
+ # @param schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit::InvoiceSchedule::ScheduleItem>]
482
+
483
+ class ScheduleItem < MetronomeSDK::Internal::Type::BaseModel
484
+ # @!attribute id
485
+ #
486
+ # @return [String]
487
+ required :id, String
488
+
489
+ # @!attribute timestamp
490
+ #
491
+ # @return [Time]
492
+ required :timestamp, Time
493
+
494
+ # @!attribute amount
495
+ #
496
+ # @return [Float, nil]
497
+ optional :amount, Float
498
+
499
+ # @!attribute invoice_id
500
+ #
501
+ # @return [String, nil]
502
+ optional :invoice_id, String, nil?: true
503
+
504
+ # @!attribute quantity
505
+ #
506
+ # @return [Float, nil]
507
+ optional :quantity, Float
508
+
509
+ # @!attribute unit_price
510
+ #
511
+ # @return [Float, nil]
512
+ optional :unit_price, Float
513
+
514
+ # @!method initialize(id:, timestamp:, amount: nil, invoice_id: nil, quantity: nil, unit_price: nil)
515
+ # @param id [String]
516
+ # @param timestamp [Time]
517
+ # @param amount [Float]
518
+ # @param invoice_id [String, nil]
519
+ # @param quantity [Float]
520
+ # @param unit_price [Float]
521
+ end
522
+ end
523
+
524
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCommit#rate_type
525
+ module RateType
526
+ extend MetronomeSDK::Internal::Type::Enum
527
+
528
+ COMMIT_RATE = :COMMIT_RATE
529
+ LIST_RATE = :LIST_RATE
530
+
531
+ # @!method self.values
532
+ # @return [Array<Symbol>]
533
+ end
534
+ end
535
+
536
+ class AddCredit < MetronomeSDK::Internal::Type::BaseModel
537
+ # @!attribute id
538
+ #
539
+ # @return [String]
540
+ required :id, String
541
+
542
+ # @!attribute product
543
+ #
544
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit::Product]
545
+ required :product, -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit::Product }
546
+
547
+ # @!attribute type
548
+ #
549
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit::Type]
550
+ required :type, enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit::Type }
551
+
552
+ # @!attribute access_schedule
553
+ # The schedule that the customer will gain access to the credits.
554
+ #
555
+ # @return [MetronomeSDK::Models::ScheduleDuration, nil]
556
+ optional :access_schedule, -> { MetronomeSDK::ScheduleDuration }
557
+
558
+ # @!attribute applicable_product_ids
559
+ #
560
+ # @return [Array<String>, nil]
561
+ optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
562
+
563
+ # @!attribute applicable_product_tags
564
+ #
565
+ # @return [Array<String>, nil]
566
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
567
+
568
+ # @!attribute description
569
+ #
570
+ # @return [String, nil]
571
+ optional :description, String
572
+
573
+ # @!attribute hierarchy_configuration
574
+ # Optional configuration for recurring credit hierarchy access control
575
+ #
576
+ # @return [MetronomeSDK::Models::CommitHierarchyConfiguration, nil]
577
+ optional :hierarchy_configuration, -> { MetronomeSDK::CommitHierarchyConfiguration }
578
+
579
+ # @!attribute name
580
+ #
581
+ # @return [String, nil]
582
+ optional :name, String
583
+
584
+ # @!attribute netsuite_sales_order_id
585
+ # This field's availability is dependent on your client's configuration.
586
+ #
587
+ # @return [String, nil]
588
+ optional :netsuite_sales_order_id, String
589
+
590
+ # @!attribute priority
591
+ # If multiple credits or commits are applicable, the one with the lower priority
592
+ # will apply first.
593
+ #
594
+ # @return [Float, nil]
595
+ optional :priority, Float
596
+
597
+ # @!attribute rate_type
598
+ #
599
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit::RateType, nil]
600
+ optional :rate_type,
601
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit::RateType }
602
+
603
+ # @!attribute rollover_fraction
604
+ #
605
+ # @return [Float, nil]
606
+ optional :rollover_fraction, Float
607
+
608
+ # @!attribute salesforce_opportunity_id
609
+ # This field's availability is dependent on your client's configuration.
610
+ #
611
+ # @return [String, nil]
612
+ optional :salesforce_opportunity_id, String
613
+
614
+ # @!attribute specifiers
615
+ # List of filters that determine what kind of customer usage draws down a commit
616
+ # or credit. A customer's usage needs to meet the condition of at least one of the
617
+ # specifiers to contribute to a commit's or credit's drawdown. This field cannot
618
+ # be used together with `applicable_product_ids` or `applicable_product_tags`.
619
+ # Instead, to target usage by product or product tag, pass those values in the
620
+ # body of `specifiers`.
621
+ #
622
+ # @return [Array<MetronomeSDK::Models::CommitSpecifierInput>, nil]
623
+ optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifierInput] }
624
+
625
+ # @!method initialize(id:, product:, type:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, description: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, rollover_fraction: nil, salesforce_opportunity_id: nil, specifiers: nil)
626
+ # Some parameter documentations has been truncated, see
627
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit} for more
628
+ # details.
629
+ #
630
+ # @param id [String]
631
+ #
632
+ # @param product [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit::Product]
633
+ #
634
+ # @param type [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit::Type]
635
+ #
636
+ # @param access_schedule [MetronomeSDK::Models::ScheduleDuration] The schedule that the customer will gain access to the credits.
637
+ #
638
+ # @param applicable_product_ids [Array<String>]
639
+ #
640
+ # @param applicable_product_tags [Array<String>]
641
+ #
642
+ # @param description [String]
643
+ #
644
+ # @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for recurring credit hierarchy access control
645
+ #
646
+ # @param name [String]
647
+ #
648
+ # @param netsuite_sales_order_id [String] This field's availability is dependent on your client's configuration.
649
+ #
650
+ # @param priority [Float] If multiple credits or commits are applicable, the one with the lower priority w
651
+ #
652
+ # @param rate_type [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit::RateType]
653
+ #
654
+ # @param rollover_fraction [Float]
655
+ #
656
+ # @param salesforce_opportunity_id [String] This field's availability is dependent on your client's configuration.
657
+ #
658
+ # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifierInput>] List of filters that determine what kind of customer usage draws down a commit o
659
+
660
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit#product
661
+ class Product < MetronomeSDK::Internal::Type::BaseModel
662
+ # @!attribute id
663
+ #
664
+ # @return [String]
665
+ required :id, String
666
+
667
+ # @!attribute name
668
+ #
669
+ # @return [String]
670
+ required :name, String
671
+
672
+ # @!method initialize(id:, name:)
673
+ # @param id [String]
674
+ # @param name [String]
675
+ end
676
+
677
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit#type
678
+ module Type
679
+ extend MetronomeSDK::Internal::Type::Enum
680
+
681
+ CREDIT = :CREDIT
682
+
683
+ # @!method self.values
684
+ # @return [Array<Symbol>]
685
+ end
686
+
687
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddCredit#rate_type
688
+ module RateType
689
+ extend MetronomeSDK::Internal::Type::Enum
690
+
691
+ COMMIT_RATE = :COMMIT_RATE
692
+ LIST_RATE = :LIST_RATE
693
+
694
+ # @!method self.values
695
+ # @return [Array<Symbol>]
696
+ end
697
+ end
698
+
699
+ class AddOverride < MetronomeSDK::Internal::Type::BaseModel
700
+ # @!attribute id
701
+ #
702
+ # @return [String]
703
+ required :id, String
704
+
705
+ # @!attribute created_at
706
+ #
707
+ # @return [Time]
708
+ required :created_at, Time
709
+
710
+ # @!attribute starting_at
711
+ #
712
+ # @return [Time]
713
+ required :starting_at, Time
714
+
715
+ # @!attribute applicable_product_tags
716
+ #
717
+ # @return [Array<String>, nil]
718
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
719
+
720
+ # @!attribute ending_before
721
+ #
722
+ # @return [Time, nil]
723
+ optional :ending_before, Time
724
+
725
+ # @!attribute entitled
726
+ #
727
+ # @return [Boolean, nil]
728
+ optional :entitled, MetronomeSDK::Internal::Type::Boolean
729
+
730
+ # @!attribute is_commit_specific
731
+ #
732
+ # @return [Boolean, nil]
733
+ optional :is_commit_specific, MetronomeSDK::Internal::Type::Boolean
734
+
735
+ # @!attribute multiplier
736
+ #
737
+ # @return [Float, nil]
738
+ optional :multiplier, Float
739
+
740
+ # @!attribute override_specifiers
741
+ #
742
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverrideSpecifier>, nil]
743
+ optional :override_specifiers,
744
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverrideSpecifier] }
745
+
746
+ # @!attribute override_tiers
747
+ #
748
+ # @return [Array<MetronomeSDK::Models::OverrideTier>, nil]
749
+ optional :override_tiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::OverrideTier] }
750
+
751
+ # @!attribute overwrite_rate
752
+ #
753
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverwriteRate, nil]
754
+ optional :overwrite_rate,
755
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverwriteRate }
756
+
757
+ # @!attribute priority
758
+ #
759
+ # @return [Float, nil]
760
+ optional :priority, Float
761
+
762
+ # @!attribute product
763
+ #
764
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::Product, nil]
765
+ optional :product, -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::Product }
766
+
767
+ # @!attribute target
768
+ #
769
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::Target, nil]
770
+ optional :target,
771
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::Target }
772
+
773
+ # @!attribute type
774
+ #
775
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::Type, nil]
776
+ optional :type, enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::Type }
777
+
778
+ # @!method initialize(id:, created_at:, starting_at:, applicable_product_tags: nil, ending_before: nil, entitled: nil, is_commit_specific: nil, multiplier: nil, override_specifiers: nil, override_tiers: nil, overwrite_rate: nil, priority: nil, product: nil, target: nil, type: nil)
779
+ # @param id [String]
780
+ # @param created_at [Time]
781
+ # @param starting_at [Time]
782
+ # @param applicable_product_tags [Array<String>]
783
+ # @param ending_before [Time]
784
+ # @param entitled [Boolean]
785
+ # @param is_commit_specific [Boolean]
786
+ # @param multiplier [Float]
787
+ # @param override_specifiers [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverrideSpecifier>]
788
+ # @param override_tiers [Array<MetronomeSDK::Models::OverrideTier>]
789
+ # @param overwrite_rate [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverwriteRate]
790
+ # @param priority [Float]
791
+ # @param product [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::Product]
792
+ # @param target [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::Target]
793
+ # @param type [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::Type]
794
+
795
+ class OverrideSpecifier < MetronomeSDK::Internal::Type::BaseModel
796
+ # @!attribute any_commit_or_credit_ids
797
+ #
798
+ # @return [Array<String>, nil]
799
+ optional :any_commit_or_credit_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
800
+
801
+ # @!attribute billing_frequency
802
+ #
803
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverrideSpecifier::BillingFrequency, nil]
804
+ optional :billing_frequency,
805
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverrideSpecifier::BillingFrequency }
806
+
807
+ # @!attribute commit_ids
808
+ #
809
+ # @return [Array<String>, nil]
810
+ optional :commit_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
811
+
812
+ # @!attribute presentation_group_values
813
+ #
814
+ # @return [Hash{Symbol=>String, nil}, nil]
815
+ optional :presentation_group_values, MetronomeSDK::Internal::Type::HashOf[String, nil?: true]
816
+
817
+ # @!attribute pricing_group_values
818
+ #
819
+ # @return [Hash{Symbol=>String}, nil]
820
+ optional :pricing_group_values, MetronomeSDK::Internal::Type::HashOf[String]
821
+
822
+ # @!attribute product_id
823
+ #
824
+ # @return [String, nil]
825
+ optional :product_id, String
826
+
827
+ # @!attribute product_tags
828
+ #
829
+ # @return [Array<String>, nil]
830
+ optional :product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
831
+
832
+ # @!attribute recurring_commit_ids
833
+ #
834
+ # @return [Array<String>, nil]
835
+ optional :recurring_commit_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
836
+
837
+ # @!method initialize(any_commit_or_credit_ids: nil, billing_frequency: nil, commit_ids: nil, presentation_group_values: nil, pricing_group_values: nil, product_id: nil, product_tags: nil, recurring_commit_ids: nil)
838
+ # @param any_commit_or_credit_ids [Array<String>]
839
+ # @param billing_frequency [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverrideSpecifier::BillingFrequency]
840
+ # @param commit_ids [Array<String>]
841
+ # @param presentation_group_values [Hash{Symbol=>String, nil}]
842
+ # @param pricing_group_values [Hash{Symbol=>String}]
843
+ # @param product_id [String]
844
+ # @param product_tags [Array<String>]
845
+ # @param recurring_commit_ids [Array<String>]
846
+
847
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverrideSpecifier#billing_frequency
848
+ module BillingFrequency
849
+ extend MetronomeSDK::Internal::Type::Enum
850
+
851
+ MONTHLY = :MONTHLY
852
+ QUARTERLY = :QUARTERLY
853
+ ANNUAL = :ANNUAL
854
+ WEEKLY = :WEEKLY
855
+
856
+ # @!method self.values
857
+ # @return [Array<Symbol>]
858
+ end
859
+ end
860
+
861
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride#overwrite_rate
862
+ class OverwriteRate < MetronomeSDK::Internal::Type::BaseModel
863
+ # @!attribute rate_type
864
+ #
865
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverwriteRate::RateType]
866
+ required :rate_type,
867
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverwriteRate::RateType }
868
+
869
+ # @!attribute credit_type
870
+ #
871
+ # @return [MetronomeSDK::Models::CreditTypeData, nil]
872
+ optional :credit_type, -> { MetronomeSDK::CreditTypeData }
873
+
874
+ # @!attribute custom_rate
875
+ # Only set for CUSTOM rate_type. This field is interpreted by custom rate
876
+ # processors.
877
+ #
878
+ # @return [Hash{Symbol=>Object}, nil]
879
+ optional :custom_rate, MetronomeSDK::Internal::Type::HashOf[MetronomeSDK::Internal::Type::Unknown]
880
+
881
+ # @!attribute is_prorated
882
+ # Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
883
+ # set to true.
884
+ #
885
+ # @return [Boolean, nil]
886
+ optional :is_prorated, MetronomeSDK::Internal::Type::Boolean
887
+
888
+ # @!attribute price
889
+ # Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
890
+ # this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
891
+ #
892
+ # @return [Float, nil]
893
+ optional :price, Float
894
+
895
+ # @!attribute quantity
896
+ # Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
897
+ #
898
+ # @return [Float, nil]
899
+ optional :quantity, Float
900
+
901
+ # @!attribute tiers
902
+ # Only set for TIERED rate_type.
903
+ #
904
+ # @return [Array<MetronomeSDK::Models::Tier>, nil]
905
+ optional :tiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Tier] }
906
+
907
+ # @!method initialize(rate_type:, credit_type: nil, custom_rate: nil, is_prorated: nil, price: nil, quantity: nil, tiers: nil)
908
+ # Some parameter documentations has been truncated, see
909
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverwriteRate}
910
+ # for more details.
911
+ #
912
+ # @param rate_type [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverwriteRate::RateType]
913
+ #
914
+ # @param credit_type [MetronomeSDK::Models::CreditTypeData]
915
+ #
916
+ # @param custom_rate [Hash{Symbol=>Object}] Only set for CUSTOM rate_type. This field is interpreted by custom rate processo
917
+ #
918
+ # @param is_prorated [Boolean] Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
919
+ #
920
+ # @param price [Float] Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, t
921
+ #
922
+ # @param quantity [Float] Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
923
+ #
924
+ # @param tiers [Array<MetronomeSDK::Models::Tier>] Only set for TIERED rate_type.
925
+
926
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride::OverwriteRate#rate_type
927
+ module RateType
928
+ extend MetronomeSDK::Internal::Type::Enum
929
+
930
+ FLAT = :FLAT
931
+ PERCENTAGE = :PERCENTAGE
932
+ SUBSCRIPTION = :SUBSCRIPTION
933
+ TIERED = :TIERED
934
+ TIERED_PERCENTAGE = :TIERED_PERCENTAGE
935
+ CUSTOM = :CUSTOM
936
+
937
+ # @!method self.values
938
+ # @return [Array<Symbol>]
939
+ end
940
+ end
941
+
942
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride#product
943
+ class Product < MetronomeSDK::Internal::Type::BaseModel
944
+ # @!attribute id
945
+ #
946
+ # @return [String]
947
+ required :id, String
948
+
949
+ # @!attribute name
950
+ #
951
+ # @return [String]
952
+ required :name, String
953
+
954
+ # @!method initialize(id:, name:)
955
+ # @param id [String]
956
+ # @param name [String]
957
+ end
958
+
959
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride#target
960
+ module Target
961
+ extend MetronomeSDK::Internal::Type::Enum
962
+
963
+ COMMIT_RATE = :COMMIT_RATE
964
+ LIST_RATE = :LIST_RATE
965
+
966
+ # @!method self.values
967
+ # @return [Array<Symbol>]
968
+ end
969
+
970
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddOverride#type
971
+ module Type
972
+ extend MetronomeSDK::Internal::Type::Enum
973
+
974
+ OVERWRITE = :OVERWRITE
975
+ MULTIPLIER = :MULTIPLIER
976
+ TIERED = :TIERED
977
+
978
+ # @!method self.values
979
+ # @return [Array<Symbol>]
980
+ end
981
+ end
982
+
983
+ class AddRecurringCommit < MetronomeSDK::Internal::Type::BaseModel
984
+ # @!attribute id
985
+ #
986
+ # @return [String]
987
+ required :id, String
988
+
989
+ # @!attribute access_amount
990
+ # The amount of commit to grant.
991
+ #
992
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::AccessAmount]
993
+ required :access_amount,
994
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::AccessAmount }
995
+
996
+ # @!attribute commit_duration
997
+ # The amount of time the created commits will be valid for
998
+ #
999
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::CommitDuration]
1000
+ required :commit_duration,
1001
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::CommitDuration }
1002
+
1003
+ # @!attribute priority
1004
+ # Will be passed down to the individual commits
1005
+ #
1006
+ # @return [Float]
1007
+ required :priority, Float
1008
+
1009
+ # @!attribute product
1010
+ #
1011
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::Product]
1012
+ required :product,
1013
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::Product }
1014
+
1015
+ # @!attribute rate_type
1016
+ # Whether the created commits will use the commit rate or list rate
1017
+ #
1018
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::RateType]
1019
+ required :rate_type,
1020
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::RateType }
1021
+
1022
+ # @!attribute starting_at
1023
+ # Determines the start time for the first commit
1024
+ #
1025
+ # @return [Time]
1026
+ required :starting_at, Time
1027
+
1028
+ # @!attribute applicable_product_ids
1029
+ # Will be passed down to the individual commits
1030
+ #
1031
+ # @return [Array<String>, nil]
1032
+ optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
1033
+
1034
+ # @!attribute applicable_product_tags
1035
+ # Will be passed down to the individual commits
1036
+ #
1037
+ # @return [Array<String>, nil]
1038
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
1039
+
1040
+ # @!attribute contract
1041
+ #
1042
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::Contract, nil]
1043
+ optional :contract,
1044
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::Contract }
1045
+
1046
+ # @!attribute description
1047
+ # Will be passed down to the individual commits
1048
+ #
1049
+ # @return [String, nil]
1050
+ optional :description, String
1051
+
1052
+ # @!attribute ending_before
1053
+ # Determines when the contract will stop creating recurring commits. Optional
1054
+ #
1055
+ # @return [Time, nil]
1056
+ optional :ending_before, Time
1057
+
1058
+ # @!attribute hierarchy_configuration
1059
+ # Optional configuration for recurring credit hierarchy access control
1060
+ #
1061
+ # @return [MetronomeSDK::Models::CommitHierarchyConfiguration, nil]
1062
+ optional :hierarchy_configuration, -> { MetronomeSDK::CommitHierarchyConfiguration }
1063
+
1064
+ # @!attribute invoice_amount
1065
+ # The amount the customer should be billed for the commit. Not required.
1066
+ #
1067
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::InvoiceAmount, nil]
1068
+ optional :invoice_amount,
1069
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::InvoiceAmount }
1070
+
1071
+ # @!attribute name
1072
+ # Displayed on invoices. Will be passed through to the individual commits
1073
+ #
1074
+ # @return [String, nil]
1075
+ optional :name, String
1076
+
1077
+ # @!attribute netsuite_sales_order_id
1078
+ # Will be passed down to the individual commits
1079
+ #
1080
+ # @return [String, nil]
1081
+ optional :netsuite_sales_order_id, String
1082
+
1083
+ # @!attribute proration
1084
+ # Determines whether the first and last commit will be prorated. If not provided,
1085
+ # the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1086
+ #
1087
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::Proration, nil]
1088
+ optional :proration,
1089
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::Proration }
1090
+
1091
+ # @!attribute proration_rounding
1092
+ # Rounding configuration for prorated recurring commit amounts.
1093
+ #
1094
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding, nil]
1095
+ optional :proration_rounding,
1096
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding },
1097
+ nil?: true
1098
+
1099
+ # @!attribute recurrence_frequency
1100
+ # The frequency at which the recurring commits will be created. If not provided: -
1101
+ # The commits will be created on the usage invoice frequency. If provided: - The
1102
+ # period defined in the duration will correspond to this frequency. - Commits will
1103
+ # be created aligned with the recurring commit's starting_at rather than the usage
1104
+ # invoice dates.
1105
+ #
1106
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::RecurrenceFrequency, nil]
1107
+ optional :recurrence_frequency,
1108
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::RecurrenceFrequency }
1109
+
1110
+ # @!attribute rollover_fraction
1111
+ # Will be passed down to the individual commits. This controls how much of an
1112
+ # individual unexpired commit will roll over upon contract transition. Must be
1113
+ # between 0 and 1.
1114
+ #
1115
+ # @return [Float, nil]
1116
+ optional :rollover_fraction, Float
1117
+
1118
+ # @!attribute specifiers
1119
+ # List of filters that determine what kind of customer usage draws down a commit
1120
+ # or credit. A customer's usage needs to meet the condition of at least one of the
1121
+ # specifiers to contribute to a commit's or credit's drawdown.
1122
+ #
1123
+ # @return [Array<MetronomeSDK::Models::CommitSpecifier>, nil]
1124
+ optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifier] }
1125
+
1126
+ # @!attribute subscription_config
1127
+ # Attach a subscription to the recurring commit/credit.
1128
+ #
1129
+ # @return [MetronomeSDK::Models::RecurringCommitSubscriptionConfig, nil]
1130
+ optional :subscription_config, -> { MetronomeSDK::RecurringCommitSubscriptionConfig }
1131
+
1132
+ # @!method initialize(id:, access_amount:, commit_duration:, priority:, product:, rate_type:, starting_at:, applicable_product_ids: nil, applicable_product_tags: nil, contract: nil, description: nil, ending_before: nil, hierarchy_configuration: nil, invoice_amount: nil, name: nil, netsuite_sales_order_id: nil, proration: nil, proration_rounding: nil, recurrence_frequency: nil, rollover_fraction: nil, specifiers: nil, subscription_config: nil)
1133
+ # Some parameter documentations has been truncated, see
1134
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit}
1135
+ # for more details.
1136
+ #
1137
+ # @param id [String]
1138
+ #
1139
+ # @param access_amount [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::AccessAmount] The amount of commit to grant.
1140
+ #
1141
+ # @param commit_duration [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::CommitDuration] The amount of time the created commits will be valid for
1142
+ #
1143
+ # @param priority [Float] Will be passed down to the individual commits
1144
+ #
1145
+ # @param product [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::Product]
1146
+ #
1147
+ # @param rate_type [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::RateType] Whether the created commits will use the commit rate or list rate
1148
+ #
1149
+ # @param starting_at [Time] Determines the start time for the first commit
1150
+ #
1151
+ # @param applicable_product_ids [Array<String>] Will be passed down to the individual commits
1152
+ #
1153
+ # @param applicable_product_tags [Array<String>] Will be passed down to the individual commits
1154
+ #
1155
+ # @param contract [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::Contract]
1156
+ #
1157
+ # @param description [String] Will be passed down to the individual commits
1158
+ #
1159
+ # @param ending_before [Time] Determines when the contract will stop creating recurring commits. Optional
1160
+ #
1161
+ # @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for recurring credit hierarchy access control
1162
+ #
1163
+ # @param invoice_amount [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::InvoiceAmount] The amount the customer should be billed for the commit. Not required.
1164
+ #
1165
+ # @param name [String] Displayed on invoices. Will be passed through to the individual commits
1166
+ #
1167
+ # @param netsuite_sales_order_id [String] Will be passed down to the individual commits
1168
+ #
1169
+ # @param proration [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::Proration] Determines whether the first and last commit will be prorated. If not provided,
1170
+ #
1171
+ # @param proration_rounding [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding, nil] Rounding configuration for prorated recurring commit amounts.
1172
+ #
1173
+ # @param recurrence_frequency [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::RecurrenceFrequency] The frequency at which the recurring commits will be created. If not provided: -
1174
+ #
1175
+ # @param rollover_fraction [Float] Will be passed down to the individual commits. This controls how much of an indi
1176
+ #
1177
+ # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifier>] List of filters that determine what kind of customer usage draws down a commit o
1178
+ #
1179
+ # @param subscription_config [MetronomeSDK::Models::RecurringCommitSubscriptionConfig] Attach a subscription to the recurring commit/credit.
1180
+
1181
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit#access_amount
1182
+ class AccessAmount < MetronomeSDK::Internal::Type::BaseModel
1183
+ # @!attribute credit_type_id
1184
+ #
1185
+ # @return [String]
1186
+ required :credit_type_id, String
1187
+
1188
+ # @!attribute unit_price
1189
+ #
1190
+ # @return [Float]
1191
+ required :unit_price, Float
1192
+
1193
+ # @!attribute quantity
1194
+ #
1195
+ # @return [Float, nil]
1196
+ optional :quantity, Float
1197
+
1198
+ # @!method initialize(credit_type_id:, unit_price:, quantity: nil)
1199
+ # The amount of commit to grant.
1200
+ #
1201
+ # @param credit_type_id [String]
1202
+ # @param unit_price [Float]
1203
+ # @param quantity [Float]
1204
+ end
1205
+
1206
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit#commit_duration
1207
+ class CommitDuration < MetronomeSDK::Internal::Type::BaseModel
1208
+ # @!attribute value
1209
+ #
1210
+ # @return [Float]
1211
+ required :value, Float
1212
+
1213
+ # @!attribute unit
1214
+ #
1215
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::CommitDuration::Unit, nil]
1216
+ optional :unit,
1217
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::CommitDuration::Unit }
1218
+
1219
+ # @!method initialize(value:, unit: nil)
1220
+ # The amount of time the created commits will be valid for
1221
+ #
1222
+ # @param value [Float]
1223
+ # @param unit [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::CommitDuration::Unit]
1224
+
1225
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::CommitDuration#unit
1226
+ module Unit
1227
+ extend MetronomeSDK::Internal::Type::Enum
1228
+
1229
+ PERIODS = :PERIODS
1230
+
1231
+ # @!method self.values
1232
+ # @return [Array<Symbol>]
1233
+ end
1234
+ end
1235
+
1236
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit#product
1237
+ class Product < MetronomeSDK::Internal::Type::BaseModel
1238
+ # @!attribute id
1239
+ #
1240
+ # @return [String]
1241
+ required :id, String
1242
+
1243
+ # @!attribute name
1244
+ #
1245
+ # @return [String]
1246
+ required :name, String
1247
+
1248
+ # @!method initialize(id:, name:)
1249
+ # @param id [String]
1250
+ # @param name [String]
1251
+ end
1252
+
1253
+ # Whether the created commits will use the commit rate or list rate
1254
+ #
1255
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit#rate_type
1256
+ module RateType
1257
+ extend MetronomeSDK::Internal::Type::Enum
1258
+
1259
+ COMMIT_RATE = :COMMIT_RATE
1260
+ LIST_RATE = :LIST_RATE
1261
+
1262
+ # @!method self.values
1263
+ # @return [Array<Symbol>]
1264
+ end
1265
+
1266
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit#contract
1267
+ class Contract < MetronomeSDK::Internal::Type::BaseModel
1268
+ # @!attribute id
1269
+ #
1270
+ # @return [String]
1271
+ required :id, String
1272
+
1273
+ # @!method initialize(id:)
1274
+ # @param id [String]
1275
+ end
1276
+
1277
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit#invoice_amount
1278
+ class InvoiceAmount < MetronomeSDK::Internal::Type::BaseModel
1279
+ # @!attribute credit_type_id
1280
+ #
1281
+ # @return [String]
1282
+ required :credit_type_id, String
1283
+
1284
+ # @!attribute quantity
1285
+ #
1286
+ # @return [Float]
1287
+ required :quantity, Float
1288
+
1289
+ # @!attribute unit_price
1290
+ #
1291
+ # @return [Float]
1292
+ required :unit_price, Float
1293
+
1294
+ # @!method initialize(credit_type_id:, quantity:, unit_price:)
1295
+ # The amount the customer should be billed for the commit. Not required.
1296
+ #
1297
+ # @param credit_type_id [String]
1298
+ # @param quantity [Float]
1299
+ # @param unit_price [Float]
1300
+ end
1301
+
1302
+ # Determines whether the first and last commit will be prorated. If not provided,
1303
+ # the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1304
+ #
1305
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit#proration
1306
+ module Proration
1307
+ extend MetronomeSDK::Internal::Type::Enum
1308
+
1309
+ NONE = :NONE
1310
+ FIRST = :FIRST
1311
+ LAST = :LAST
1312
+ FIRST_AND_LAST = :FIRST_AND_LAST
1313
+
1314
+ # @!method self.values
1315
+ # @return [Array<Symbol>]
1316
+ end
1317
+
1318
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit#proration_rounding
1319
+ class ProrationRounding < MetronomeSDK::Internal::Type::BaseModel
1320
+ # @!attribute access
1321
+ #
1322
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Access, nil]
1323
+ optional :access,
1324
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Access }
1325
+
1326
+ # @!attribute invoice
1327
+ #
1328
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Invoice, nil]
1329
+ optional :invoice,
1330
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Invoice }
1331
+
1332
+ # @!method initialize(access: nil, invoice: nil)
1333
+ # Rounding configuration for prorated recurring commit amounts.
1334
+ #
1335
+ # @param access [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Access]
1336
+ # @param invoice [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Invoice]
1337
+
1338
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding#access
1339
+ class Access < MetronomeSDK::Internal::Type::BaseModel
1340
+ # @!attribute decimal_places
1341
+ # Number of decimal places to round to. Applied directly to the stored monetary
1342
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
1343
+ # nearest 100 in the stored unit).
1344
+ #
1345
+ # @return [Float]
1346
+ required :decimal_places, Float
1347
+
1348
+ # @!attribute rounding_method
1349
+ #
1350
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Access::RoundingMethod]
1351
+ required :rounding_method,
1352
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Access::RoundingMethod }
1353
+
1354
+ # @!method initialize(decimal_places:, rounding_method:)
1355
+ # Some parameter documentations has been truncated, see
1356
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Access}
1357
+ # for more details.
1358
+ #
1359
+ # @param decimal_places [Float] Number of decimal places to round to. Applied directly to the stored monetary re
1360
+ #
1361
+ # @param rounding_method [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Access::RoundingMethod]
1362
+
1363
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Access#rounding_method
1364
+ module RoundingMethod
1365
+ extend MetronomeSDK::Internal::Type::Enum
1366
+
1367
+ HALF_UP = :HALF_UP
1368
+ FLOOR = :FLOOR
1369
+ CEILING = :CEILING
1370
+
1371
+ # @!method self.values
1372
+ # @return [Array<Symbol>]
1373
+ end
1374
+ end
1375
+
1376
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding#invoice
1377
+ class Invoice < MetronomeSDK::Internal::Type::BaseModel
1378
+ # @!attribute decimal_places
1379
+ # Number of decimal places to round to. Applied directly to the stored monetary
1380
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
1381
+ # nearest 100 in the stored unit).
1382
+ #
1383
+ # @return [Float]
1384
+ required :decimal_places, Float
1385
+
1386
+ # @!attribute rounding_method
1387
+ #
1388
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Invoice::RoundingMethod]
1389
+ required :rounding_method,
1390
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Invoice::RoundingMethod }
1391
+
1392
+ # @!method initialize(decimal_places:, rounding_method:)
1393
+ # Some parameter documentations has been truncated, see
1394
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Invoice}
1395
+ # for more details.
1396
+ #
1397
+ # @param decimal_places [Float] Number of decimal places to round to. Applied directly to the stored monetary re
1398
+ #
1399
+ # @param rounding_method [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Invoice::RoundingMethod]
1400
+
1401
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit::ProrationRounding::Invoice#rounding_method
1402
+ module RoundingMethod
1403
+ extend MetronomeSDK::Internal::Type::Enum
1404
+
1405
+ HALF_UP = :HALF_UP
1406
+ FLOOR = :FLOOR
1407
+ CEILING = :CEILING
1408
+
1409
+ # @!method self.values
1410
+ # @return [Array<Symbol>]
1411
+ end
1412
+ end
1413
+ end
1414
+
1415
+ # The frequency at which the recurring commits will be created. If not provided: -
1416
+ # The commits will be created on the usage invoice frequency. If provided: - The
1417
+ # period defined in the duration will correspond to this frequency. - Commits will
1418
+ # be created aligned with the recurring commit's starting_at rather than the usage
1419
+ # invoice dates.
1420
+ #
1421
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCommit#recurrence_frequency
1422
+ module RecurrenceFrequency
1423
+ extend MetronomeSDK::Internal::Type::Enum
1424
+
1425
+ MONTHLY = :MONTHLY
1426
+ QUARTERLY = :QUARTERLY
1427
+ ANNUAL = :ANNUAL
1428
+ WEEKLY = :WEEKLY
1429
+ DAILY = :DAILY
1430
+
1431
+ # @!method self.values
1432
+ # @return [Array<Symbol>]
1433
+ end
1434
+ end
1435
+
1436
+ class AddRecurringCredit < MetronomeSDK::Internal::Type::BaseModel
1437
+ # @!attribute id
1438
+ #
1439
+ # @return [String]
1440
+ required :id, String
1441
+
1442
+ # @!attribute access_amount
1443
+ # The amount of commit to grant.
1444
+ #
1445
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::AccessAmount]
1446
+ required :access_amount,
1447
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::AccessAmount }
1448
+
1449
+ # @!attribute commit_duration
1450
+ # The amount of time the created commits will be valid for
1451
+ #
1452
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::CommitDuration]
1453
+ required :commit_duration,
1454
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::CommitDuration }
1455
+
1456
+ # @!attribute priority
1457
+ # Will be passed down to the individual commits
1458
+ #
1459
+ # @return [Float]
1460
+ required :priority, Float
1461
+
1462
+ # @!attribute product
1463
+ #
1464
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::Product]
1465
+ required :product,
1466
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::Product }
1467
+
1468
+ # @!attribute rate_type
1469
+ # Whether the created commits will use the commit rate or list rate
1470
+ #
1471
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::RateType]
1472
+ required :rate_type,
1473
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::RateType }
1474
+
1475
+ # @!attribute starting_at
1476
+ # Determines the start time for the first commit
1477
+ #
1478
+ # @return [Time]
1479
+ required :starting_at, Time
1480
+
1481
+ # @!attribute applicable_product_ids
1482
+ # Will be passed down to the individual commits
1483
+ #
1484
+ # @return [Array<String>, nil]
1485
+ optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
1486
+
1487
+ # @!attribute applicable_product_tags
1488
+ # Will be passed down to the individual commits
1489
+ #
1490
+ # @return [Array<String>, nil]
1491
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
1492
+
1493
+ # @!attribute contract
1494
+ #
1495
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::Contract, nil]
1496
+ optional :contract,
1497
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::Contract }
1498
+
1499
+ # @!attribute description
1500
+ # Will be passed down to the individual commits
1501
+ #
1502
+ # @return [String, nil]
1503
+ optional :description, String
1504
+
1505
+ # @!attribute ending_before
1506
+ # Determines when the contract will stop creating recurring commits. Optional
1507
+ #
1508
+ # @return [Time, nil]
1509
+ optional :ending_before, Time
1510
+
1511
+ # @!attribute hierarchy_configuration
1512
+ # Optional configuration for recurring credit hierarchy access control
1513
+ #
1514
+ # @return [MetronomeSDK::Models::CommitHierarchyConfiguration, nil]
1515
+ optional :hierarchy_configuration, -> { MetronomeSDK::CommitHierarchyConfiguration }
1516
+
1517
+ # @!attribute name
1518
+ # Displayed on invoices. Will be passed through to the individual commits
1519
+ #
1520
+ # @return [String, nil]
1521
+ optional :name, String
1522
+
1523
+ # @!attribute netsuite_sales_order_id
1524
+ # Will be passed down to the individual commits
1525
+ #
1526
+ # @return [String, nil]
1527
+ optional :netsuite_sales_order_id, String
1528
+
1529
+ # @!attribute proration
1530
+ # Determines whether the first and last commit will be prorated. If not provided,
1531
+ # the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1532
+ #
1533
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::Proration, nil]
1534
+ optional :proration,
1535
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::Proration }
1536
+
1537
+ # @!attribute proration_rounding
1538
+ # Rounding configuration for prorated recurring credit amounts.
1539
+ #
1540
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::ProrationRounding, nil]
1541
+ optional :proration_rounding,
1542
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::ProrationRounding },
1543
+ nil?: true
1544
+
1545
+ # @!attribute recurrence_frequency
1546
+ # The frequency at which the recurring commits will be created. If not provided: -
1547
+ # The commits will be created on the usage invoice frequency. If provided: - The
1548
+ # period defined in the duration will correspond to this frequency. - Commits will
1549
+ # be created aligned with the recurring commit's starting_at rather than the usage
1550
+ # invoice dates.
1551
+ #
1552
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::RecurrenceFrequency, nil]
1553
+ optional :recurrence_frequency,
1554
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::RecurrenceFrequency }
1555
+
1556
+ # @!attribute rollover_fraction
1557
+ # Will be passed down to the individual commits. This controls how much of an
1558
+ # individual unexpired commit will roll over upon contract transition. Must be
1559
+ # between 0 and 1.
1560
+ #
1561
+ # @return [Float, nil]
1562
+ optional :rollover_fraction, Float
1563
+
1564
+ # @!attribute specifiers
1565
+ # List of filters that determine what kind of customer usage draws down a commit
1566
+ # or credit. A customer's usage needs to meet the condition of at least one of the
1567
+ # specifiers to contribute to a commit's or credit's drawdown.
1568
+ #
1569
+ # @return [Array<MetronomeSDK::Models::CommitSpecifier>, nil]
1570
+ optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifier] }
1571
+
1572
+ # @!attribute subscription_config
1573
+ # Attach a subscription to the recurring commit/credit.
1574
+ #
1575
+ # @return [MetronomeSDK::Models::RecurringCommitSubscriptionConfig, nil]
1576
+ optional :subscription_config, -> { MetronomeSDK::RecurringCommitSubscriptionConfig }
1577
+
1578
+ # @!method initialize(id:, access_amount:, commit_duration:, priority:, product:, rate_type:, starting_at:, applicable_product_ids: nil, applicable_product_tags: nil, contract: nil, description: nil, ending_before: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, proration: nil, proration_rounding: nil, recurrence_frequency: nil, rollover_fraction: nil, specifiers: nil, subscription_config: nil)
1579
+ # Some parameter documentations has been truncated, see
1580
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit}
1581
+ # for more details.
1582
+ #
1583
+ # @param id [String]
1584
+ #
1585
+ # @param access_amount [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::AccessAmount] The amount of commit to grant.
1586
+ #
1587
+ # @param commit_duration [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::CommitDuration] The amount of time the created commits will be valid for
1588
+ #
1589
+ # @param priority [Float] Will be passed down to the individual commits
1590
+ #
1591
+ # @param product [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::Product]
1592
+ #
1593
+ # @param rate_type [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::RateType] Whether the created commits will use the commit rate or list rate
1594
+ #
1595
+ # @param starting_at [Time] Determines the start time for the first commit
1596
+ #
1597
+ # @param applicable_product_ids [Array<String>] Will be passed down to the individual commits
1598
+ #
1599
+ # @param applicable_product_tags [Array<String>] Will be passed down to the individual commits
1600
+ #
1601
+ # @param contract [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::Contract]
1602
+ #
1603
+ # @param description [String] Will be passed down to the individual commits
1604
+ #
1605
+ # @param ending_before [Time] Determines when the contract will stop creating recurring commits. Optional
1606
+ #
1607
+ # @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for recurring credit hierarchy access control
1608
+ #
1609
+ # @param name [String] Displayed on invoices. Will be passed through to the individual commits
1610
+ #
1611
+ # @param netsuite_sales_order_id [String] Will be passed down to the individual commits
1612
+ #
1613
+ # @param proration [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::Proration] Determines whether the first and last commit will be prorated. If not provided,
1614
+ #
1615
+ # @param proration_rounding [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::ProrationRounding, nil] Rounding configuration for prorated recurring credit amounts.
1616
+ #
1617
+ # @param recurrence_frequency [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::RecurrenceFrequency] The frequency at which the recurring commits will be created. If not provided: -
1618
+ #
1619
+ # @param rollover_fraction [Float] Will be passed down to the individual commits. This controls how much of an indi
1620
+ #
1621
+ # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifier>] List of filters that determine what kind of customer usage draws down a commit o
1622
+ #
1623
+ # @param subscription_config [MetronomeSDK::Models::RecurringCommitSubscriptionConfig] Attach a subscription to the recurring commit/credit.
1624
+
1625
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit#access_amount
1626
+ class AccessAmount < MetronomeSDK::Internal::Type::BaseModel
1627
+ # @!attribute credit_type_id
1628
+ #
1629
+ # @return [String]
1630
+ required :credit_type_id, String
1631
+
1632
+ # @!attribute unit_price
1633
+ #
1634
+ # @return [Float]
1635
+ required :unit_price, Float
1636
+
1637
+ # @!attribute quantity
1638
+ #
1639
+ # @return [Float, nil]
1640
+ optional :quantity, Float
1641
+
1642
+ # @!method initialize(credit_type_id:, unit_price:, quantity: nil)
1643
+ # The amount of commit to grant.
1644
+ #
1645
+ # @param credit_type_id [String]
1646
+ # @param unit_price [Float]
1647
+ # @param quantity [Float]
1648
+ end
1649
+
1650
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit#commit_duration
1651
+ class CommitDuration < MetronomeSDK::Internal::Type::BaseModel
1652
+ # @!attribute value
1653
+ #
1654
+ # @return [Float]
1655
+ required :value, Float
1656
+
1657
+ # @!attribute unit
1658
+ #
1659
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::CommitDuration::Unit, nil]
1660
+ optional :unit,
1661
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::CommitDuration::Unit }
1662
+
1663
+ # @!method initialize(value:, unit: nil)
1664
+ # The amount of time the created commits will be valid for
1665
+ #
1666
+ # @param value [Float]
1667
+ # @param unit [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::CommitDuration::Unit]
1668
+
1669
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::CommitDuration#unit
1670
+ module Unit
1671
+ extend MetronomeSDK::Internal::Type::Enum
1672
+
1673
+ PERIODS = :PERIODS
1674
+
1675
+ # @!method self.values
1676
+ # @return [Array<Symbol>]
1677
+ end
1678
+ end
1679
+
1680
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit#product
1681
+ class Product < MetronomeSDK::Internal::Type::BaseModel
1682
+ # @!attribute id
1683
+ #
1684
+ # @return [String]
1685
+ required :id, String
1686
+
1687
+ # @!attribute name
1688
+ #
1689
+ # @return [String]
1690
+ required :name, String
1691
+
1692
+ # @!method initialize(id:, name:)
1693
+ # @param id [String]
1694
+ # @param name [String]
1695
+ end
1696
+
1697
+ # Whether the created commits will use the commit rate or list rate
1698
+ #
1699
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit#rate_type
1700
+ module RateType
1701
+ extend MetronomeSDK::Internal::Type::Enum
1702
+
1703
+ COMMIT_RATE = :COMMIT_RATE
1704
+ LIST_RATE = :LIST_RATE
1705
+
1706
+ # @!method self.values
1707
+ # @return [Array<Symbol>]
1708
+ end
1709
+
1710
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit#contract
1711
+ class Contract < MetronomeSDK::Internal::Type::BaseModel
1712
+ # @!attribute id
1713
+ #
1714
+ # @return [String]
1715
+ required :id, String
1716
+
1717
+ # @!method initialize(id:)
1718
+ # @param id [String]
1719
+ end
1720
+
1721
+ # Determines whether the first and last commit will be prorated. If not provided,
1722
+ # the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1723
+ #
1724
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit#proration
1725
+ module Proration
1726
+ extend MetronomeSDK::Internal::Type::Enum
1727
+
1728
+ NONE = :NONE
1729
+ FIRST = :FIRST
1730
+ LAST = :LAST
1731
+ FIRST_AND_LAST = :FIRST_AND_LAST
1732
+
1733
+ # @!method self.values
1734
+ # @return [Array<Symbol>]
1735
+ end
1736
+
1737
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit#proration_rounding
1738
+ class ProrationRounding < MetronomeSDK::Internal::Type::BaseModel
1739
+ # @!attribute access
1740
+ #
1741
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::ProrationRounding::Access, nil]
1742
+ optional :access,
1743
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::ProrationRounding::Access }
1744
+
1745
+ # @!method initialize(access: nil)
1746
+ # Rounding configuration for prorated recurring credit amounts.
1747
+ #
1748
+ # @param access [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::ProrationRounding::Access]
1749
+
1750
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::ProrationRounding#access
1751
+ class Access < MetronomeSDK::Internal::Type::BaseModel
1752
+ # @!attribute decimal_places
1753
+ # Number of decimal places to round to. Applied directly to the stored monetary
1754
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
1755
+ # nearest 100 in the stored unit).
1756
+ #
1757
+ # @return [Float]
1758
+ required :decimal_places, Float
1759
+
1760
+ # @!attribute rounding_method
1761
+ #
1762
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::ProrationRounding::Access::RoundingMethod]
1763
+ required :rounding_method,
1764
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::ProrationRounding::Access::RoundingMethod }
1765
+
1766
+ # @!method initialize(decimal_places:, rounding_method:)
1767
+ # Some parameter documentations has been truncated, see
1768
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::ProrationRounding::Access}
1769
+ # for more details.
1770
+ #
1771
+ # @param decimal_places [Float] Number of decimal places to round to. Applied directly to the stored monetary re
1772
+ #
1773
+ # @param rounding_method [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::ProrationRounding::Access::RoundingMethod]
1774
+
1775
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit::ProrationRounding::Access#rounding_method
1776
+ module RoundingMethod
1777
+ extend MetronomeSDK::Internal::Type::Enum
1778
+
1779
+ HALF_UP = :HALF_UP
1780
+ FLOOR = :FLOOR
1781
+ CEILING = :CEILING
1782
+
1783
+ # @!method self.values
1784
+ # @return [Array<Symbol>]
1785
+ end
1786
+ end
1787
+ end
1788
+
1789
+ # The frequency at which the recurring commits will be created. If not provided: -
1790
+ # The commits will be created on the usage invoice frequency. If provided: - The
1791
+ # period defined in the duration will correspond to this frequency. - Commits will
1792
+ # be created aligned with the recurring commit's starting_at rather than the usage
1793
+ # invoice dates.
1794
+ #
1795
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddRecurringCredit#recurrence_frequency
1796
+ module RecurrenceFrequency
1797
+ extend MetronomeSDK::Internal::Type::Enum
1798
+
1799
+ MONTHLY = :MONTHLY
1800
+ QUARTERLY = :QUARTERLY
1801
+ ANNUAL = :ANNUAL
1802
+ WEEKLY = :WEEKLY
1803
+ DAILY = :DAILY
1804
+
1805
+ # @!method self.values
1806
+ # @return [Array<Symbol>]
1807
+ end
1808
+ end
1809
+
1810
+ class AddResellerRoyalty < MetronomeSDK::Internal::Type::BaseModel
1811
+ # @!attribute reseller_type
1812
+ #
1813
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddResellerRoyalty::ResellerType]
1814
+ required :reseller_type,
1815
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddResellerRoyalty::ResellerType }
1816
+
1817
+ # @!attribute applicable_product_ids
1818
+ #
1819
+ # @return [Array<String>, nil]
1820
+ optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
1821
+
1822
+ # @!attribute applicable_product_tags
1823
+ #
1824
+ # @return [Array<String>, nil]
1825
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
1826
+
1827
+ # @!attribute aws_account_number
1828
+ #
1829
+ # @return [String, nil]
1830
+ optional :aws_account_number, String
1831
+
1832
+ # @!attribute aws_offer_id
1833
+ #
1834
+ # @return [String, nil]
1835
+ optional :aws_offer_id, String
1836
+
1837
+ # @!attribute aws_payer_reference_id
1838
+ #
1839
+ # @return [String, nil]
1840
+ optional :aws_payer_reference_id, String
1841
+
1842
+ # @!attribute ending_before
1843
+ #
1844
+ # @return [Time, nil]
1845
+ optional :ending_before, Time, nil?: true
1846
+
1847
+ # @!attribute fraction
1848
+ #
1849
+ # @return [Float, nil]
1850
+ optional :fraction, Float
1851
+
1852
+ # @!attribute gcp_account_id
1853
+ #
1854
+ # @return [String, nil]
1855
+ optional :gcp_account_id, String
1856
+
1857
+ # @!attribute gcp_offer_id
1858
+ #
1859
+ # @return [String, nil]
1860
+ optional :gcp_offer_id, String
1861
+
1862
+ # @!attribute netsuite_reseller_id
1863
+ #
1864
+ # @return [String, nil]
1865
+ optional :netsuite_reseller_id, String
1866
+
1867
+ # @!attribute reseller_contract_value
1868
+ #
1869
+ # @return [Float, nil]
1870
+ optional :reseller_contract_value, Float
1871
+
1872
+ # @!attribute starting_at
1873
+ #
1874
+ # @return [Time, nil]
1875
+ optional :starting_at, Time
1876
+
1877
+ # @!method initialize(reseller_type:, applicable_product_ids: nil, applicable_product_tags: nil, aws_account_number: nil, aws_offer_id: nil, aws_payer_reference_id: nil, ending_before: nil, fraction: nil, gcp_account_id: nil, gcp_offer_id: nil, netsuite_reseller_id: nil, reseller_contract_value: nil, starting_at: nil)
1878
+ # @param reseller_type [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddResellerRoyalty::ResellerType]
1879
+ # @param applicable_product_ids [Array<String>]
1880
+ # @param applicable_product_tags [Array<String>]
1881
+ # @param aws_account_number [String]
1882
+ # @param aws_offer_id [String]
1883
+ # @param aws_payer_reference_id [String]
1884
+ # @param ending_before [Time, nil]
1885
+ # @param fraction [Float]
1886
+ # @param gcp_account_id [String]
1887
+ # @param gcp_offer_id [String]
1888
+ # @param netsuite_reseller_id [String]
1889
+ # @param reseller_contract_value [Float]
1890
+ # @param starting_at [Time]
1891
+
1892
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddResellerRoyalty#reseller_type
1893
+ module ResellerType
1894
+ extend MetronomeSDK::Internal::Type::Enum
1895
+
1896
+ AWS = :AWS
1897
+ AWS_PRO_SERVICE = :AWS_PRO_SERVICE
1898
+ GCP = :GCP
1899
+ GCP_PRO_SERVICE = :GCP_PRO_SERVICE
1900
+
1901
+ # @!method self.values
1902
+ # @return [Array<Symbol>]
1903
+ end
1904
+ end
1905
+
1906
+ class AddScheduledCharge < MetronomeSDK::Internal::Type::BaseModel
1907
+ # @!attribute id
1908
+ #
1909
+ # @return [String]
1910
+ required :id, String
1911
+
1912
+ # @!attribute product
1913
+ #
1914
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddScheduledCharge::Product]
1915
+ required :product,
1916
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddScheduledCharge::Product }
1917
+
1918
+ # @!attribute schedule
1919
+ #
1920
+ # @return [MetronomeSDK::Models::SchedulePointInTime]
1921
+ required :schedule, -> { MetronomeSDK::SchedulePointInTime }
1922
+
1923
+ # @!attribute name
1924
+ # displayed on invoices
1925
+ #
1926
+ # @return [String, nil]
1927
+ optional :name, String
1928
+
1929
+ # @!attribute netsuite_sales_order_id
1930
+ # This field's availability is dependent on your client's configuration.
1931
+ #
1932
+ # @return [String, nil]
1933
+ optional :netsuite_sales_order_id, String
1934
+
1935
+ # @!method initialize(id:, product:, schedule:, name: nil, netsuite_sales_order_id: nil)
1936
+ # @param id [String]
1937
+ #
1938
+ # @param product [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddScheduledCharge::Product]
1939
+ #
1940
+ # @param schedule [MetronomeSDK::Models::SchedulePointInTime]
1941
+ #
1942
+ # @param name [String] displayed on invoices
1943
+ #
1944
+ # @param netsuite_sales_order_id [String] This field's availability is dependent on your client's configuration.
1945
+
1946
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddScheduledCharge#product
1947
+ class Product < MetronomeSDK::Internal::Type::BaseModel
1948
+ # @!attribute id
1949
+ #
1950
+ # @return [String]
1951
+ required :id, String
1952
+
1953
+ # @!attribute name
1954
+ #
1955
+ # @return [String]
1956
+ required :name, String
1957
+
1958
+ # @!method initialize(id:, name:)
1959
+ # @param id [String]
1960
+ # @param name [String]
1961
+ end
1962
+ end
1963
+
1964
+ class AddSubscription < MetronomeSDK::Internal::Type::BaseModel
1965
+ # @!attribute billing_periods
1966
+ # Previous, current, and next billing periods for the subscription.
1967
+ #
1968
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods]
1969
+ required :billing_periods,
1970
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods }
1971
+
1972
+ # @!attribute collection_schedule
1973
+ #
1974
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::CollectionSchedule]
1975
+ required :collection_schedule,
1976
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::CollectionSchedule }
1977
+
1978
+ # @!attribute proration
1979
+ #
1980
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration]
1981
+ required :proration,
1982
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration }
1983
+
1984
+ # @!attribute quantity_management_mode
1985
+ # Determines how the subscription's quantity is controlled. Defaults to
1986
+ # QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
1987
+ # directly on the subscription. `initial_quantity` must be provided with this
1988
+ # option. Compatible with recurring commits/credits that use POOLED allocation.
1989
+ # **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
1990
+ # user_123) to increment and decrement a subscription quantity, rather than
1991
+ # directly providing the quantity. You must use a **SEAT_BASED** subscription to
1992
+ # use a linked recurring credit with an allocation per seat. `seat_config` must be
1993
+ # provided with this option.
1994
+ #
1995
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::QuantityManagementMode]
1996
+ required :quantity_management_mode,
1997
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::QuantityManagementMode }
1998
+
1999
+ # @!attribute quantity_schedule
2000
+ # List of quantity schedule items for the subscription. Only includes the current
2001
+ # quantity and future quantity changes.
2002
+ #
2003
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::QuantitySchedule>]
2004
+ required :quantity_schedule,
2005
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::QuantitySchedule] }
2006
+
2007
+ # @!attribute starting_at
2008
+ #
2009
+ # @return [Time]
2010
+ required :starting_at, Time
2011
+
2012
+ # @!attribute subscription_rate
2013
+ #
2014
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SubscriptionRate]
2015
+ required :subscription_rate,
2016
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SubscriptionRate }
2017
+
2018
+ # @!attribute id
2019
+ #
2020
+ # @return [String, nil]
2021
+ optional :id, String
2022
+
2023
+ # @!attribute billing_cycle_config
2024
+ #
2025
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingCycleConfig, nil]
2026
+ optional :billing_cycle_config,
2027
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingCycleConfig }
2028
+
2029
+ # @!attribute custom_fields
2030
+ # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2031
+ #
2032
+ # @return [Hash{Symbol=>String}, nil]
2033
+ optional :custom_fields, MetronomeSDK::Internal::Type::HashOf[String]
2034
+
2035
+ # @!attribute description
2036
+ #
2037
+ # @return [String, nil]
2038
+ optional :description, String
2039
+
2040
+ # @!attribute ending_before
2041
+ #
2042
+ # @return [Time, nil]
2043
+ optional :ending_before, Time
2044
+
2045
+ # @!attribute fiat_credit_type_id
2046
+ #
2047
+ # @return [String, nil]
2048
+ optional :fiat_credit_type_id, String
2049
+
2050
+ # @!attribute name
2051
+ #
2052
+ # @return [String, nil]
2053
+ optional :name, String
2054
+
2055
+ # @!attribute seat_config
2056
+ #
2057
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SeatConfig, nil]
2058
+ optional :seat_config,
2059
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SeatConfig }
2060
+
2061
+ # @!method initialize(billing_periods:, collection_schedule:, proration:, quantity_management_mode:, quantity_schedule:, starting_at:, subscription_rate:, id: nil, billing_cycle_config: nil, custom_fields: nil, description: nil, ending_before: nil, fiat_credit_type_id: nil, name: nil, seat_config: nil)
2062
+ # Some parameter documentations has been truncated, see
2063
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription}
2064
+ # for more details.
2065
+ #
2066
+ # @param billing_periods [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods] Previous, current, and next billing periods for the subscription.
2067
+ #
2068
+ # @param collection_schedule [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::CollectionSchedule]
2069
+ #
2070
+ # @param proration [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration]
2071
+ #
2072
+ # @param quantity_management_mode [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::QuantityManagementMode] Determines how the subscription's quantity is controlled. Defaults to QUANTITY_O
2073
+ #
2074
+ # @param quantity_schedule [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::QuantitySchedule>] List of quantity schedule items for the subscription. Only includes the current
2075
+ #
2076
+ # @param starting_at [Time]
2077
+ #
2078
+ # @param subscription_rate [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SubscriptionRate]
2079
+ #
2080
+ # @param id [String]
2081
+ #
2082
+ # @param billing_cycle_config [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingCycleConfig]
2083
+ #
2084
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2085
+ #
2086
+ # @param description [String]
2087
+ #
2088
+ # @param ending_before [Time]
2089
+ #
2090
+ # @param fiat_credit_type_id [String]
2091
+ #
2092
+ # @param name [String]
2093
+ #
2094
+ # @param seat_config [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SeatConfig]
2095
+
2096
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription#billing_periods
2097
+ class BillingPeriods < MetronomeSDK::Internal::Type::BaseModel
2098
+ # @!attribute current
2099
+ #
2100
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods::Current, nil]
2101
+ optional :current,
2102
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods::Current }
2103
+
2104
+ # @!attribute next_
2105
+ #
2106
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods::Next, nil]
2107
+ optional :next_,
2108
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods::Next },
2109
+ api_name: :next
2110
+
2111
+ # @!attribute previous
2112
+ #
2113
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods::Previous, nil]
2114
+ optional :previous,
2115
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods::Previous }
2116
+
2117
+ # @!method initialize(current: nil, next_: nil, previous: nil)
2118
+ # Previous, current, and next billing periods for the subscription.
2119
+ #
2120
+ # @param current [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods::Current]
2121
+ # @param next_ [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods::Next]
2122
+ # @param previous [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods::Previous]
2123
+
2124
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods#current
2125
+ class Current < MetronomeSDK::Internal::Type::BaseModel
2126
+ # @!attribute ending_before
2127
+ #
2128
+ # @return [Time]
2129
+ required :ending_before, Time
2130
+
2131
+ # @!attribute starting_at
2132
+ #
2133
+ # @return [Time]
2134
+ required :starting_at, Time
2135
+
2136
+ # @!method initialize(ending_before:, starting_at:)
2137
+ # @param ending_before [Time]
2138
+ # @param starting_at [Time]
2139
+ end
2140
+
2141
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods#next_
2142
+ class Next < MetronomeSDK::Internal::Type::BaseModel
2143
+ # @!attribute ending_before
2144
+ #
2145
+ # @return [Time]
2146
+ required :ending_before, Time
2147
+
2148
+ # @!attribute starting_at
2149
+ #
2150
+ # @return [Time]
2151
+ required :starting_at, Time
2152
+
2153
+ # @!method initialize(ending_before:, starting_at:)
2154
+ # @param ending_before [Time]
2155
+ # @param starting_at [Time]
2156
+ end
2157
+
2158
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingPeriods#previous
2159
+ class Previous < MetronomeSDK::Internal::Type::BaseModel
2160
+ # @!attribute ending_before
2161
+ #
2162
+ # @return [Time]
2163
+ required :ending_before, Time
2164
+
2165
+ # @!attribute starting_at
2166
+ #
2167
+ # @return [Time]
2168
+ required :starting_at, Time
2169
+
2170
+ # @!method initialize(ending_before:, starting_at:)
2171
+ # @param ending_before [Time]
2172
+ # @param starting_at [Time]
2173
+ end
2174
+ end
2175
+
2176
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription#collection_schedule
2177
+ module CollectionSchedule
2178
+ extend MetronomeSDK::Internal::Type::Enum
2179
+
2180
+ ADVANCE = :ADVANCE
2181
+ ARREARS = :ARREARS
2182
+
2183
+ # @!method self.values
2184
+ # @return [Array<Symbol>]
2185
+ end
2186
+
2187
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription#proration
2188
+ class Proration < MetronomeSDK::Internal::Type::BaseModel
2189
+ # @!attribute invoice_behavior
2190
+ #
2191
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration::InvoiceBehavior]
2192
+ required :invoice_behavior,
2193
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration::InvoiceBehavior }
2194
+
2195
+ # @!attribute is_prorated
2196
+ #
2197
+ # @return [Boolean]
2198
+ required :is_prorated, MetronomeSDK::Internal::Type::Boolean
2199
+
2200
+ # @!attribute rounding
2201
+ #
2202
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration::Rounding, nil]
2203
+ optional :rounding,
2204
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration::Rounding }
2205
+
2206
+ # @!method initialize(invoice_behavior:, is_prorated:, rounding: nil)
2207
+ # @param invoice_behavior [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration::InvoiceBehavior]
2208
+ # @param is_prorated [Boolean]
2209
+ # @param rounding [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration::Rounding]
2210
+
2211
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration#invoice_behavior
2212
+ module InvoiceBehavior
2213
+ extend MetronomeSDK::Internal::Type::Enum
2214
+
2215
+ BILL_IMMEDIATELY = :BILL_IMMEDIATELY
2216
+ BILL_ON_NEXT_COLLECTION_DATE = :BILL_ON_NEXT_COLLECTION_DATE
2217
+
2218
+ # @!method self.values
2219
+ # @return [Array<Symbol>]
2220
+ end
2221
+
2222
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration#rounding
2223
+ class Rounding < MetronomeSDK::Internal::Type::BaseModel
2224
+ # @!attribute decimal_places
2225
+ # Number of decimal places to round to. Applied directly to the stored monetary
2226
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
2227
+ # nearest 100 in the stored unit).
2228
+ #
2229
+ # @return [Float]
2230
+ required :decimal_places, Float
2231
+
2232
+ # @!attribute rounding_method
2233
+ #
2234
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration::Rounding::RoundingMethod]
2235
+ required :rounding_method,
2236
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration::Rounding::RoundingMethod }
2237
+
2238
+ # @!method initialize(decimal_places:, rounding_method:)
2239
+ # Some parameter documentations has been truncated, see
2240
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration::Rounding}
2241
+ # for more details.
2242
+ #
2243
+ # @param decimal_places [Float] Number of decimal places to round to. Applied directly to the stored monetary re
2244
+ #
2245
+ # @param rounding_method [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration::Rounding::RoundingMethod]
2246
+
2247
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::Proration::Rounding#rounding_method
2248
+ module RoundingMethod
2249
+ extend MetronomeSDK::Internal::Type::Enum
2250
+
2251
+ HALF_UP = :HALF_UP
2252
+ FLOOR = :FLOOR
2253
+ CEILING = :CEILING
2254
+
2255
+ # @!method self.values
2256
+ # @return [Array<Symbol>]
2257
+ end
2258
+ end
2259
+ end
2260
+
2261
+ # Determines how the subscription's quantity is controlled. Defaults to
2262
+ # QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
2263
+ # directly on the subscription. `initial_quantity` must be provided with this
2264
+ # option. Compatible with recurring commits/credits that use POOLED allocation.
2265
+ # **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
2266
+ # user_123) to increment and decrement a subscription quantity, rather than
2267
+ # directly providing the quantity. You must use a **SEAT_BASED** subscription to
2268
+ # use a linked recurring credit with an allocation per seat. `seat_config` must be
2269
+ # provided with this option.
2270
+ #
2271
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription#quantity_management_mode
2272
+ module QuantityManagementMode
2273
+ extend MetronomeSDK::Internal::Type::Enum
2274
+
2275
+ SEAT_BASED = :SEAT_BASED
2276
+ QUANTITY_ONLY = :QUANTITY_ONLY
2277
+
2278
+ # @!method self.values
2279
+ # @return [Array<Symbol>]
2280
+ end
2281
+
2282
+ class QuantitySchedule < MetronomeSDK::Internal::Type::BaseModel
2283
+ # @!attribute quantity
2284
+ #
2285
+ # @return [Float]
2286
+ required :quantity, Float
2287
+
2288
+ # @!attribute starting_at
2289
+ #
2290
+ # @return [Time]
2291
+ required :starting_at, Time
2292
+
2293
+ # @!attribute ending_before
2294
+ #
2295
+ # @return [Time, nil]
2296
+ optional :ending_before, Time
2297
+
2298
+ # @!method initialize(quantity:, starting_at:, ending_before: nil)
2299
+ # @param quantity [Float]
2300
+ # @param starting_at [Time]
2301
+ # @param ending_before [Time]
2302
+ end
2303
+
2304
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription#subscription_rate
2305
+ class SubscriptionRate < MetronomeSDK::Internal::Type::BaseModel
2306
+ # @!attribute billing_frequency
2307
+ #
2308
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SubscriptionRate::BillingFrequency]
2309
+ required :billing_frequency,
2310
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SubscriptionRate::BillingFrequency }
2311
+
2312
+ # @!attribute product
2313
+ #
2314
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SubscriptionRate::Product]
2315
+ required :product,
2316
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SubscriptionRate::Product }
2317
+
2318
+ # @!method initialize(billing_frequency:, product:)
2319
+ # @param billing_frequency [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SubscriptionRate::BillingFrequency]
2320
+ # @param product [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SubscriptionRate::Product]
2321
+
2322
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SubscriptionRate#billing_frequency
2323
+ module BillingFrequency
2324
+ extend MetronomeSDK::Internal::Type::Enum
2325
+
2326
+ MONTHLY = :MONTHLY
2327
+ QUARTERLY = :QUARTERLY
2328
+ ANNUAL = :ANNUAL
2329
+ WEEKLY = :WEEKLY
2330
+
2331
+ # @!method self.values
2332
+ # @return [Array<Symbol>]
2333
+ end
2334
+
2335
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SubscriptionRate#product
2336
+ class Product < MetronomeSDK::Internal::Type::BaseModel
2337
+ # @!attribute id
2338
+ #
2339
+ # @return [String]
2340
+ required :id, String
2341
+
2342
+ # @!attribute name
2343
+ #
2344
+ # @return [String]
2345
+ required :name, String
2346
+
2347
+ # @!method initialize(id:, name:)
2348
+ # @param id [String]
2349
+ # @param name [String]
2350
+ end
2351
+ end
2352
+
2353
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription#billing_cycle_config
2354
+ class BillingCycleConfig < MetronomeSDK::Internal::Type::BaseModel
2355
+ # @!attribute anchor_date
2356
+ # The date this subscription's billing cycle is anchored to.
2357
+ #
2358
+ # @return [Time]
2359
+ required :anchor_date, Time
2360
+
2361
+ # @!attribute invoice_placement
2362
+ # Controls whether this subscription consolidates onto usage invoices or gets its
2363
+ # own scheduled invoice.
2364
+ #
2365
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingCycleConfig::InvoicePlacement]
2366
+ required :invoice_placement,
2367
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingCycleConfig::InvoicePlacement }
2368
+
2369
+ # @!method initialize(anchor_date:, invoice_placement:)
2370
+ # Some parameter documentations has been truncated, see
2371
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingCycleConfig}
2372
+ # for more details.
2373
+ #
2374
+ # @param anchor_date [Time] The date this subscription's billing cycle is anchored to.
2375
+ #
2376
+ # @param invoice_placement [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingCycleConfig::InvoicePlacement] Controls whether this subscription consolidates onto usage invoices or gets its
2377
+
2378
+ # Controls whether this subscription consolidates onto usage invoices or gets its
2379
+ # own scheduled invoice.
2380
+ #
2381
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::BillingCycleConfig#invoice_placement
2382
+ module InvoicePlacement
2383
+ extend MetronomeSDK::Internal::Type::Enum
2384
+
2385
+ ON_SCHEDULED_INVOICE = :ON_SCHEDULED_INVOICE
2386
+ ON_USAGE_INVOICE = :ON_USAGE_INVOICE
2387
+
2388
+ # @!method self.values
2389
+ # @return [Array<Symbol>]
2390
+ end
2391
+ end
2392
+
2393
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription#seat_config
2394
+ class SeatConfig < MetronomeSDK::Internal::Type::BaseModel
2395
+ # @!attribute seat_group_key
2396
+ # The property name, sent on usage events, that identifies the seat ID associated
2397
+ # with the usage event. For example, the property name might be seat_id or
2398
+ # user_id. The property must be set as a group key on billable metrics and a
2399
+ # presentation/pricing group key on contract products. This allows linked
2400
+ # recurring credits with an allocation per seat to be consumed by only one seat's
2401
+ # usage.
2402
+ #
2403
+ # @return [String]
2404
+ required :seat_group_key, String
2405
+
2406
+ # @!method initialize(seat_group_key:)
2407
+ # Some parameter documentations has been truncated, see
2408
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddSubscription::SeatConfig}
2409
+ # for more details.
2410
+ #
2411
+ # @param seat_group_key [String] The property name, sent on usage events, that identifies the seat ID associated
2412
+ end
2413
+ end
2414
+
2415
+ class AddUsageFilter < MetronomeSDK::Internal::Type::BaseModel
2416
+ # @!attribute group_key
2417
+ #
2418
+ # @return [String]
2419
+ required :group_key, String
2420
+
2421
+ # @!attribute group_values
2422
+ #
2423
+ # @return [Array<String>]
2424
+ required :group_values, MetronomeSDK::Internal::Type::ArrayOf[String]
2425
+
2426
+ # @!attribute starting_at
2427
+ # This will match contract starting_at value if usage filter is active from the
2428
+ # beginning of the contract.
2429
+ #
2430
+ # @return [Time]
2431
+ required :starting_at, Time
2432
+
2433
+ # @!attribute ending_before
2434
+ # This will match contract ending_before value if usage filter is active until the
2435
+ # end of the contract. It will be undefined if the contract is open-ended.
2436
+ #
2437
+ # @return [Time, nil]
2438
+ optional :ending_before, Time
2439
+
2440
+ # @!method initialize(group_key:, group_values:, starting_at:, ending_before: nil)
2441
+ # Some parameter documentations has been truncated, see
2442
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::AddUsageFilter} for
2443
+ # more details.
2444
+ #
2445
+ # @param group_key [String]
2446
+ #
2447
+ # @param group_values [Array<String>]
2448
+ #
2449
+ # @param starting_at [Time] This will match contract starting_at value if usage filter is active from the be
2450
+ #
2451
+ # @param ending_before [Time] This will match contract ending_before value if usage filter is active until the
2452
+ end
2453
+
2454
+ class ArchiveCommit < MetronomeSDK::Internal::Type::BaseModel
2455
+ # @!attribute id
2456
+ #
2457
+ # @return [String]
2458
+ required :id, String
2459
+
2460
+ # @!method initialize(id:)
2461
+ # @param id [String]
2462
+ end
2463
+
2464
+ class ArchiveCredit < MetronomeSDK::Internal::Type::BaseModel
2465
+ # @!attribute id
2466
+ #
2467
+ # @return [String]
2468
+ required :id, String
2469
+
2470
+ # @!method initialize(id:)
2471
+ # @param id [String]
2472
+ end
2473
+
2474
+ class ArchiveScheduledCharge < MetronomeSDK::Internal::Type::BaseModel
2475
+ # @!attribute id
2476
+ #
2477
+ # @return [String]
2478
+ required :id, String
2479
+
2480
+ # @!method initialize(id:)
2481
+ # @param id [String]
2482
+ end
2483
+
2484
+ class RemoveOverride < MetronomeSDK::Internal::Type::BaseModel
2485
+ # @!attribute id
2486
+ #
2487
+ # @return [String]
2488
+ required :id, String
2489
+
2490
+ # @!method initialize(id:)
2491
+ # @param id [String]
2492
+ end
2493
+
2494
+ class UpdateCommit < MetronomeSDK::Internal::Type::BaseModel
2495
+ # @!attribute id
2496
+ #
2497
+ # @return [String]
2498
+ required :id, String
2499
+
2500
+ # @!attribute access_schedule
2501
+ #
2502
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::AccessSchedule, nil]
2503
+ optional :access_schedule,
2504
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::AccessSchedule }
2505
+
2506
+ # @!attribute applicable_product_ids
2507
+ # Which products the commit applies to. If applicable_product_ids,
2508
+ # applicable_product_tags or specifiers are not provided, the commit applies to
2509
+ # all products.
2510
+ #
2511
+ # @return [Array<String>, nil]
2512
+ optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String], nil?: true
2513
+
2514
+ # @!attribute applicable_product_tags
2515
+ # Which tags the commit applies to. If applicable_product_ids,
2516
+ # applicable_product_tags or specifiers are not provided, the commit applies to
2517
+ # all products.
2518
+ #
2519
+ # @return [Array<String>, nil]
2520
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String], nil?: true
2521
+
2522
+ # @!attribute description
2523
+ #
2524
+ # @return [String, nil]
2525
+ optional :description, String
2526
+
2527
+ # @!attribute hierarchy_configuration
2528
+ # Optional configuration for commit hierarchy access control
2529
+ #
2530
+ # @return [MetronomeSDK::Models::CommitHierarchyConfiguration, nil]
2531
+ optional :hierarchy_configuration, -> { MetronomeSDK::CommitHierarchyConfiguration }
2532
+
2533
+ # @!attribute invoice_schedule
2534
+ #
2535
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::InvoiceSchedule, nil]
2536
+ optional :invoice_schedule,
2537
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::InvoiceSchedule }
2538
+
2539
+ # @!attribute name
2540
+ #
2541
+ # @return [String, nil]
2542
+ optional :name, String
2543
+
2544
+ # @!attribute netsuite_sales_order_id
2545
+ #
2546
+ # @return [String, nil]
2547
+ optional :netsuite_sales_order_id, String, nil?: true
2548
+
2549
+ # @!attribute priority
2550
+ # If multiple commits are applicable, the one with the lower priority will apply
2551
+ # first.
2552
+ #
2553
+ # @return [Float, nil]
2554
+ optional :priority, Float, nil?: true
2555
+
2556
+ # @!attribute product_id
2557
+ #
2558
+ # @return [String, nil]
2559
+ optional :product_id, String
2560
+
2561
+ # @!attribute rate_type
2562
+ # If set, the commit's rate type was updated to the specified value.
2563
+ #
2564
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::RateType, nil]
2565
+ optional :rate_type,
2566
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::RateType }
2567
+
2568
+ # @!attribute rollover_fraction
2569
+ #
2570
+ # @return [Float, nil]
2571
+ optional :rollover_fraction, Float, nil?: true
2572
+
2573
+ # @!attribute specifiers
2574
+ # List of filters that determine what kind of customer usage draws down a commit
2575
+ # or credit. A customer's usage needs to meet the condition of at least one of the
2576
+ # specifiers to contribute to a commit's or credit's drawdown. This field cannot
2577
+ # be used together with `applicable_product_ids` or `applicable_product_tags`.
2578
+ # Instead, to target usage by product or product tag, pass those values in the
2579
+ # body of `specifiers`.
2580
+ #
2581
+ # @return [Array<MetronomeSDK::Models::CommitSpecifierInput>, nil]
2582
+ optional :specifiers,
2583
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifierInput] },
2584
+ nil?: true
2585
+
2586
+ # @!method initialize(id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, description: nil, hierarchy_configuration: nil, invoice_schedule: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, product_id: nil, rate_type: nil, rollover_fraction: nil, specifiers: nil)
2587
+ # Some parameter documentations has been truncated, see
2588
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit} for
2589
+ # more details.
2590
+ #
2591
+ # @param id [String]
2592
+ #
2593
+ # @param access_schedule [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::AccessSchedule]
2594
+ #
2595
+ # @param applicable_product_ids [Array<String>, nil] Which products the commit applies to. If applicable_product_ids, applicable_prod
2596
+ #
2597
+ # @param applicable_product_tags [Array<String>, nil] Which tags the commit applies to. If applicable*product_ids, applicable_product*
2598
+ #
2599
+ # @param description [String]
2600
+ #
2601
+ # @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for commit hierarchy access control
2602
+ #
2603
+ # @param invoice_schedule [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::InvoiceSchedule]
2604
+ #
2605
+ # @param name [String]
2606
+ #
2607
+ # @param netsuite_sales_order_id [String, nil]
2608
+ #
2609
+ # @param priority [Float, nil] If multiple commits are applicable, the one with the lower priority will apply f
2610
+ #
2611
+ # @param product_id [String]
2612
+ #
2613
+ # @param rate_type [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::RateType] If set, the commit's rate type was updated to the specified value.
2614
+ #
2615
+ # @param rollover_fraction [Float, nil]
2616
+ #
2617
+ # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifierInput>, nil] List of filters that determine what kind of customer usage draws down a commit o
2618
+
2619
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit#access_schedule
2620
+ class AccessSchedule < MetronomeSDK::Internal::Type::BaseModel
2621
+ # @!attribute add_schedule_items
2622
+ #
2623
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::AccessSchedule::AddScheduleItem>, nil]
2624
+ optional :add_schedule_items,
2625
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::AccessSchedule::AddScheduleItem] }
2626
+
2627
+ # @!attribute remove_schedule_items
2628
+ #
2629
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::AccessSchedule::RemoveScheduleItem>, nil]
2630
+ optional :remove_schedule_items,
2631
+ -> do
2632
+ MetronomeSDK::Internal::Type::ArrayOf[
2633
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::AccessSchedule::RemoveScheduleItem
2634
+ ]
2635
+ end
2636
+
2637
+ # @!attribute update_schedule_items
2638
+ #
2639
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::AccessSchedule::UpdateScheduleItem>, nil]
2640
+ optional :update_schedule_items,
2641
+ -> do
2642
+ MetronomeSDK::Internal::Type::ArrayOf[
2643
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::AccessSchedule::UpdateScheduleItem
2644
+ ]
2645
+ end
2646
+
2647
+ # @!method initialize(add_schedule_items: nil, remove_schedule_items: nil, update_schedule_items: nil)
2648
+ # @param add_schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::AccessSchedule::AddScheduleItem>]
2649
+ # @param remove_schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::AccessSchedule::RemoveScheduleItem>]
2650
+ # @param update_schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::AccessSchedule::UpdateScheduleItem>]
2651
+
2652
+ class AddScheduleItem < MetronomeSDK::Internal::Type::BaseModel
2653
+ # @!attribute amount
2654
+ #
2655
+ # @return [Float]
2656
+ required :amount, Float
2657
+
2658
+ # @!attribute ending_before
2659
+ # RFC 3339 timestamp (exclusive)
2660
+ #
2661
+ # @return [Time]
2662
+ required :ending_before, Time
2663
+
2664
+ # @!attribute starting_at
2665
+ # RFC 3339 timestamp (inclusive)
2666
+ #
2667
+ # @return [Time]
2668
+ required :starting_at, Time
2669
+
2670
+ # @!method initialize(amount:, ending_before:, starting_at:)
2671
+ # @param amount [Float]
2672
+ #
2673
+ # @param ending_before [Time] RFC 3339 timestamp (exclusive)
2674
+ #
2675
+ # @param starting_at [Time] RFC 3339 timestamp (inclusive)
2676
+ end
2677
+
2678
+ class RemoveScheduleItem < MetronomeSDK::Internal::Type::BaseModel
2679
+ # @!attribute id
2680
+ #
2681
+ # @return [String]
2682
+ required :id, String
2683
+
2684
+ # @!method initialize(id:)
2685
+ # @param id [String]
2686
+ end
2687
+
2688
+ class UpdateScheduleItem < MetronomeSDK::Internal::Type::BaseModel
2689
+ # @!attribute id
2690
+ #
2691
+ # @return [String]
2692
+ required :id, String
2693
+
2694
+ # @!attribute amount
2695
+ #
2696
+ # @return [Float, nil]
2697
+ optional :amount, Float
2698
+
2699
+ # @!attribute ending_before
2700
+ # RFC 3339 timestamp (exclusive)
2701
+ #
2702
+ # @return [Time, nil]
2703
+ optional :ending_before, Time
2704
+
2705
+ # @!attribute starting_at
2706
+ # RFC 3339 timestamp (inclusive)
2707
+ #
2708
+ # @return [Time, nil]
2709
+ optional :starting_at, Time
2710
+
2711
+ # @!method initialize(id:, amount: nil, ending_before: nil, starting_at: nil)
2712
+ # @param id [String]
2713
+ #
2714
+ # @param amount [Float]
2715
+ #
2716
+ # @param ending_before [Time] RFC 3339 timestamp (exclusive)
2717
+ #
2718
+ # @param starting_at [Time] RFC 3339 timestamp (inclusive)
2719
+ end
2720
+ end
2721
+
2722
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit#invoice_schedule
2723
+ class InvoiceSchedule < MetronomeSDK::Internal::Type::BaseModel
2724
+ # @!attribute add_schedule_items
2725
+ #
2726
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::InvoiceSchedule::AddScheduleItem>, nil]
2727
+ optional :add_schedule_items,
2728
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::InvoiceSchedule::AddScheduleItem] }
2729
+
2730
+ # @!attribute remove_schedule_items
2731
+ #
2732
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::InvoiceSchedule::RemoveScheduleItem>, nil]
2733
+ optional :remove_schedule_items,
2734
+ -> do
2735
+ MetronomeSDK::Internal::Type::ArrayOf[
2736
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::InvoiceSchedule::RemoveScheduleItem
2737
+ ]
2738
+ end
2739
+
2740
+ # @!attribute update_schedule_items
2741
+ #
2742
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::InvoiceSchedule::UpdateScheduleItem>, nil]
2743
+ optional :update_schedule_items,
2744
+ -> do
2745
+ MetronomeSDK::Internal::Type::ArrayOf[
2746
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::InvoiceSchedule::UpdateScheduleItem
2747
+ ]
2748
+ end
2749
+
2750
+ # @!method initialize(add_schedule_items: nil, remove_schedule_items: nil, update_schedule_items: nil)
2751
+ # @param add_schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::InvoiceSchedule::AddScheduleItem>]
2752
+ # @param remove_schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::InvoiceSchedule::RemoveScheduleItem>]
2753
+ # @param update_schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit::InvoiceSchedule::UpdateScheduleItem>]
2754
+
2755
+ class AddScheduleItem < MetronomeSDK::Internal::Type::BaseModel
2756
+ # @!attribute timestamp
2757
+ #
2758
+ # @return [Time]
2759
+ required :timestamp, Time
2760
+
2761
+ # @!attribute amount
2762
+ #
2763
+ # @return [Float, nil]
2764
+ optional :amount, Float
2765
+
2766
+ # @!attribute quantity
2767
+ #
2768
+ # @return [Float, nil]
2769
+ optional :quantity, Float
2770
+
2771
+ # @!attribute unit_price
2772
+ #
2773
+ # @return [Float, nil]
2774
+ optional :unit_price, Float
2775
+
2776
+ # @!method initialize(timestamp:, amount: nil, quantity: nil, unit_price: nil)
2777
+ # @param timestamp [Time]
2778
+ # @param amount [Float]
2779
+ # @param quantity [Float]
2780
+ # @param unit_price [Float]
2781
+ end
2782
+
2783
+ class RemoveScheduleItem < MetronomeSDK::Internal::Type::BaseModel
2784
+ # @!attribute id
2785
+ #
2786
+ # @return [String]
2787
+ required :id, String
2788
+
2789
+ # @!method initialize(id:)
2790
+ # @param id [String]
2791
+ end
2792
+
2793
+ class UpdateScheduleItem < MetronomeSDK::Internal::Type::BaseModel
2794
+ # @!attribute id
2795
+ #
2796
+ # @return [String]
2797
+ required :id, String
2798
+
2799
+ # @!attribute amount
2800
+ #
2801
+ # @return [Float, nil]
2802
+ optional :amount, Float
2803
+
2804
+ # @!attribute quantity
2805
+ #
2806
+ # @return [Float, nil]
2807
+ optional :quantity, Float
2808
+
2809
+ # @!attribute timestamp
2810
+ #
2811
+ # @return [Time, nil]
2812
+ optional :timestamp, Time
2813
+
2814
+ # @!attribute unit_price
2815
+ #
2816
+ # @return [Float, nil]
2817
+ optional :unit_price, Float
2818
+
2819
+ # @!method initialize(id:, amount: nil, quantity: nil, timestamp: nil, unit_price: nil)
2820
+ # @param id [String]
2821
+ # @param amount [Float]
2822
+ # @param quantity [Float]
2823
+ # @param timestamp [Time]
2824
+ # @param unit_price [Float]
2825
+ end
2826
+ end
2827
+
2828
+ # If set, the commit's rate type was updated to the specified value.
2829
+ #
2830
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCommit#rate_type
2831
+ module RateType
2832
+ extend MetronomeSDK::Internal::Type::Enum
2833
+
2834
+ COMMIT_RATE = :COMMIT_RATE
2835
+ LIST_RATE = :LIST_RATE
2836
+
2837
+ # @!method self.values
2838
+ # @return [Array<Symbol>]
2839
+ end
2840
+ end
2841
+
2842
+ class UpdateCredit < MetronomeSDK::Internal::Type::BaseModel
2843
+ # @!attribute id
2844
+ #
2845
+ # @return [String]
2846
+ required :id, String
2847
+
2848
+ # @!attribute access_schedule
2849
+ #
2850
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::AccessSchedule, nil]
2851
+ optional :access_schedule,
2852
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::AccessSchedule }
2853
+
2854
+ # @!attribute applicable_product_ids
2855
+ # Which products the credit applies to. If applicable_product_ids,
2856
+ # applicable_product_tags or specifiers are not provided, the credit applies to
2857
+ # all products.
2858
+ #
2859
+ # @return [Array<String>, nil]
2860
+ optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String], nil?: true
2861
+
2862
+ # @!attribute applicable_product_tags
2863
+ # Which tags the credit applies to. If applicable_product_ids,
2864
+ # applicable_product_tags or specifiers are not provided, the credit applies to
2865
+ # all products.
2866
+ #
2867
+ # @return [Array<String>, nil]
2868
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String], nil?: true
2869
+
2870
+ # @!attribute description
2871
+ #
2872
+ # @return [String, nil]
2873
+ optional :description, String
2874
+
2875
+ # @!attribute hierarchy_configuration
2876
+ # Optional configuration for credit hierarchy access control
2877
+ #
2878
+ # @return [MetronomeSDK::Models::CommitHierarchyConfiguration, nil]
2879
+ optional :hierarchy_configuration, -> { MetronomeSDK::CommitHierarchyConfiguration }
2880
+
2881
+ # @!attribute name
2882
+ #
2883
+ # @return [String, nil]
2884
+ optional :name, String
2885
+
2886
+ # @!attribute netsuite_sales_order_id
2887
+ #
2888
+ # @return [String, nil]
2889
+ optional :netsuite_sales_order_id, String, nil?: true
2890
+
2891
+ # @!attribute priority
2892
+ # If multiple credits are applicable, the one with the lower priority will apply
2893
+ # first.
2894
+ #
2895
+ # @return [Float, nil]
2896
+ optional :priority, Float, nil?: true
2897
+
2898
+ # @!attribute product_id
2899
+ #
2900
+ # @return [String, nil]
2901
+ optional :product_id, String
2902
+
2903
+ # @!attribute rate_type
2904
+ # If set, the credit's rate type was updated to the specified value.
2905
+ #
2906
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::RateType, nil]
2907
+ optional :rate_type,
2908
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::RateType }
2909
+
2910
+ # @!attribute rollover_fraction
2911
+ #
2912
+ # @return [Float, nil]
2913
+ optional :rollover_fraction, Float, nil?: true
2914
+
2915
+ # @!attribute specifiers
2916
+ # List of filters that determine what kind of customer usage draws down a commit
2917
+ # or credit. A customer's usage needs to meet the condition of at least one of the
2918
+ # specifiers to contribute to a commit's or credit's drawdown. This field cannot
2919
+ # be used together with `applicable_product_ids` or `applicable_product_tags`.
2920
+ # Instead, to target usage by product or product tag, pass those values in the
2921
+ # body of `specifiers`.
2922
+ #
2923
+ # @return [Array<MetronomeSDK::Models::CommitSpecifierInput>, nil]
2924
+ optional :specifiers,
2925
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifierInput] },
2926
+ nil?: true
2927
+
2928
+ # @!method initialize(id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, description: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, product_id: nil, rate_type: nil, rollover_fraction: nil, specifiers: nil)
2929
+ # Some parameter documentations has been truncated, see
2930
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit} for
2931
+ # more details.
2932
+ #
2933
+ # @param id [String]
2934
+ #
2935
+ # @param access_schedule [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::AccessSchedule]
2936
+ #
2937
+ # @param applicable_product_ids [Array<String>, nil] Which products the credit applies to. If applicable_product_ids, applicable_prod
2938
+ #
2939
+ # @param applicable_product_tags [Array<String>, nil] Which tags the credit applies to. If applicable*product_ids, applicable_product*
2940
+ #
2941
+ # @param description [String]
2942
+ #
2943
+ # @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for credit hierarchy access control
2944
+ #
2945
+ # @param name [String]
2946
+ #
2947
+ # @param netsuite_sales_order_id [String, nil]
2948
+ #
2949
+ # @param priority [Float, nil] If multiple credits are applicable, the one with the lower priority will apply f
2950
+ #
2951
+ # @param product_id [String]
2952
+ #
2953
+ # @param rate_type [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::RateType] If set, the credit's rate type was updated to the specified value.
2954
+ #
2955
+ # @param rollover_fraction [Float, nil]
2956
+ #
2957
+ # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifierInput>, nil] List of filters that determine what kind of customer usage draws down a commit o
2958
+
2959
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit#access_schedule
2960
+ class AccessSchedule < MetronomeSDK::Internal::Type::BaseModel
2961
+ # @!attribute add_schedule_items
2962
+ #
2963
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::AccessSchedule::AddScheduleItem>, nil]
2964
+ optional :add_schedule_items,
2965
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::AccessSchedule::AddScheduleItem] }
2966
+
2967
+ # @!attribute remove_schedule_items
2968
+ #
2969
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::AccessSchedule::RemoveScheduleItem>, nil]
2970
+ optional :remove_schedule_items,
2971
+ -> do
2972
+ MetronomeSDK::Internal::Type::ArrayOf[
2973
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::AccessSchedule::RemoveScheduleItem
2974
+ ]
2975
+ end
2976
+
2977
+ # @!attribute update_schedule_items
2978
+ #
2979
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::AccessSchedule::UpdateScheduleItem>, nil]
2980
+ optional :update_schedule_items,
2981
+ -> do
2982
+ MetronomeSDK::Internal::Type::ArrayOf[
2983
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::AccessSchedule::UpdateScheduleItem
2984
+ ]
2985
+ end
2986
+
2987
+ # @!method initialize(add_schedule_items: nil, remove_schedule_items: nil, update_schedule_items: nil)
2988
+ # @param add_schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::AccessSchedule::AddScheduleItem>]
2989
+ # @param remove_schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::AccessSchedule::RemoveScheduleItem>]
2990
+ # @param update_schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit::AccessSchedule::UpdateScheduleItem>]
2991
+
2992
+ class AddScheduleItem < MetronomeSDK::Internal::Type::BaseModel
2993
+ # @!attribute amount
2994
+ #
2995
+ # @return [Float]
2996
+ required :amount, Float
2997
+
2998
+ # @!attribute ending_before
2999
+ # RFC 3339 timestamp (exclusive)
3000
+ #
3001
+ # @return [Time]
3002
+ required :ending_before, Time
3003
+
3004
+ # @!attribute starting_at
3005
+ # RFC 3339 timestamp (inclusive)
3006
+ #
3007
+ # @return [Time]
3008
+ required :starting_at, Time
3009
+
3010
+ # @!method initialize(amount:, ending_before:, starting_at:)
3011
+ # @param amount [Float]
3012
+ #
3013
+ # @param ending_before [Time] RFC 3339 timestamp (exclusive)
3014
+ #
3015
+ # @param starting_at [Time] RFC 3339 timestamp (inclusive)
3016
+ end
3017
+
3018
+ class RemoveScheduleItem < MetronomeSDK::Internal::Type::BaseModel
3019
+ # @!attribute id
3020
+ #
3021
+ # @return [String]
3022
+ required :id, String
3023
+
3024
+ # @!method initialize(id:)
3025
+ # @param id [String]
3026
+ end
3027
+
3028
+ class UpdateScheduleItem < MetronomeSDK::Internal::Type::BaseModel
3029
+ # @!attribute id
3030
+ #
3031
+ # @return [String]
3032
+ required :id, String
3033
+
3034
+ # @!attribute amount
3035
+ #
3036
+ # @return [Float, nil]
3037
+ optional :amount, Float
3038
+
3039
+ # @!attribute ending_before
3040
+ # RFC 3339 timestamp (exclusive)
3041
+ #
3042
+ # @return [Time, nil]
3043
+ optional :ending_before, Time
3044
+
3045
+ # @!attribute starting_at
3046
+ # RFC 3339 timestamp (inclusive)
3047
+ #
3048
+ # @return [Time, nil]
3049
+ optional :starting_at, Time
3050
+
3051
+ # @!method initialize(id:, amount: nil, ending_before: nil, starting_at: nil)
3052
+ # @param id [String]
3053
+ #
3054
+ # @param amount [Float]
3055
+ #
3056
+ # @param ending_before [Time] RFC 3339 timestamp (exclusive)
3057
+ #
3058
+ # @param starting_at [Time] RFC 3339 timestamp (inclusive)
3059
+ end
3060
+ end
3061
+
3062
+ # If set, the credit's rate type was updated to the specified value.
3063
+ #
3064
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateCredit#rate_type
3065
+ module RateType
3066
+ extend MetronomeSDK::Internal::Type::Enum
3067
+
3068
+ LIST_RATE = :LIST_RATE
3069
+ COMMIT_RATE = :COMMIT_RATE
3070
+
3071
+ # @!method self.values
3072
+ # @return [Array<Symbol>]
3073
+ end
3074
+ end
3075
+
3076
+ class UpdateDiscount < MetronomeSDK::Internal::Type::BaseModel
3077
+ # @!attribute id
3078
+ #
3079
+ # @return [String]
3080
+ required :id, String
3081
+
3082
+ # @!attribute custom_fields
3083
+ # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
3084
+ #
3085
+ # @return [Hash{Symbol=>String}, nil]
3086
+ optional :custom_fields, MetronomeSDK::Internal::Type::HashOf[String]
3087
+
3088
+ # @!attribute name
3089
+ #
3090
+ # @return [String, nil]
3091
+ optional :name, String
3092
+
3093
+ # @!attribute netsuite_sales_order_id
3094
+ #
3095
+ # @return [String, nil]
3096
+ optional :netsuite_sales_order_id, String
3097
+
3098
+ # @!attribute schedule
3099
+ # Must provide either schedule_items or recurring_schedule.
3100
+ #
3101
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule, nil]
3102
+ optional :schedule,
3103
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule }
3104
+
3105
+ # @!method initialize(id:, custom_fields: nil, name: nil, netsuite_sales_order_id: nil, schedule: nil)
3106
+ # @param id [String]
3107
+ #
3108
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
3109
+ #
3110
+ # @param name [String]
3111
+ #
3112
+ # @param netsuite_sales_order_id [String]
3113
+ #
3114
+ # @param schedule [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule] Must provide either schedule_items or recurring_schedule.
3115
+
3116
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount#schedule
3117
+ class Schedule < MetronomeSDK::Internal::Type::BaseModel
3118
+ # @!attribute credit_type_id
3119
+ # Defaults to USD (cents) if not passed.
3120
+ #
3121
+ # @return [String, nil]
3122
+ optional :credit_type_id, String
3123
+
3124
+ # @!attribute do_not_invoice
3125
+ # This field is only applicable to commit invoice schedules. If true, this
3126
+ # schedule will not generate an invoice.
3127
+ #
3128
+ # @return [Boolean, nil]
3129
+ optional :do_not_invoice, MetronomeSDK::Internal::Type::Boolean
3130
+
3131
+ # @!attribute recurring_schedule
3132
+ # Enter the unit price and quantity for the charge or instead only send the
3133
+ # amount. If amount is sent, the unit price is assumed to be the amount and
3134
+ # quantity is inferred to be 1.
3135
+ #
3136
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::RecurringSchedule, nil]
3137
+ optional :recurring_schedule,
3138
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::RecurringSchedule }
3139
+
3140
+ # @!attribute schedule_items
3141
+ # Either provide amount or provide both unit_price and quantity.
3142
+ #
3143
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::ScheduleItem>, nil]
3144
+ optional :schedule_items,
3145
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::ScheduleItem] }
3146
+
3147
+ # @!method initialize(credit_type_id: nil, do_not_invoice: nil, recurring_schedule: nil, schedule_items: nil)
3148
+ # Some parameter documentations has been truncated, see
3149
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule}
3150
+ # for more details.
3151
+ #
3152
+ # Must provide either schedule_items or recurring_schedule.
3153
+ #
3154
+ # @param credit_type_id [String] Defaults to USD (cents) if not passed.
3155
+ #
3156
+ # @param do_not_invoice [Boolean] This field is only applicable to commit invoice schedules. If true, this schedul
3157
+ #
3158
+ # @param recurring_schedule [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::RecurringSchedule] Enter the unit price and quantity for the charge or instead only send the amount
3159
+ #
3160
+ # @param schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::ScheduleItem>] Either provide amount or provide both unit_price and quantity.
3161
+
3162
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule#recurring_schedule
3163
+ class RecurringSchedule < MetronomeSDK::Internal::Type::BaseModel
3164
+ # @!attribute amount_distribution
3165
+ #
3166
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::RecurringSchedule::AmountDistribution]
3167
+ required :amount_distribution,
3168
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::RecurringSchedule::AmountDistribution }
3169
+
3170
+ # @!attribute ending_before
3171
+ # RFC 3339 timestamp (exclusive).
3172
+ #
3173
+ # @return [Time]
3174
+ required :ending_before, Time
3175
+
3176
+ # @!attribute frequency
3177
+ #
3178
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::RecurringSchedule::Frequency]
3179
+ required :frequency,
3180
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::RecurringSchedule::Frequency }
3181
+
3182
+ # @!attribute starting_at
3183
+ # RFC 3339 timestamp (inclusive).
3184
+ #
3185
+ # @return [Time]
3186
+ required :starting_at, Time
3187
+
3188
+ # @!attribute amount
3189
+ # Amount for the charge. Can be provided instead of unit_price and quantity. If
3190
+ # amount is sent, the unit_price is assumed to be the amount and quantity is
3191
+ # inferred to be 1.
3192
+ #
3193
+ # @return [Float, nil]
3194
+ optional :amount, Float
3195
+
3196
+ # @!attribute quantity
3197
+ # Quantity for the charge. Will be multiplied by unit_price to determine the
3198
+ # amount and must be specified with unit_price. If specified amount cannot be
3199
+ # provided.
3200
+ #
3201
+ # @return [Float, nil]
3202
+ optional :quantity, Float
3203
+
3204
+ # @!attribute unit_price
3205
+ # Unit price for the charge. Will be multiplied by quantity to determine the
3206
+ # amount and must be specified with quantity. If specified amount cannot be
3207
+ # provided.
3208
+ #
3209
+ # @return [Float, nil]
3210
+ optional :unit_price, Float
3211
+
3212
+ # @!method initialize(amount_distribution:, ending_before:, frequency:, starting_at:, amount: nil, quantity: nil, unit_price: nil)
3213
+ # Some parameter documentations has been truncated, see
3214
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::RecurringSchedule}
3215
+ # for more details.
3216
+ #
3217
+ # Enter the unit price and quantity for the charge or instead only send the
3218
+ # amount. If amount is sent, the unit price is assumed to be the amount and
3219
+ # quantity is inferred to be 1.
3220
+ #
3221
+ # @param amount_distribution [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::RecurringSchedule::AmountDistribution]
3222
+ #
3223
+ # @param ending_before [Time] RFC 3339 timestamp (exclusive).
3224
+ #
3225
+ # @param frequency [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::RecurringSchedule::Frequency]
3226
+ #
3227
+ # @param starting_at [Time] RFC 3339 timestamp (inclusive).
3228
+ #
3229
+ # @param amount [Float] Amount for the charge. Can be provided instead of unit_price and quantity. If am
3230
+ #
3231
+ # @param quantity [Float] Quantity for the charge. Will be multiplied by unit_price to determine the amoun
3232
+ #
3233
+ # @param unit_price [Float] Unit price for the charge. Will be multiplied by quantity to determine the amoun
3234
+
3235
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::RecurringSchedule#amount_distribution
3236
+ module AmountDistribution
3237
+ extend MetronomeSDK::Internal::Type::Enum
3238
+
3239
+ DIVIDED = :DIVIDED
3240
+ DIVIDED_ROUNDED = :DIVIDED_ROUNDED
3241
+ EACH = :EACH
3242
+
3243
+ # @!method self.values
3244
+ # @return [Array<Symbol>]
3245
+ end
3246
+
3247
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::RecurringSchedule#frequency
3248
+ module Frequency
3249
+ extend MetronomeSDK::Internal::Type::Enum
3250
+
3251
+ MONTHLY = :MONTHLY
3252
+ QUARTERLY = :QUARTERLY
3253
+ SEMI_ANNUAL = :SEMI_ANNUAL
3254
+ ANNUAL = :ANNUAL
3255
+ WEEKLY = :WEEKLY
3256
+
3257
+ # @!method self.values
3258
+ # @return [Array<Symbol>]
3259
+ end
3260
+ end
3261
+
3262
+ class ScheduleItem < MetronomeSDK::Internal::Type::BaseModel
3263
+ # @!attribute timestamp
3264
+ # timestamp of the scheduled event
3265
+ #
3266
+ # @return [Time]
3267
+ required :timestamp, Time
3268
+
3269
+ # @!attribute amount
3270
+ # Amount for the charge. Can be provided instead of unit_price and quantity. If
3271
+ # amount is sent, the unit_price is assumed to be the amount and quantity is
3272
+ # inferred to be 1.
3273
+ #
3274
+ # @return [Float, nil]
3275
+ optional :amount, Float
3276
+
3277
+ # @!attribute quantity
3278
+ # Quantity for the charge. Will be multiplied by unit_price to determine the
3279
+ # amount and must be specified with unit_price. If specified amount cannot be
3280
+ # provided.
3281
+ #
3282
+ # @return [Float, nil]
3283
+ optional :quantity, Float
3284
+
3285
+ # @!attribute unit_price
3286
+ # Unit price for the charge. Will be multiplied by quantity to determine the
3287
+ # amount and must be specified with quantity. If specified amount cannot be
3288
+ # provided.
3289
+ #
3290
+ # @return [Float, nil]
3291
+ optional :unit_price, Float
3292
+
3293
+ # @!method initialize(timestamp:, amount: nil, quantity: nil, unit_price: nil)
3294
+ # Some parameter documentations has been truncated, see
3295
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateDiscount::Schedule::ScheduleItem}
3296
+ # for more details.
3297
+ #
3298
+ # @param timestamp [Time] timestamp of the scheduled event
3299
+ #
3300
+ # @param amount [Float] Amount for the charge. Can be provided instead of unit_price and quantity. If am
3301
+ #
3302
+ # @param quantity [Float] Quantity for the charge. Will be multiplied by unit_price to determine the amoun
3303
+ #
3304
+ # @param unit_price [Float] Unit price for the charge. Will be multiplied by quantity to determine the amoun
3305
+ end
3306
+ end
3307
+ end
3308
+
3309
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit#update_prepaid_balance_threshold_configuration
3310
+ class UpdatePrepaidBalanceThresholdConfiguration < MetronomeSDK::Internal::Type::BaseModel
3311
+ # @!attribute commit
3312
+ #
3313
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::Commit, nil]
3314
+ optional :commit,
3315
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::Commit }
3316
+
3317
+ # @!attribute custom_credit_type_id
3318
+ # If provided, the threshold, recharge-to amount, and the resulting threshold
3319
+ # commit amount will be in terms of this credit type instead of the fiat currency.
3320
+ #
3321
+ # @return [String, nil]
3322
+ optional :custom_credit_type_id, String, nil?: true
3323
+
3324
+ # @!attribute discount_configuration
3325
+ #
3326
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::DiscountConfiguration, nil]
3327
+ optional :discount_configuration,
3328
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::DiscountConfiguration },
3329
+ nil?: true
3330
+
3331
+ # @!attribute is_enabled
3332
+ # When set to false, the contract will not be evaluated against the
3333
+ # threshold_amount. Toggling to true will result an immediate evaluation,
3334
+ # regardless of prior state.
3335
+ #
3336
+ # @return [Boolean, nil]
3337
+ optional :is_enabled, MetronomeSDK::Internal::Type::Boolean
3338
+
3339
+ # @!attribute payment_gate_config
3340
+ #
3341
+ # @return [MetronomeSDK::Models::PaymentGateConfigV2, nil]
3342
+ optional :payment_gate_config, -> { MetronomeSDK::PaymentGateConfigV2 }
3343
+
3344
+ # @!attribute recharge_to_amount
3345
+ # Specify the amount the balance should be recharged to.
3346
+ #
3347
+ # @return [Float, nil]
3348
+ optional :recharge_to_amount, Float
3349
+
3350
+ # @!attribute threshold_amount
3351
+ # Specify the threshold amount for the contract. Each time the contract's balance
3352
+ # lowers to this amount, a threshold charge will be initiated.
3353
+ #
3354
+ # @return [Float, nil]
3355
+ optional :threshold_amount, Float
3356
+
3357
+ # @!attribute threshold_balance_specifiers
3358
+ # Determines which balances are excluded from remaining balance calculation for
3359
+ # threshold billing.
3360
+ #
3361
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier>, nil]
3362
+ optional :threshold_balance_specifiers,
3363
+ -> do
3364
+ MetronomeSDK::Internal::Type::ArrayOf[
3365
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier
3366
+ ]
3367
+ end,
3368
+ nil?: true
3369
+
3370
+ # @!method initialize(commit: nil, custom_credit_type_id: nil, discount_configuration: nil, is_enabled: nil, payment_gate_config: nil, recharge_to_amount: nil, threshold_amount: nil, threshold_balance_specifiers: nil)
3371
+ # Some parameter documentations has been truncated, see
3372
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration}
3373
+ # for more details.
3374
+ #
3375
+ # @param commit [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::Commit]
3376
+ #
3377
+ # @param custom_credit_type_id [String, nil] If provided, the threshold, recharge-to amount, and the resulting threshold comm
3378
+ #
3379
+ # @param discount_configuration [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::DiscountConfiguration, nil]
3380
+ #
3381
+ # @param is_enabled [Boolean] When set to false, the contract will not be evaluated against the threshold_amou
3382
+ #
3383
+ # @param payment_gate_config [MetronomeSDK::Models::PaymentGateConfigV2]
3384
+ #
3385
+ # @param recharge_to_amount [Float] Specify the amount the balance should be recharged to.
3386
+ #
3387
+ # @param threshold_amount [Float] Specify the threshold amount for the contract. Each time the contract's balance
3388
+ #
3389
+ # @param threshold_balance_specifiers [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier>, nil] Determines which balances are excluded from remaining balance calculation for th
3390
+
3391
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration#commit
3392
+ class Commit < MetronomeSDK::Models::UpdateBaseThresholdCommit
3393
+ # @!attribute applicable_product_ids
3394
+ # Which products the threshold commit applies to. If both applicable_product_ids
3395
+ # and applicable_product_tags are not provided, the commit applies to all
3396
+ # products.
3397
+ #
3398
+ # @return [Array<String>, nil]
3399
+ optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String], nil?: true
3400
+
3401
+ # @!attribute applicable_product_tags
3402
+ # Which tags the threshold commit applies to. If both applicable_product_ids and
3403
+ # applicable_product_tags are not provided, the commit applies to all products.
3404
+ #
3405
+ # @return [Array<String>, nil]
3406
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String], nil?: true
3407
+
3408
+ # @!attribute specifiers
3409
+ # List of filters that determine what kind of customer usage draws down a commit
3410
+ # or credit. A customer's usage needs to meet the condition of at least one of the
3411
+ # specifiers to contribute to a commit's or credit's drawdown. This field cannot
3412
+ # be used together with `applicable_product_ids` or `applicable_product_tags`.
3413
+ # Instead, to target usage by product or product tag, pass those values in the
3414
+ # body of `specifiers`.
3415
+ #
3416
+ # @return [Array<MetronomeSDK::Models::CommitSpecifierInput>, nil]
3417
+ optional :specifiers,
3418
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifierInput] },
3419
+ nil?: true
3420
+
3421
+ # @!method initialize(applicable_product_ids: nil, applicable_product_tags: nil, specifiers: nil)
3422
+ # Some parameter documentations has been truncated, see
3423
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::Commit}
3424
+ # for more details.
3425
+ #
3426
+ # @param applicable_product_ids [Array<String>, nil] Which products the threshold commit applies to. If both applicable_product_ids a
3427
+ #
3428
+ # @param applicable_product_tags [Array<String>, nil] Which tags the threshold commit applies to. If both applicable_product_ids and a
3429
+ #
3430
+ # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifierInput>, nil] List of filters that determine what kind of customer usage draws down a commit o
3431
+ end
3432
+
3433
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration#discount_configuration
3434
+ class DiscountConfiguration < MetronomeSDK::Internal::Type::BaseModel
3435
+ # @!attribute cap
3436
+ # Update the discount cap. Set to null to remove an existing cap.
3437
+ #
3438
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::DiscountConfiguration::Cap, nil]
3439
+ optional :cap,
3440
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::DiscountConfiguration::Cap },
3441
+ nil?: true
3442
+
3443
+ # @!attribute payment_fraction
3444
+ # The fraction of the original amount that the customer pays after applying the
3445
+ # discount. Set to null to remove the discount fraction. For example, 0.85 means
3446
+ # the customer pays 85% of the original amount (a 15% discount).
3447
+ #
3448
+ # @return [Float, nil]
3449
+ optional :payment_fraction, Float, nil?: true
3450
+
3451
+ # @!method initialize(cap: nil, payment_fraction: nil)
3452
+ # Some parameter documentations has been truncated, see
3453
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::DiscountConfiguration}
3454
+ # for more details.
3455
+ #
3456
+ # @param cap [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::DiscountConfiguration::Cap, nil] Update the discount cap. Set to null to remove an existing cap.
3457
+ #
3458
+ # @param payment_fraction [Float, nil] The fraction of the original amount that the customer pays after applying the di
3459
+
3460
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::DiscountConfiguration#cap
3461
+ class Cap < MetronomeSDK::Internal::Type::BaseModel
3462
+ # @!attribute amount
3463
+ # Accumulated spend ceiling above which the discount stops applying.
3464
+ #
3465
+ # @return [Float]
3466
+ required :amount, Float
3467
+
3468
+ # @!attribute spend_tracker_alias
3469
+ # Alias of the spend tracker this cap is measured against.
3470
+ #
3471
+ # @return [String]
3472
+ required :spend_tracker_alias, String
3473
+
3474
+ # @!method initialize(amount:, spend_tracker_alias:)
3475
+ # Update the discount cap. Set to null to remove an existing cap.
3476
+ #
3477
+ # @param amount [Float] Accumulated spend ceiling above which the discount stops applying.
3478
+ #
3479
+ # @param spend_tracker_alias [String] Alias of the spend tracker this cap is measured against.
3480
+ end
3481
+ end
3482
+
3483
+ class ThresholdBalanceSpecifier < MetronomeSDK::Internal::Type::BaseModel
3484
+ # @!attribute exclude
3485
+ #
3486
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude>]
3487
+ required :exclude,
3488
+ -> do
3489
+ MetronomeSDK::Internal::Type::ArrayOf[
3490
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude
3491
+ ]
3492
+ end
3493
+
3494
+ # @!method initialize(exclude:)
3495
+ # @param exclude [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude>]
3496
+
3497
+ class Exclude < MetronomeSDK::Internal::Type::BaseModel
3498
+ # @!attribute custom_field_filters
3499
+ #
3500
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter>]
3501
+ required :custom_field_filters,
3502
+ -> do
3503
+ MetronomeSDK::Internal::Type::ArrayOf[
3504
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter
3505
+ ]
3506
+ end
3507
+
3508
+ # @!method initialize(custom_field_filters:)
3509
+ # @param custom_field_filters [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter>]
3510
+
3511
+ class CustomFieldFilter < MetronomeSDK::Internal::Type::BaseModel
3512
+ # @!attribute entity
3513
+ #
3514
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter::Entity]
3515
+ required :entity,
3516
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter::Entity }
3517
+
3518
+ # @!attribute key
3519
+ #
3520
+ # @return [String]
3521
+ required :key, String
3522
+
3523
+ # @!attribute value
3524
+ #
3525
+ # @return [String]
3526
+ required :value, String
3527
+
3528
+ # @!method initialize(entity:, key:, value:)
3529
+ # @param entity [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter::Entity]
3530
+ # @param key [String]
3531
+ # @param value [String]
3532
+
3533
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdatePrepaidBalanceThresholdConfiguration::ThresholdBalanceSpecifier::Exclude::CustomFieldFilter#entity
3534
+ module Entity
3535
+ extend MetronomeSDK::Internal::Type::Enum
3536
+
3537
+ COMMIT = :Commit
3538
+ CONTRACT_CREDIT = :ContractCredit
3539
+ CONTRACT_CREDIT_OR_COMMIT = :ContractCreditOrCommit
3540
+
3541
+ # @!method self.values
3542
+ # @return [Array<Symbol>]
3543
+ end
3544
+ end
3545
+ end
3546
+ end
3547
+ end
3548
+
3549
+ class UpdateRecurringCommit < MetronomeSDK::Internal::Type::BaseModel
3550
+ # @!attribute id
3551
+ #
3552
+ # @return [String]
3553
+ required :id, String
3554
+
3555
+ # @!attribute access_amount
3556
+ #
3557
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::AccessAmount, nil]
3558
+ optional :access_amount,
3559
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::AccessAmount }
3560
+
3561
+ # @!attribute ending_before
3562
+ #
3563
+ # @return [Time, nil]
3564
+ optional :ending_before, Time
3565
+
3566
+ # @!attribute invoice_amount
3567
+ #
3568
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::InvoiceAmount, nil]
3569
+ optional :invoice_amount,
3570
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::InvoiceAmount }
3571
+
3572
+ # @!attribute proration_rounding
3573
+ # Rounding configuration for prorated recurring commit amounts.
3574
+ #
3575
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding, nil]
3576
+ optional :proration_rounding,
3577
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding },
3578
+ nil?: true
3579
+
3580
+ # @!attribute rate_type
3581
+ #
3582
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::RateType, nil]
3583
+ optional :rate_type,
3584
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::RateType }
3585
+
3586
+ # @!method initialize(id:, access_amount: nil, ending_before: nil, invoice_amount: nil, proration_rounding: nil, rate_type: nil)
3587
+ # @param id [String]
3588
+ #
3589
+ # @param access_amount [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::AccessAmount]
3590
+ #
3591
+ # @param ending_before [Time]
3592
+ #
3593
+ # @param invoice_amount [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::InvoiceAmount]
3594
+ #
3595
+ # @param proration_rounding [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding, nil] Rounding configuration for prorated recurring commit amounts.
3596
+ #
3597
+ # @param rate_type [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::RateType]
3598
+
3599
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit#access_amount
3600
+ class AccessAmount < MetronomeSDK::Internal::Type::BaseModel
3601
+ # @!attribute quantity
3602
+ #
3603
+ # @return [Float, nil]
3604
+ optional :quantity, Float
3605
+
3606
+ # @!attribute unit_price
3607
+ #
3608
+ # @return [Float, nil]
3609
+ optional :unit_price, Float
3610
+
3611
+ # @!method initialize(quantity: nil, unit_price: nil)
3612
+ # @param quantity [Float]
3613
+ # @param unit_price [Float]
3614
+ end
3615
+
3616
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit#invoice_amount
3617
+ class InvoiceAmount < MetronomeSDK::Internal::Type::BaseModel
3618
+ # @!attribute quantity
3619
+ #
3620
+ # @return [Float, nil]
3621
+ optional :quantity, Float
3622
+
3623
+ # @!attribute unit_price
3624
+ #
3625
+ # @return [Float, nil]
3626
+ optional :unit_price, Float
3627
+
3628
+ # @!method initialize(quantity: nil, unit_price: nil)
3629
+ # @param quantity [Float]
3630
+ # @param unit_price [Float]
3631
+ end
3632
+
3633
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit#proration_rounding
3634
+ class ProrationRounding < MetronomeSDK::Internal::Type::BaseModel
3635
+ # @!attribute access
3636
+ #
3637
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Access, nil]
3638
+ optional :access,
3639
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Access }
3640
+
3641
+ # @!attribute invoice
3642
+ #
3643
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Invoice, nil]
3644
+ optional :invoice,
3645
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Invoice }
3646
+
3647
+ # @!method initialize(access: nil, invoice: nil)
3648
+ # Rounding configuration for prorated recurring commit amounts.
3649
+ #
3650
+ # @param access [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Access]
3651
+ # @param invoice [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Invoice]
3652
+
3653
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding#access
3654
+ class Access < MetronomeSDK::Internal::Type::BaseModel
3655
+ # @!attribute decimal_places
3656
+ # Number of decimal places to round to. Applied directly to the stored monetary
3657
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
3658
+ # nearest 100 in the stored unit).
3659
+ #
3660
+ # @return [Float]
3661
+ required :decimal_places, Float
3662
+
3663
+ # @!attribute rounding_method
3664
+ #
3665
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Access::RoundingMethod]
3666
+ required :rounding_method,
3667
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Access::RoundingMethod }
3668
+
3669
+ # @!method initialize(decimal_places:, rounding_method:)
3670
+ # Some parameter documentations has been truncated, see
3671
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Access}
3672
+ # for more details.
3673
+ #
3674
+ # @param decimal_places [Float] Number of decimal places to round to. Applied directly to the stored monetary re
3675
+ #
3676
+ # @param rounding_method [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Access::RoundingMethod]
3677
+
3678
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Access#rounding_method
3679
+ module RoundingMethod
3680
+ extend MetronomeSDK::Internal::Type::Enum
3681
+
3682
+ HALF_UP = :HALF_UP
3683
+ FLOOR = :FLOOR
3684
+ CEILING = :CEILING
3685
+
3686
+ # @!method self.values
3687
+ # @return [Array<Symbol>]
3688
+ end
3689
+ end
3690
+
3691
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding#invoice
3692
+ class Invoice < MetronomeSDK::Internal::Type::BaseModel
3693
+ # @!attribute decimal_places
3694
+ # Number of decimal places to round to. Applied directly to the stored monetary
3695
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
3696
+ # nearest 100 in the stored unit).
3697
+ #
3698
+ # @return [Float]
3699
+ required :decimal_places, Float
3700
+
3701
+ # @!attribute rounding_method
3702
+ #
3703
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Invoice::RoundingMethod]
3704
+ required :rounding_method,
3705
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Invoice::RoundingMethod }
3706
+
3707
+ # @!method initialize(decimal_places:, rounding_method:)
3708
+ # Some parameter documentations has been truncated, see
3709
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Invoice}
3710
+ # for more details.
3711
+ #
3712
+ # @param decimal_places [Float] Number of decimal places to round to. Applied directly to the stored monetary re
3713
+ #
3714
+ # @param rounding_method [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Invoice::RoundingMethod]
3715
+
3716
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit::ProrationRounding::Invoice#rounding_method
3717
+ module RoundingMethod
3718
+ extend MetronomeSDK::Internal::Type::Enum
3719
+
3720
+ HALF_UP = :HALF_UP
3721
+ FLOOR = :FLOOR
3722
+ CEILING = :CEILING
3723
+
3724
+ # @!method self.values
3725
+ # @return [Array<Symbol>]
3726
+ end
3727
+ end
3728
+ end
3729
+
3730
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCommit#rate_type
3731
+ module RateType
3732
+ extend MetronomeSDK::Internal::Type::Enum
3733
+
3734
+ LIST_RATE = :LIST_RATE
3735
+ COMMIT_RATE = :COMMIT_RATE
3736
+
3737
+ # @!method self.values
3738
+ # @return [Array<Symbol>]
3739
+ end
3740
+ end
3741
+
3742
+ class UpdateRecurringCredit < MetronomeSDK::Internal::Type::BaseModel
3743
+ # @!attribute id
3744
+ #
3745
+ # @return [String]
3746
+ required :id, String
3747
+
3748
+ # @!attribute access_amount
3749
+ #
3750
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::AccessAmount, nil]
3751
+ optional :access_amount,
3752
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::AccessAmount }
3753
+
3754
+ # @!attribute ending_before
3755
+ #
3756
+ # @return [Time, nil]
3757
+ optional :ending_before, Time
3758
+
3759
+ # @!attribute proration_rounding
3760
+ # Rounding configuration for prorated recurring credit amounts.
3761
+ #
3762
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::ProrationRounding, nil]
3763
+ optional :proration_rounding,
3764
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::ProrationRounding },
3765
+ nil?: true
3766
+
3767
+ # @!attribute rate_type
3768
+ #
3769
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::RateType, nil]
3770
+ optional :rate_type,
3771
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::RateType }
3772
+
3773
+ # @!method initialize(id:, access_amount: nil, ending_before: nil, proration_rounding: nil, rate_type: nil)
3774
+ # @param id [String]
3775
+ #
3776
+ # @param access_amount [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::AccessAmount]
3777
+ #
3778
+ # @param ending_before [Time]
3779
+ #
3780
+ # @param proration_rounding [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::ProrationRounding, nil] Rounding configuration for prorated recurring credit amounts.
3781
+ #
3782
+ # @param rate_type [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::RateType]
3783
+
3784
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit#access_amount
3785
+ class AccessAmount < MetronomeSDK::Internal::Type::BaseModel
3786
+ # @!attribute quantity
3787
+ #
3788
+ # @return [Float, nil]
3789
+ optional :quantity, Float
3790
+
3791
+ # @!attribute unit_price
3792
+ #
3793
+ # @return [Float, nil]
3794
+ optional :unit_price, Float
3795
+
3796
+ # @!method initialize(quantity: nil, unit_price: nil)
3797
+ # @param quantity [Float]
3798
+ # @param unit_price [Float]
3799
+ end
3800
+
3801
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit#proration_rounding
3802
+ class ProrationRounding < MetronomeSDK::Internal::Type::BaseModel
3803
+ # @!attribute access
3804
+ #
3805
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::ProrationRounding::Access, nil]
3806
+ optional :access,
3807
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::ProrationRounding::Access }
3808
+
3809
+ # @!method initialize(access: nil)
3810
+ # Rounding configuration for prorated recurring credit amounts.
3811
+ #
3812
+ # @param access [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::ProrationRounding::Access]
3813
+
3814
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::ProrationRounding#access
3815
+ class Access < MetronomeSDK::Internal::Type::BaseModel
3816
+ # @!attribute decimal_places
3817
+ # Number of decimal places to round to. Applied directly to the stored monetary
3818
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
3819
+ # nearest 100 in the stored unit).
3820
+ #
3821
+ # @return [Float]
3822
+ required :decimal_places, Float
3823
+
3824
+ # @!attribute rounding_method
3825
+ #
3826
+ # @return [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::ProrationRounding::Access::RoundingMethod]
3827
+ required :rounding_method,
3828
+ enum: -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::ProrationRounding::Access::RoundingMethod }
3829
+
3830
+ # @!method initialize(decimal_places:, rounding_method:)
3831
+ # Some parameter documentations has been truncated, see
3832
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::ProrationRounding::Access}
3833
+ # for more details.
3834
+ #
3835
+ # @param decimal_places [Float] Number of decimal places to round to. Applied directly to the stored monetary re
3836
+ #
3837
+ # @param rounding_method [Symbol, MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::ProrationRounding::Access::RoundingMethod]
3838
+
3839
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit::ProrationRounding::Access#rounding_method
3840
+ module RoundingMethod
3841
+ extend MetronomeSDK::Internal::Type::Enum
3842
+
3843
+ HALF_UP = :HALF_UP
3844
+ FLOOR = :FLOOR
3845
+ CEILING = :CEILING
3846
+
3847
+ # @!method self.values
3848
+ # @return [Array<Symbol>]
3849
+ end
3850
+ end
3851
+ end
3852
+
3853
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateRecurringCredit#rate_type
3854
+ module RateType
3855
+ extend MetronomeSDK::Internal::Type::Enum
3856
+
3857
+ LIST_RATE = :LIST_RATE
3858
+ COMMIT_RATE = :COMMIT_RATE
3859
+
3860
+ # @!method self.values
3861
+ # @return [Array<Symbol>]
3862
+ end
3863
+ end
3864
+
3865
+ class UpdateRefundInvoice < MetronomeSDK::Internal::Type::BaseModel
3866
+ # @!attribute date
3867
+ #
3868
+ # @return [Time]
3869
+ required :date, Time
3870
+
3871
+ # @!attribute invoice_id
3872
+ #
3873
+ # @return [String]
3874
+ required :invoice_id, String
3875
+
3876
+ # @!method initialize(date:, invoice_id:)
3877
+ # @param date [Time]
3878
+ # @param invoice_id [String]
3879
+ end
3880
+
3881
+ class UpdateScheduledCharge < MetronomeSDK::Internal::Type::BaseModel
3882
+ # @!attribute id
3883
+ #
3884
+ # @return [String]
3885
+ required :id, String
3886
+
3887
+ # @!attribute invoice_schedule
3888
+ #
3889
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge::InvoiceSchedule, nil]
3890
+ optional :invoice_schedule,
3891
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge::InvoiceSchedule }
3892
+
3893
+ # @!attribute name
3894
+ #
3895
+ # @return [String, nil]
3896
+ optional :name, String
3897
+
3898
+ # @!attribute netsuite_sales_order_id
3899
+ #
3900
+ # @return [String, nil]
3901
+ optional :netsuite_sales_order_id, String, nil?: true
3902
+
3903
+ # @!method initialize(id:, invoice_schedule: nil, name: nil, netsuite_sales_order_id: nil)
3904
+ # @param id [String]
3905
+ # @param invoice_schedule [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge::InvoiceSchedule]
3906
+ # @param name [String]
3907
+ # @param netsuite_sales_order_id [String, nil]
3908
+
3909
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge#invoice_schedule
3910
+ class InvoiceSchedule < MetronomeSDK::Internal::Type::BaseModel
3911
+ # @!attribute add_schedule_items
3912
+ #
3913
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge::InvoiceSchedule::AddScheduleItem>, nil]
3914
+ optional :add_schedule_items,
3915
+ -> do
3916
+ MetronomeSDK::Internal::Type::ArrayOf[
3917
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge::InvoiceSchedule::AddScheduleItem
3918
+ ]
3919
+ end
3920
+
3921
+ # @!attribute remove_schedule_items
3922
+ #
3923
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge::InvoiceSchedule::RemoveScheduleItem>, nil]
3924
+ optional :remove_schedule_items,
3925
+ -> do
3926
+ MetronomeSDK::Internal::Type::ArrayOf[
3927
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge::InvoiceSchedule::RemoveScheduleItem
3928
+ ]
3929
+ end
3930
+
3931
+ # @!attribute update_schedule_items
3932
+ #
3933
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge::InvoiceSchedule::UpdateScheduleItem>, nil]
3934
+ optional :update_schedule_items,
3935
+ -> do
3936
+ MetronomeSDK::Internal::Type::ArrayOf[
3937
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge::InvoiceSchedule::UpdateScheduleItem
3938
+ ]
3939
+ end
3940
+
3941
+ # @!method initialize(add_schedule_items: nil, remove_schedule_items: nil, update_schedule_items: nil)
3942
+ # @param add_schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge::InvoiceSchedule::AddScheduleItem>]
3943
+ # @param remove_schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge::InvoiceSchedule::RemoveScheduleItem>]
3944
+ # @param update_schedule_items [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateScheduledCharge::InvoiceSchedule::UpdateScheduleItem>]
3945
+
3946
+ class AddScheduleItem < MetronomeSDK::Internal::Type::BaseModel
3947
+ # @!attribute timestamp
3948
+ #
3949
+ # @return [Time]
3950
+ required :timestamp, Time
3951
+
3952
+ # @!attribute amount
3953
+ #
3954
+ # @return [Float, nil]
3955
+ optional :amount, Float
3956
+
3957
+ # @!attribute quantity
3958
+ #
3959
+ # @return [Float, nil]
3960
+ optional :quantity, Float
3961
+
3962
+ # @!attribute unit_price
3963
+ #
3964
+ # @return [Float, nil]
3965
+ optional :unit_price, Float
3966
+
3967
+ # @!method initialize(timestamp:, amount: nil, quantity: nil, unit_price: nil)
3968
+ # @param timestamp [Time]
3969
+ # @param amount [Float]
3970
+ # @param quantity [Float]
3971
+ # @param unit_price [Float]
3972
+ end
3973
+
3974
+ class RemoveScheduleItem < MetronomeSDK::Internal::Type::BaseModel
3975
+ # @!attribute id
3976
+ #
3977
+ # @return [String]
3978
+ required :id, String
3979
+
3980
+ # @!method initialize(id:)
3981
+ # @param id [String]
3982
+ end
3983
+
3984
+ class UpdateScheduleItem < MetronomeSDK::Internal::Type::BaseModel
3985
+ # @!attribute id
3986
+ #
3987
+ # @return [String]
3988
+ required :id, String
3989
+
3990
+ # @!attribute amount
3991
+ #
3992
+ # @return [Float, nil]
3993
+ optional :amount, Float
3994
+
3995
+ # @!attribute quantity
3996
+ #
3997
+ # @return [Float, nil]
3998
+ optional :quantity, Float
3999
+
4000
+ # @!attribute timestamp
4001
+ #
4002
+ # @return [Time, nil]
4003
+ optional :timestamp, Time
4004
+
4005
+ # @!attribute unit_price
4006
+ #
4007
+ # @return [Float, nil]
4008
+ optional :unit_price, Float
4009
+
4010
+ # @!method initialize(id:, amount: nil, quantity: nil, timestamp: nil, unit_price: nil)
4011
+ # @param id [String]
4012
+ # @param amount [Float]
4013
+ # @param quantity [Float]
4014
+ # @param timestamp [Time]
4015
+ # @param unit_price [Float]
4016
+ end
4017
+ end
4018
+ end
4019
+
4020
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit#update_spend_threshold_configuration
4021
+ class UpdateSpendThresholdConfiguration < MetronomeSDK::Internal::Type::BaseModel
4022
+ # @!attribute commit
4023
+ #
4024
+ # @return [MetronomeSDK::Models::UpdateBaseThresholdCommit, nil]
4025
+ optional :commit, -> { MetronomeSDK::UpdateBaseThresholdCommit }
4026
+
4027
+ # @!attribute discount_configuration
4028
+ #
4029
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSpendThresholdConfiguration::DiscountConfiguration, nil]
4030
+ optional :discount_configuration,
4031
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSpendThresholdConfiguration::DiscountConfiguration },
4032
+ nil?: true
4033
+
4034
+ # @!attribute is_enabled
4035
+ # When set to false, the contract will not be evaluated against the
4036
+ # threshold_amount. Toggling to true will result an immediate evaluation,
4037
+ # regardless of prior state.
4038
+ #
4039
+ # @return [Boolean, nil]
4040
+ optional :is_enabled, MetronomeSDK::Internal::Type::Boolean
4041
+
4042
+ # @!attribute payment_gate_config
4043
+ #
4044
+ # @return [MetronomeSDK::Models::PaymentGateConfigV2, nil]
4045
+ optional :payment_gate_config, -> { MetronomeSDK::PaymentGateConfigV2 }
4046
+
4047
+ # @!attribute threshold_amount
4048
+ # Specify the threshold amount for the contract. Each time the contract's usage
4049
+ # hits this amount, a threshold charge will be initiated.
4050
+ #
4051
+ # @return [Float, nil]
4052
+ optional :threshold_amount, Float
4053
+
4054
+ # @!method initialize(commit: nil, discount_configuration: nil, is_enabled: nil, payment_gate_config: nil, threshold_amount: nil)
4055
+ # Some parameter documentations has been truncated, see
4056
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSpendThresholdConfiguration}
4057
+ # for more details.
4058
+ #
4059
+ # @param commit [MetronomeSDK::Models::UpdateBaseThresholdCommit]
4060
+ #
4061
+ # @param discount_configuration [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSpendThresholdConfiguration::DiscountConfiguration, nil]
4062
+ #
4063
+ # @param is_enabled [Boolean] When set to false, the contract will not be evaluated against the threshold_amou
4064
+ #
4065
+ # @param payment_gate_config [MetronomeSDK::Models::PaymentGateConfigV2]
4066
+ #
4067
+ # @param threshold_amount [Float] Specify the threshold amount for the contract. Each time the contract's usage hi
4068
+
4069
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSpendThresholdConfiguration#discount_configuration
4070
+ class DiscountConfiguration < MetronomeSDK::Internal::Type::BaseModel
4071
+ # @!attribute cap
4072
+ # Update the discount cap. Set to null to remove an existing cap.
4073
+ #
4074
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSpendThresholdConfiguration::DiscountConfiguration::Cap, nil]
4075
+ optional :cap,
4076
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSpendThresholdConfiguration::DiscountConfiguration::Cap },
4077
+ nil?: true
4078
+
4079
+ # @!attribute payment_fraction
4080
+ # The fraction of the original amount that the customer pays after applying the
4081
+ # discount. Set to null to remove the discount fraction. For example, 0.85 means
4082
+ # the customer pays 85% of the original amount (a 15% discount).
4083
+ #
4084
+ # @return [Float, nil]
4085
+ optional :payment_fraction, Float, nil?: true
4086
+
4087
+ # @!method initialize(cap: nil, payment_fraction: nil)
4088
+ # Some parameter documentations has been truncated, see
4089
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSpendThresholdConfiguration::DiscountConfiguration}
4090
+ # for more details.
4091
+ #
4092
+ # @param cap [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSpendThresholdConfiguration::DiscountConfiguration::Cap, nil] Update the discount cap. Set to null to remove an existing cap.
4093
+ #
4094
+ # @param payment_fraction [Float, nil] The fraction of the original amount that the customer pays after applying the di
4095
+
4096
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSpendThresholdConfiguration::DiscountConfiguration#cap
4097
+ class Cap < MetronomeSDK::Internal::Type::BaseModel
4098
+ # @!attribute amount
4099
+ # Accumulated spend ceiling above which the discount stops applying.
4100
+ #
4101
+ # @return [Float]
4102
+ required :amount, Float
4103
+
4104
+ # @!attribute spend_tracker_alias
4105
+ # Alias of the spend tracker this cap is measured against.
4106
+ #
4107
+ # @return [String]
4108
+ required :spend_tracker_alias, String
4109
+
4110
+ # @!method initialize(amount:, spend_tracker_alias:)
4111
+ # Update the discount cap. Set to null to remove an existing cap.
4112
+ #
4113
+ # @param amount [Float] Accumulated spend ceiling above which the discount stops applying.
4114
+ #
4115
+ # @param spend_tracker_alias [String] Alias of the spend tracker this cap is measured against.
4116
+ end
4117
+ end
4118
+ end
4119
+
4120
+ class UpdateSubscription < MetronomeSDK::Internal::Type::BaseModel
4121
+ # @!attribute id
4122
+ #
4123
+ # @return [String]
4124
+ required :id, String
4125
+
4126
+ # @!attribute ending_before
4127
+ #
4128
+ # @return [Time, nil]
4129
+ optional :ending_before, Time
4130
+
4131
+ # @!attribute quantity_updates
4132
+ #
4133
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::QuantityUpdate>, nil]
4134
+ optional :quantity_updates,
4135
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::QuantityUpdate] }
4136
+
4137
+ # @!attribute seat_updates
4138
+ # Manage subscription seats for subscriptions in SEAT_BASED mode.
4139
+ #
4140
+ # @return [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates, nil]
4141
+ optional :seat_updates,
4142
+ -> { MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates }
4143
+
4144
+ # @!method initialize(id:, ending_before: nil, quantity_updates: nil, seat_updates: nil)
4145
+ # @param id [String]
4146
+ #
4147
+ # @param ending_before [Time]
4148
+ #
4149
+ # @param quantity_updates [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::QuantityUpdate>]
4150
+ #
4151
+ # @param seat_updates [MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates] Manage subscription seats for subscriptions in SEAT_BASED mode.
4152
+
4153
+ class QuantityUpdate < MetronomeSDK::Internal::Type::BaseModel
4154
+ # @!attribute starting_at
4155
+ #
4156
+ # @return [Time]
4157
+ required :starting_at, Time
4158
+
4159
+ # @!attribute quantity
4160
+ #
4161
+ # @return [Float, nil]
4162
+ optional :quantity, Float
4163
+
4164
+ # @!attribute quantity_delta
4165
+ #
4166
+ # @return [Float, nil]
4167
+ optional :quantity_delta, Float
4168
+
4169
+ # @!method initialize(starting_at:, quantity: nil, quantity_delta: nil)
4170
+ # @param starting_at [Time]
4171
+ # @param quantity [Float]
4172
+ # @param quantity_delta [Float]
4173
+ end
4174
+
4175
+ # @see MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription#seat_updates
4176
+ class SeatUpdates < MetronomeSDK::Internal::Type::BaseModel
4177
+ # @!attribute add_seat_ids
4178
+ # Adds seat IDs to the subscription. If there are unassigned seats, the new seat
4179
+ # IDs will fill these unassigned seats and not increase the total subscription
4180
+ # quantity. Otherwise, if there are more new seat IDs than unassigned seats, the
4181
+ # total subscription quantity will increase.
4182
+ #
4183
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::AddSeatID>, nil]
4184
+ optional :add_seat_ids,
4185
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::AddSeatID] }
4186
+
4187
+ # @!attribute add_unassigned_seats
4188
+ # Adds unassigned seats to the subscription. This will increase the total
4189
+ # subscription quantity.
4190
+ #
4191
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::AddUnassignedSeat>, nil]
4192
+ optional :add_unassigned_seats,
4193
+ -> do
4194
+ MetronomeSDK::Internal::Type::ArrayOf[
4195
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::AddUnassignedSeat
4196
+ ]
4197
+ end
4198
+
4199
+ # @!attribute remove_seat_ids
4200
+ # Removes seat IDs from the subscription, if possible. If a seat ID is removed,
4201
+ # the total subscription quantity will decrease. Otherwise, if the seat ID is not
4202
+ # found on the subscription, this is a no-op.
4203
+ #
4204
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::RemoveSeatID>, nil]
4205
+ optional :remove_seat_ids,
4206
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::RemoveSeatID] }
4207
+
4208
+ # @!attribute remove_unassigned_seats
4209
+ # Removes unassigned seats from the subscription. This will decrease the total
4210
+ # subscription quantity if there are are unassigned seats.
4211
+ #
4212
+ # @return [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::RemoveUnassignedSeat>, nil]
4213
+ optional :remove_unassigned_seats,
4214
+ -> do
4215
+ MetronomeSDK::Internal::Type::ArrayOf[
4216
+ MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::RemoveUnassignedSeat
4217
+ ]
4218
+ end
4219
+
4220
+ # @!method initialize(add_seat_ids: nil, add_unassigned_seats: nil, remove_seat_ids: nil, remove_unassigned_seats: nil)
4221
+ # Some parameter documentations has been truncated, see
4222
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates}
4223
+ # for more details.
4224
+ #
4225
+ # Manage subscription seats for subscriptions in SEAT_BASED mode.
4226
+ #
4227
+ # @param add_seat_ids [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::AddSeatID>] Adds seat IDs to the subscription. If there are unassigned seats, the new seat
4228
+ #
4229
+ # @param add_unassigned_seats [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::AddUnassignedSeat>] Adds unassigned seats to the subscription. This will increase the total subscrip
4230
+ #
4231
+ # @param remove_seat_ids [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::RemoveSeatID>] Removes seat IDs from the subscription, if possible. If a seat ID is removed, t
4232
+ #
4233
+ # @param remove_unassigned_seats [Array<MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::RemoveUnassignedSeat>] Removes unassigned seats from the subscription. This will decrease the total sub
4234
+
4235
+ class AddSeatID < MetronomeSDK::Internal::Type::BaseModel
4236
+ # @!attribute seat_ids
4237
+ #
4238
+ # @return [Array<String>]
4239
+ required :seat_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
4240
+
4241
+ # @!attribute starting_at
4242
+ # Assigned seats will be added/removed starting at this date.
4243
+ #
4244
+ # @return [Time]
4245
+ required :starting_at, Time
4246
+
4247
+ # @!method initialize(seat_ids:, starting_at:)
4248
+ # @param seat_ids [Array<String>]
4249
+ #
4250
+ # @param starting_at [Time] Assigned seats will be added/removed starting at this date.
4251
+ end
4252
+
4253
+ class AddUnassignedSeat < MetronomeSDK::Internal::Type::BaseModel
4254
+ # @!attribute quantity
4255
+ # The number of unassigned seats on the subscription will increase/decrease by
4256
+ # this delta. Must be greater than 0.
4257
+ #
4258
+ # @return [Float]
4259
+ required :quantity, Float
4260
+
4261
+ # @!attribute starting_at
4262
+ # Unassigned seats will be updated starting at this date.
4263
+ #
4264
+ # @return [Time]
4265
+ required :starting_at, Time
4266
+
4267
+ # @!method initialize(quantity:, starting_at:)
4268
+ # Some parameter documentations has been truncated, see
4269
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::AddUnassignedSeat}
4270
+ # for more details.
4271
+ #
4272
+ # @param quantity [Float] The number of unassigned seats on the subscription will increase/decrease by thi
4273
+ #
4274
+ # @param starting_at [Time] Unassigned seats will be updated starting at this date.
4275
+ end
4276
+
4277
+ class RemoveSeatID < MetronomeSDK::Internal::Type::BaseModel
4278
+ # @!attribute seat_ids
4279
+ #
4280
+ # @return [Array<String>]
4281
+ required :seat_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
4282
+
4283
+ # @!attribute starting_at
4284
+ # Assigned seats will be added/removed starting at this date.
4285
+ #
4286
+ # @return [Time]
4287
+ required :starting_at, Time
4288
+
4289
+ # @!method initialize(seat_ids:, starting_at:)
4290
+ # @param seat_ids [Array<String>]
4291
+ #
4292
+ # @param starting_at [Time] Assigned seats will be added/removed starting at this date.
4293
+ end
4294
+
4295
+ class RemoveUnassignedSeat < MetronomeSDK::Internal::Type::BaseModel
4296
+ # @!attribute quantity
4297
+ # The number of unassigned seats on the subscription will increase/decrease by
4298
+ # this delta. Must be greater than 0.
4299
+ #
4300
+ # @return [Float]
4301
+ required :quantity, Float
4302
+
4303
+ # @!attribute starting_at
4304
+ # Unassigned seats will be updated starting at this date.
4305
+ #
4306
+ # @return [Time]
4307
+ required :starting_at, Time
4308
+
4309
+ # @!method initialize(quantity:, starting_at:)
4310
+ # Some parameter documentations has been truncated, see
4311
+ # {MetronomeSDK::Models::V2::ContractEditResponse::Data::Edit::UpdateSubscription::SeatUpdates::RemoveUnassignedSeat}
4312
+ # for more details.
4313
+ #
4314
+ # @param quantity [Float] The number of unassigned seats on the subscription will increase/decrease by thi
4315
+ #
4316
+ # @param starting_at [Time] Unassigned seats will be updated starting at this date.
4317
+ end
4318
+ end
4319
+ end
4320
+ end
4321
+ end
15
4322
  end
16
4323
  end
17
4324
  end