metronome-sdk 0.3.0 → 2.0.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 (363) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +91 -0
  3. data/README.md +9 -9
  4. data/lib/metronome_sdk/errors.rb +25 -11
  5. data/lib/metronome_sdk/file_part.rb +10 -7
  6. data/lib/metronome_sdk/internal/body_cursor_page.rb +86 -0
  7. data/lib/metronome_sdk/internal/cursor_page.rb +1 -1
  8. data/lib/metronome_sdk/internal/cursor_page_without_limit.rb +86 -0
  9. data/lib/metronome_sdk/internal/transport/base_client.rb +12 -11
  10. data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +8 -19
  11. data/lib/metronome_sdk/internal/type/base_model.rb +6 -13
  12. data/lib/metronome_sdk/internal/type/base_page.rb +1 -1
  13. data/lib/metronome_sdk/internal/type/enum.rb +25 -0
  14. data/lib/metronome_sdk/internal/type/file_input.rb +7 -4
  15. data/lib/metronome_sdk/internal/type/union.rb +11 -0
  16. data/lib/metronome_sdk/internal/util.rb +9 -8
  17. data/lib/metronome_sdk/models/base_threshold_commit.rb +36 -0
  18. data/lib/metronome_sdk/models/commit.rb +26 -170
  19. data/lib/metronome_sdk/models/commit_hierarchy_configuration.rb +98 -0
  20. data/lib/metronome_sdk/models/commit_rate.rb +48 -0
  21. data/lib/metronome_sdk/models/commit_specifier.rb +42 -0
  22. data/lib/metronome_sdk/models/commit_specifier_input.rb +42 -0
  23. data/lib/metronome_sdk/models/contract.rb +404 -0
  24. data/lib/metronome_sdk/models/contract_v2.rb +3169 -0
  25. data/lib/metronome_sdk/models/contract_without_amendments.rb +38 -1128
  26. data/lib/metronome_sdk/models/credit.rb +9 -156
  27. data/lib/metronome_sdk/models/discount.rb +2 -1
  28. data/lib/metronome_sdk/models/hierarchy_configuration.rb +173 -0
  29. data/lib/metronome_sdk/models/override.rb +6 -101
  30. data/lib/metronome_sdk/models/override_tier.rb +21 -0
  31. data/lib/metronome_sdk/models/overwrite_rate.rb +82 -0
  32. data/lib/metronome_sdk/models/payment_gate_config.rb +150 -0
  33. data/lib/metronome_sdk/models/payment_gate_config_v2.rb +150 -0
  34. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +100 -0
  35. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +102 -0
  36. data/lib/metronome_sdk/models/pro_service.rb +2 -1
  37. data/lib/metronome_sdk/models/recurring_commit_subscription_config.rb +51 -0
  38. data/lib/metronome_sdk/models/scheduled_charge.rb +2 -1
  39. data/lib/metronome_sdk/models/spend_threshold_configuration.rb +44 -0
  40. data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +44 -0
  41. data/lib/metronome_sdk/models/subscription.rb +311 -0
  42. data/lib/metronome_sdk/models/update_base_threshold_commit.rb +36 -0
  43. data/lib/metronome_sdk/models/v1/alert_archive_params.rb +8 -4
  44. data/lib/metronome_sdk/models/v1/alert_create_params.rb +42 -42
  45. data/lib/metronome_sdk/models/v1/billable_metric_create_params.rb +1 -2
  46. data/lib/metronome_sdk/models/v1/billable_metric_list_response.rb +3 -3
  47. data/lib/metronome_sdk/models/v1/billable_metric_retrieve_response.rb +4 -7
  48. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +58 -411
  49. data/lib/metronome_sdk/models/v1/contract_create_historical_invoices_params.rb +7 -16
  50. data/lib/metronome_sdk/models/v1/contract_create_params.rb +315 -1459
  51. data/lib/metronome_sdk/models/v1/contract_list_balances_response.rb +6 -23
  52. data/lib/metronome_sdk/models/v1/contract_list_response.rb +3 -1153
  53. data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_params.rb +2 -6
  54. data/lib/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rb +5 -50
  55. data/lib/metronome_sdk/models/v1/contract_retrieve_response.rb +3 -1154
  56. data/lib/metronome_sdk/models/v1/contract_schedule_pro_services_invoice_params.rb +1 -3
  57. data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +2 -1
  58. data/lib/metronome_sdk/models/v1/contracts/product_list_response.rb +8 -1
  59. data/lib/metronome_sdk/models/v1/contracts/product_retrieve_response.rb +8 -1
  60. data/lib/metronome_sdk/models/v1/contracts/quantity_rounding.rb +1 -4
  61. data/lib/metronome_sdk/models/v1/contracts/rate_card_create_params.rb +4 -7
  62. data/lib/metronome_sdk/models/v1/contracts/rate_card_list_response.rb +10 -1
  63. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_params.rb +2 -6
  64. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rb +5 -50
  65. data/lib/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rb +10 -1
  66. data/lib/metronome_sdk/models/v1/contracts/rate_card_update_params.rb +1 -3
  67. data/lib/metronome_sdk/models/v1/contracts/rate_cards/product_order_update_params.rb +1 -3
  68. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rb +6 -61
  69. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rb +3 -49
  70. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rb +4 -51
  71. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_params.rb +2 -6
  72. data/lib/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rb +5 -49
  73. data/lib/metronome_sdk/models/v1/credit_grant_list_entries_response.rb +103 -123
  74. data/lib/metronome_sdk/models/v1/credit_grant_list_response.rb +3 -5
  75. data/lib/metronome_sdk/models/v1/custom_field_list_keys_params.rb +1 -3
  76. data/lib/metronome_sdk/models/v1/custom_field_list_keys_response.rb +41 -58
  77. data/lib/metronome_sdk/models/v1/custom_field_set_values_params.rb +5 -1
  78. data/lib/metronome_sdk/models/v1/customer.rb +2 -1
  79. data/lib/metronome_sdk/models/v1/customer_create_params.rb +37 -11
  80. data/lib/metronome_sdk/models/v1/customer_detail.rb +11 -2
  81. data/lib/metronome_sdk/models/v1/customer_list_billable_metrics_response.rb +3 -3
  82. data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +6 -18
  83. data/lib/metronome_sdk/models/v1/customer_preview_events_response.rb +3 -3
  84. data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rb +28 -0
  85. data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rb +128 -0
  86. data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_params.rb +143 -0
  87. data/lib/metronome_sdk/models/v1/customers/alert_list_params.rb +4 -6
  88. data/lib/metronome_sdk/models/v1/customers/alert_reset_params.rb +2 -2
  89. data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +37 -8
  90. data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +2 -0
  91. data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +2 -0
  92. data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +10 -60
  93. data/lib/metronome_sdk/models/v1/customers/credit_create_params.rb +6 -48
  94. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +48 -54
  95. data/lib/metronome_sdk/models/v1/customers/invoice.rb +197 -66
  96. data/lib/metronome_sdk/models/v1/customers/invoice_list_breakdowns_params.rb +1 -4
  97. data/lib/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rb +30 -0
  98. data/lib/metronome_sdk/models/v1/customers/plan_add_params.rb +2 -6
  99. data/lib/metronome_sdk/models/v1/customers/plan_list_response.rb +2 -1
  100. data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +4 -11
  101. data/lib/metronome_sdk/models/v1/payment.rb +151 -0
  102. data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +28 -0
  103. data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +18 -0
  104. data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +28 -0
  105. data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +18 -0
  106. data/lib/metronome_sdk/models/v1/payment_list_params.rb +53 -0
  107. data/lib/metronome_sdk/models/v1/payment_status.rb +19 -0
  108. data/lib/metronome_sdk/models/v1/plan_detail.rb +9 -5
  109. data/lib/metronome_sdk/models/v1/plan_list_charges_response.rb +2 -1
  110. data/lib/metronome_sdk/models/v1/plan_list_customers_response.rb +2 -1
  111. data/lib/metronome_sdk/models/v1/plan_list_response.rb +5 -1
  112. data/lib/metronome_sdk/models/v1/usage_ingest_params.rb +1 -4
  113. data/lib/metronome_sdk/models/v1/usage_list_params.rb +1 -3
  114. data/lib/metronome_sdk/models/v1/usage_list_response.rb +45 -62
  115. data/lib/metronome_sdk/models/v1/usage_search_response.rb +4 -7
  116. data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +37 -58
  117. data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +34 -49
  118. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +552 -2265
  119. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +417 -2317
  120. data/lib/metronome_sdk/models/v2/contract_list_response.rb +3 -4520
  121. data/lib/metronome_sdk/models/v2/contract_retrieve_response.rb +3 -4528
  122. data/lib/metronome_sdk/models.rb +38 -0
  123. data/lib/metronome_sdk/resources/v1/alerts.rb +90 -16
  124. data/lib/metronome_sdk/resources/v1/audit_logs.rb +39 -4
  125. data/lib/metronome_sdk/resources/v1/billable_metrics.rb +54 -4
  126. data/lib/metronome_sdk/resources/v1/contracts/products.rb +25 -6
  127. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rb +7 -2
  128. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb +10 -2
  129. data/lib/metronome_sdk/resources/v1/contracts/rate_cards.rb +109 -10
  130. data/lib/metronome_sdk/resources/v1/contracts.rb +255 -18
  131. data/lib/metronome_sdk/resources/v1/credit_grants.rb +2 -1
  132. data/lib/metronome_sdk/resources/v1/custom_fields.rb +51 -14
  133. data/lib/metronome_sdk/resources/v1/customers/alerts.rb +127 -13
  134. data/lib/metronome_sdk/resources/v1/customers/commits.rb +119 -9
  135. data/lib/metronome_sdk/resources/v1/customers/credits.rb +104 -8
  136. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +179 -8
  137. data/lib/metronome_sdk/resources/v1/customers.rb +175 -15
  138. data/lib/metronome_sdk/resources/v1/dashboards.rb +29 -3
  139. data/lib/metronome_sdk/resources/v1/invoices.rb +23 -2
  140. data/lib/metronome_sdk/resources/v1/payments.rb +102 -0
  141. data/lib/metronome_sdk/resources/v1/pricing_units.rb +6 -1
  142. data/lib/metronome_sdk/resources/v1/services.rb +6 -4
  143. data/lib/metronome_sdk/resources/v1/usage.rb +188 -13
  144. data/lib/metronome_sdk/resources/v1.rb +4 -0
  145. data/lib/metronome_sdk/resources/v2/contracts.rb +120 -18
  146. data/lib/metronome_sdk/version.rb +1 -1
  147. data/lib/metronome_sdk.rb +33 -3
  148. data/rbi/metronome_sdk/errors.rbi +31 -4
  149. data/rbi/metronome_sdk/file_part.rbi +1 -1
  150. data/rbi/metronome_sdk/internal/body_cursor_page.rbi +22 -0
  151. data/rbi/metronome_sdk/internal/cursor_page_without_limit.rbi +22 -0
  152. data/rbi/metronome_sdk/internal/transport/base_client.rbi +4 -5
  153. data/rbi/metronome_sdk/internal/type/base_page.rbi +1 -1
  154. data/rbi/metronome_sdk/internal/util.rbi +1 -1
  155. data/rbi/metronome_sdk/models/base_threshold_commit.rbi +58 -0
  156. data/rbi/metronome_sdk/models/commit.rbi +26 -348
  157. data/rbi/metronome_sdk/models/commit_hierarchy_configuration.rbi +280 -0
  158. data/rbi/metronome_sdk/models/commit_rate.rbi +85 -0
  159. data/rbi/metronome_sdk/models/commit_specifier.rbi +71 -0
  160. data/rbi/metronome_sdk/models/commit_specifier_input.rbi +74 -0
  161. data/rbi/metronome_sdk/models/contract.rbi +768 -0
  162. data/rbi/metronome_sdk/models/contract_v2.rbi +6415 -0
  163. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +186 -2509
  164. data/rbi/metronome_sdk/models/credit.rbi +10 -348
  165. data/rbi/metronome_sdk/models/discount.rbi +2 -0
  166. data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +424 -0
  167. data/rbi/metronome_sdk/models/override.rbi +8 -193
  168. data/rbi/metronome_sdk/models/override_tier.rbi +29 -0
  169. data/rbi/metronome_sdk/models/overwrite_rate.rbi +137 -0
  170. data/rbi/metronome_sdk/models/payment_gate_config.rbi +317 -0
  171. data/rbi/metronome_sdk/models/payment_gate_config_v2.rbi +326 -0
  172. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +183 -0
  173. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +188 -0
  174. data/rbi/metronome_sdk/models/pro_service.rbi +2 -0
  175. data/rbi/metronome_sdk/models/recurring_commit_subscription_config.rbi +125 -0
  176. data/rbi/metronome_sdk/models/scheduled_charge.rbi +2 -0
  177. data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +76 -0
  178. data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +78 -0
  179. data/rbi/metronome_sdk/models/subscription.rbi +635 -0
  180. data/rbi/metronome_sdk/models/update_base_threshold_commit.rbi +61 -0
  181. data/rbi/metronome_sdk/models/v1/alert_archive_params.rbi +6 -4
  182. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +57 -50
  183. data/rbi/metronome_sdk/models/v1/billable_metric_list_response.rbi +2 -0
  184. data/rbi/metronome_sdk/models/v1/billable_metric_retrieve_response.rbi +2 -0
  185. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +49 -768
  186. data/rbi/metronome_sdk/models/v1/contract_create_historical_invoices_params.rbi +2 -0
  187. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +1843 -4119
  188. data/rbi/metronome_sdk/models/v1/contract_list_balances_response.rbi +8 -59
  189. data/rbi/metronome_sdk/models/v1/contract_list_response.rbi +5 -2420
  190. data/rbi/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbi +6 -129
  191. data/rbi/metronome_sdk/models/v1/contract_retrieve_response.rbi +4 -2419
  192. data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +2 -0
  193. data/rbi/metronome_sdk/models/v1/contracts/product_list_response.rbi +2 -0
  194. data/rbi/metronome_sdk/models/v1/contracts/product_retrieve_response.rbi +2 -0
  195. data/rbi/metronome_sdk/models/v1/contracts/rate_card_create_params.rbi +2 -0
  196. data/rbi/metronome_sdk/models/v1/contracts/rate_card_list_response.rbi +2 -0
  197. data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbi +6 -129
  198. data/rbi/metronome_sdk/models/v1/contracts/rate_card_retrieve_response.rbi +2 -0
  199. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbi +4 -129
  200. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbi +4 -129
  201. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbi +4 -129
  202. data/rbi/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbi +6 -129
  203. data/rbi/metronome_sdk/models/v1/credit_grant_list_entries_response.rbi +147 -198
  204. data/rbi/metronome_sdk/models/v1/credit_grant_list_response.rbi +2 -0
  205. data/rbi/metronome_sdk/models/v1/custom_field_list_keys_response.rbi +117 -165
  206. data/rbi/metronome_sdk/models/v1/custom_field_set_values_params.rbi +8 -1
  207. data/rbi/metronome_sdk/models/v1/customer.rbi +2 -0
  208. data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +88 -3
  209. data/rbi/metronome_sdk/models/v1/customer_detail.rbi +10 -0
  210. data/rbi/metronome_sdk/models/v1/customer_list_billable_metrics_response.rbi +2 -0
  211. data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +6 -21
  212. data/rbi/metronome_sdk/models/v1/customer_preview_events_response.rbi +10 -9
  213. data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbi +51 -0
  214. data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbi +265 -0
  215. data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbi +348 -0
  216. data/rbi/metronome_sdk/models/v1/customers/alert_list_params.rbi +4 -4
  217. data/rbi/metronome_sdk/models/v1/customers/alert_reset_params.rbi +2 -2
  218. data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +68 -8
  219. data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +10 -0
  220. data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +10 -0
  221. data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +6 -90
  222. data/rbi/metronome_sdk/models/v1/customers/credit_create_params.rbi +6 -90
  223. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +54 -47
  224. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +316 -68
  225. data/rbi/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbi +50 -0
  226. data/rbi/metronome_sdk/models/v1/customers/plan_list_response.rbi +2 -0
  227. data/rbi/metronome_sdk/models/v1/payment.rbi +316 -0
  228. data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +48 -0
  229. data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +35 -0
  230. data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +48 -0
  231. data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +35 -0
  232. data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +91 -0
  233. data/rbi/metronome_sdk/models/v1/payment_status.rbi +33 -0
  234. data/rbi/metronome_sdk/models/v1/plan_detail.rbi +2 -0
  235. data/rbi/metronome_sdk/models/v1/plan_list_charges_response.rbi +2 -0
  236. data/rbi/metronome_sdk/models/v1/plan_list_customers_response.rbi +2 -0
  237. data/rbi/metronome_sdk/models/v1/plan_list_response.rbi +8 -1
  238. data/rbi/metronome_sdk/models/v1/usage_list_response.rbi +45 -86
  239. data/rbi/metronome_sdk/models/v1/usage_search_response.rbi +2 -0
  240. data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +74 -76
  241. data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +74 -76
  242. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +3875 -7234
  243. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1733 -6207
  244. data/rbi/metronome_sdk/models/v2/contract_list_response.rbi +5 -9867
  245. data/rbi/metronome_sdk/models/v2/contract_retrieve_response.rbi +6 -9866
  246. data/rbi/metronome_sdk/models.rbi +44 -0
  247. data/rbi/metronome_sdk/resources/v1/alerts.rbi +101 -27
  248. data/rbi/metronome_sdk/resources/v1/audit_logs.rbi +39 -4
  249. data/rbi/metronome_sdk/resources/v1/billable_metrics.rbi +54 -4
  250. data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +25 -5
  251. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/product_orders.rbi +7 -2
  252. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbi +10 -3
  253. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards.rbi +109 -9
  254. data/rbi/metronome_sdk/resources/v1/contracts.rbi +258 -16
  255. data/rbi/metronome_sdk/resources/v1/credit_grants.rbi +5 -1
  256. data/rbi/metronome_sdk/resources/v1/custom_fields.rbi +57 -14
  257. data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +133 -11
  258. data/rbi/metronome_sdk/resources/v1/customers/commits.rbi +119 -10
  259. data/rbi/metronome_sdk/resources/v1/customers/credits.rbi +104 -9
  260. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +159 -7
  261. data/rbi/metronome_sdk/resources/v1/customers.rbi +162 -14
  262. data/rbi/metronome_sdk/resources/v1/dashboards.rbi +29 -3
  263. data/rbi/metronome_sdk/resources/v1/invoices.rbi +23 -2
  264. data/rbi/metronome_sdk/resources/v1/payments.rbi +72 -0
  265. data/rbi/metronome_sdk/resources/v1/pricing_units.rbi +6 -1
  266. data/rbi/metronome_sdk/resources/v1/services.rbi +6 -4
  267. data/rbi/metronome_sdk/resources/v1/usage.rbi +191 -13
  268. data/rbi/metronome_sdk/resources/v1.rbi +3 -0
  269. data/rbi/metronome_sdk/resources/v2/contracts.rbi +134 -23
  270. data/sig/metronome_sdk/errors.rbs +7 -0
  271. data/sig/metronome_sdk/file_part.rbs +1 -1
  272. data/sig/metronome_sdk/internal/body_cursor_page.rbs +13 -0
  273. data/sig/metronome_sdk/internal/cursor_page_without_limit.rbs +13 -0
  274. data/sig/metronome_sdk/models/base_threshold_commit.rbs +26 -0
  275. data/sig/metronome_sdk/models/commit.rbs +17 -170
  276. data/sig/metronome_sdk/models/commit_hierarchy_configuration.rbs +117 -0
  277. data/sig/metronome_sdk/models/commit_rate.rbs +48 -0
  278. data/sig/metronome_sdk/models/commit_specifier.rbs +47 -0
  279. data/sig/metronome_sdk/models/commit_specifier_input.rbs +47 -0
  280. data/sig/metronome_sdk/models/contract.rbs +398 -0
  281. data/sig/metronome_sdk/models/contract_v2.rbs +3108 -0
  282. data/sig/metronome_sdk/models/contract_without_amendments.rbs +54 -976
  283. data/sig/metronome_sdk/models/credit.rbs +12 -170
  284. data/sig/metronome_sdk/models/hierarchy_configuration.rbs +152 -0
  285. data/sig/metronome_sdk/models/override.rbs +12 -101
  286. data/sig/metronome_sdk/models/override_tier.rbs +17 -0
  287. data/sig/metronome_sdk/models/overwrite_rate.rbs +78 -0
  288. data/sig/metronome_sdk/models/payment_gate_config.rbs +124 -0
  289. data/sig/metronome_sdk/models/payment_gate_config_v2.rbs +124 -0
  290. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +82 -0
  291. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +82 -0
  292. data/sig/metronome_sdk/models/recurring_commit_subscription_config.rbs +51 -0
  293. data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +35 -0
  294. data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +35 -0
  295. data/sig/metronome_sdk/models/subscription.rbs +295 -0
  296. data/sig/metronome_sdk/models/update_base_threshold_commit.rbs +28 -0
  297. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +4 -2
  298. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +26 -341
  299. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +219 -1184
  300. data/sig/metronome_sdk/models/v1/contract_list_balances_response.rbs +4 -25
  301. data/sig/metronome_sdk/models/v1/contract_list_response.rbs +4 -1041
  302. data/sig/metronome_sdk/models/v1/contract_retrieve_rate_schedule_response.rbs +6 -54
  303. data/sig/metronome_sdk/models/v1/contract_retrieve_response.rbs +4 -1041
  304. data/sig/metronome_sdk/models/v1/contracts/rate_card_retrieve_rate_schedule_response.rbs +6 -54
  305. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_many_params.rbs +6 -54
  306. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_params.rbs +6 -54
  307. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_add_response.rbs +6 -54
  308. data/sig/metronome_sdk/models/v1/contracts/rate_cards/rate_list_response.rbs +6 -54
  309. data/sig/metronome_sdk/models/v1/credit_grant_list_entries_response.rbs +72 -94
  310. data/sig/metronome_sdk/models/v1/custom_field_list_keys_response.rbs +53 -75
  311. data/sig/metronome_sdk/models/v1/customer_create_params.rbs +31 -4
  312. data/sig/metronome_sdk/models/v1/customer_detail.rbs +5 -0
  313. data/sig/metronome_sdk/models/v1/customer_preview_events_params.rbs +0 -7
  314. data/sig/metronome_sdk/models/v1/customer_preview_events_response.rbs +6 -4
  315. data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_params.rbs +32 -0
  316. data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbs +113 -0
  317. data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbs +133 -0
  318. data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +21 -0
  319. data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +7 -1
  320. data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbs +6 -1
  321. data/sig/metronome_sdk/models/v1/customers/commit_create_params.rbs +6 -50
  322. data/sig/metronome_sdk/models/v1/customers/credit_create_params.rbs +6 -50
  323. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +4 -2
  324. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +137 -24
  325. data/sig/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbs +32 -0
  326. data/sig/metronome_sdk/models/v1/payment.rbs +191 -0
  327. data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +30 -0
  328. data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +15 -0
  329. data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +30 -0
  330. data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +15 -0
  331. data/sig/metronome_sdk/models/v1/payment_list_params.rbs +56 -0
  332. data/sig/metronome_sdk/models/v1/payment_status.rbs +19 -0
  333. data/sig/metronome_sdk/models/v1/usage_list_response.rbs +33 -55
  334. data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +28 -43
  335. data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +28 -43
  336. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +412 -1793
  337. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +342 -2149
  338. data/sig/metronome_sdk/models/v2/contract_list_response.rbs +4 -4426
  339. data/sig/metronome_sdk/models/v2/contract_retrieve_response.rbs +4 -4426
  340. data/sig/metronome_sdk/models.rbs +38 -0
  341. data/sig/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbs +1 -1
  342. data/sig/metronome_sdk/resources/v1/contracts.rbs +3 -3
  343. data/sig/metronome_sdk/resources/v1/credit_grants.rbs +1 -1
  344. data/sig/metronome_sdk/resources/v1/custom_fields.rbs +1 -1
  345. data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +2 -1
  346. data/sig/metronome_sdk/resources/v1/customers/commits.rbs +2 -2
  347. data/sig/metronome_sdk/resources/v1/customers/credits.rbs +2 -2
  348. data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +6 -0
  349. data/sig/metronome_sdk/resources/v1/customers.rbs +11 -0
  350. data/sig/metronome_sdk/resources/v1/payments.rbs +30 -0
  351. data/sig/metronome_sdk/resources/v1/usage.rbs +1 -1
  352. data/sig/metronome_sdk/resources/v1.rbs +2 -0
  353. data/sig/metronome_sdk/resources/v2/contracts.rbs +10 -4
  354. metadata +101 -11
  355. data/lib/metronome_sdk/models/v1/customers/alert_list_response.rb +0 -29
  356. data/lib/metronome_sdk/models/v1/customers/commit_list_response.rb +0 -26
  357. data/lib/metronome_sdk/models/v1/customers/credit_list_response.rb +0 -26
  358. data/rbi/metronome_sdk/models/v1/customers/alert_list_response.rbi +0 -46
  359. data/rbi/metronome_sdk/models/v1/customers/commit_list_response.rbi +0 -45
  360. data/rbi/metronome_sdk/models/v1/customers/credit_list_response.rbi +0 -45
  361. data/sig/metronome_sdk/models/v1/customers/alert_list_response.rbs +0 -29
  362. data/sig/metronome_sdk/models/v1/customers/commit_list_response.rbs +0 -26
  363. data/sig/metronome_sdk/models/v1/customers/credit_list_response.rbs +0 -26
@@ -0,0 +1,3169 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MetronomeSDK
4
+ module Models
5
+ class ContractV2 < MetronomeSDK::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ #
8
+ # @return [String]
9
+ required :id, String
10
+
11
+ # @!attribute commits
12
+ #
13
+ # @return [Array<MetronomeSDK::Models::ContractV2::Commit>]
14
+ required :commits, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractV2::Commit] }
15
+
16
+ # @!attribute created_at
17
+ #
18
+ # @return [Time]
19
+ required :created_at, Time
20
+
21
+ # @!attribute created_by
22
+ #
23
+ # @return [String]
24
+ required :created_by, String
25
+
26
+ # @!attribute customer_id
27
+ #
28
+ # @return [String]
29
+ required :customer_id, String
30
+
31
+ # @!attribute overrides
32
+ #
33
+ # @return [Array<MetronomeSDK::Models::ContractV2::Override>]
34
+ required :overrides, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractV2::Override] }
35
+
36
+ # @!attribute scheduled_charges
37
+ #
38
+ # @return [Array<MetronomeSDK::Models::ScheduledCharge>]
39
+ required :scheduled_charges, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ScheduledCharge] }
40
+
41
+ # @!attribute starting_at
42
+ #
43
+ # @return [Time]
44
+ required :starting_at, Time
45
+
46
+ # @!attribute transitions
47
+ #
48
+ # @return [Array<MetronomeSDK::Models::ContractV2::Transition>]
49
+ required :transitions, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractV2::Transition] }
50
+
51
+ # @!attribute usage_filter
52
+ #
53
+ # @return [Array<MetronomeSDK::Models::ContractV2::UsageFilter>]
54
+ required :usage_filter,
55
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractV2::UsageFilter] }
56
+
57
+ # @!attribute usage_statement_schedule
58
+ #
59
+ # @return [MetronomeSDK::Models::ContractV2::UsageStatementSchedule]
60
+ required :usage_statement_schedule, -> { MetronomeSDK::ContractV2::UsageStatementSchedule }
61
+
62
+ # @!attribute archived_at
63
+ #
64
+ # @return [Time, nil]
65
+ optional :archived_at, Time
66
+
67
+ # @!attribute credits
68
+ #
69
+ # @return [Array<MetronomeSDK::Models::ContractV2::Credit>, nil]
70
+ optional :credits, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractV2::Credit] }
71
+
72
+ # @!attribute custom_fields
73
+ # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
74
+ #
75
+ # @return [Hash{Symbol=>String}, nil]
76
+ optional :custom_fields, MetronomeSDK::Internal::Type::HashOf[String]
77
+
78
+ # @!attribute customer_billing_provider_configuration
79
+ # This field's availability is dependent on your client's configuration.
80
+ #
81
+ # @return [MetronomeSDK::Models::ContractV2::CustomerBillingProviderConfiguration, nil]
82
+ optional :customer_billing_provider_configuration,
83
+ -> { MetronomeSDK::ContractV2::CustomerBillingProviderConfiguration }
84
+
85
+ # @!attribute discounts
86
+ # This field's availability is dependent on your client's configuration.
87
+ #
88
+ # @return [Array<MetronomeSDK::Models::Discount>, nil]
89
+ optional :discounts, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Discount] }
90
+
91
+ # @!attribute ending_before
92
+ #
93
+ # @return [Time, nil]
94
+ optional :ending_before, Time
95
+
96
+ # @!attribute has_more
97
+ # Indicates whether there are more items than the limit for this endpoint. Use the
98
+ # respective list endpoints to get the full lists.
99
+ #
100
+ # @return [MetronomeSDK::Models::ContractV2::HasMore, nil]
101
+ optional :has_more, -> { MetronomeSDK::ContractV2::HasMore }
102
+
103
+ # @!attribute hierarchy_configuration
104
+ # Either a **parent** configuration with a list of children or a **child**
105
+ # configuration with a single parent.
106
+ #
107
+ # @return [MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration, MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2, nil]
108
+ optional :hierarchy_configuration, union: -> { MetronomeSDK::ContractV2::HierarchyConfiguration }
109
+
110
+ # @!attribute multiplier_override_prioritization
111
+ # Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
112
+ # prices automatically. EXPLICIT prioritization requires specifying priorities for
113
+ # each multiplier; the one with the lowest priority value will be prioritized
114
+ # first.
115
+ #
116
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::MultiplierOverridePrioritization, nil]
117
+ optional :multiplier_override_prioritization,
118
+ enum: -> { MetronomeSDK::ContractV2::MultiplierOverridePrioritization }
119
+
120
+ # @!attribute name
121
+ #
122
+ # @return [String, nil]
123
+ optional :name, String
124
+
125
+ # @!attribute net_payment_terms_days
126
+ #
127
+ # @return [Float, nil]
128
+ optional :net_payment_terms_days, Float
129
+
130
+ # @!attribute netsuite_sales_order_id
131
+ # This field's availability is dependent on your client's configuration.
132
+ #
133
+ # @return [String, nil]
134
+ optional :netsuite_sales_order_id, String
135
+
136
+ # @!attribute prepaid_balance_threshold_configuration
137
+ #
138
+ # @return [MetronomeSDK::Models::PrepaidBalanceThresholdConfigurationV2, nil]
139
+ optional :prepaid_balance_threshold_configuration,
140
+ -> { MetronomeSDK::PrepaidBalanceThresholdConfigurationV2 }
141
+
142
+ # @!attribute priority
143
+ # Priority of the contract.
144
+ #
145
+ # @return [Float, nil]
146
+ optional :priority, Float
147
+
148
+ # @!attribute professional_services
149
+ # This field's availability is dependent on your client's configuration.
150
+ #
151
+ # @return [Array<MetronomeSDK::Models::ProService>, nil]
152
+ optional :professional_services, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ProService] }
153
+
154
+ # @!attribute rate_card_id
155
+ #
156
+ # @return [String, nil]
157
+ optional :rate_card_id, String
158
+
159
+ # @!attribute recurring_commits
160
+ #
161
+ # @return [Array<MetronomeSDK::Models::ContractV2::RecurringCommit>, nil]
162
+ optional :recurring_commits,
163
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractV2::RecurringCommit] }
164
+
165
+ # @!attribute recurring_credits
166
+ #
167
+ # @return [Array<MetronomeSDK::Models::ContractV2::RecurringCredit>, nil]
168
+ optional :recurring_credits,
169
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractV2::RecurringCredit] }
170
+
171
+ # @!attribute reseller_royalties
172
+ # This field's availability is dependent on your client's configuration.
173
+ #
174
+ # @return [Array<MetronomeSDK::Models::ContractV2::ResellerRoyalty>, nil]
175
+ optional :reseller_royalties,
176
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractV2::ResellerRoyalty] }
177
+
178
+ # @!attribute salesforce_opportunity_id
179
+ # This field's availability is dependent on your client's configuration.
180
+ #
181
+ # @return [String, nil]
182
+ optional :salesforce_opportunity_id, String
183
+
184
+ # @!attribute scheduled_charges_on_usage_invoices
185
+ # Determines which scheduled and commit charges to consolidate onto the Contract's
186
+ # usage invoice. The charge's `timestamp` must match the usage invoice's
187
+ # `ending_before` date for consolidation to occur. This field cannot be modified
188
+ # after a Contract has been created. If this field is omitted, charges will appear
189
+ # on a separate invoice from usage charges.
190
+ #
191
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::ScheduledChargesOnUsageInvoices, nil]
192
+ optional :scheduled_charges_on_usage_invoices,
193
+ enum: -> { MetronomeSDK::ContractV2::ScheduledChargesOnUsageInvoices }
194
+
195
+ # @!attribute spend_threshold_configuration
196
+ #
197
+ # @return [MetronomeSDK::Models::SpendThresholdConfigurationV2, nil]
198
+ optional :spend_threshold_configuration, -> { MetronomeSDK::SpendThresholdConfigurationV2 }
199
+
200
+ # @!attribute subscriptions
201
+ # List of subscriptions on the contract.
202
+ #
203
+ # @return [Array<MetronomeSDK::Models::Subscription>, nil]
204
+ optional :subscriptions, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Subscription] }
205
+
206
+ # @!attribute total_contract_value
207
+ #
208
+ # @return [Float, nil]
209
+ optional :total_contract_value, Float
210
+
211
+ # @!attribute uniqueness_key
212
+ # Optional uniqueness key to prevent duplicate contract creations.
213
+ #
214
+ # @return [String, nil]
215
+ optional :uniqueness_key, String
216
+
217
+ # @!method initialize(id:, commits:, created_at:, created_by:, customer_id:, overrides:, scheduled_charges:, starting_at:, transitions:, usage_filter:, usage_statement_schedule:, archived_at: nil, credits: nil, custom_fields: nil, customer_billing_provider_configuration: nil, discounts: nil, ending_before: nil, has_more: nil, hierarchy_configuration: nil, multiplier_override_prioritization: nil, name: nil, net_payment_terms_days: nil, netsuite_sales_order_id: nil, prepaid_balance_threshold_configuration: nil, priority: nil, professional_services: nil, rate_card_id: nil, recurring_commits: nil, recurring_credits: nil, reseller_royalties: nil, salesforce_opportunity_id: nil, scheduled_charges_on_usage_invoices: nil, spend_threshold_configuration: nil, subscriptions: nil, total_contract_value: nil, uniqueness_key: nil)
218
+ # Some parameter documentations has been truncated, see
219
+ # {MetronomeSDK::Models::ContractV2} for more details.
220
+ #
221
+ # @param id [String]
222
+ #
223
+ # @param commits [Array<MetronomeSDK::Models::ContractV2::Commit>]
224
+ #
225
+ # @param created_at [Time]
226
+ #
227
+ # @param created_by [String]
228
+ #
229
+ # @param customer_id [String]
230
+ #
231
+ # @param overrides [Array<MetronomeSDK::Models::ContractV2::Override>]
232
+ #
233
+ # @param scheduled_charges [Array<MetronomeSDK::Models::ScheduledCharge>]
234
+ #
235
+ # @param starting_at [Time]
236
+ #
237
+ # @param transitions [Array<MetronomeSDK::Models::ContractV2::Transition>]
238
+ #
239
+ # @param usage_filter [Array<MetronomeSDK::Models::ContractV2::UsageFilter>]
240
+ #
241
+ # @param usage_statement_schedule [MetronomeSDK::Models::ContractV2::UsageStatementSchedule]
242
+ #
243
+ # @param archived_at [Time]
244
+ #
245
+ # @param credits [Array<MetronomeSDK::Models::ContractV2::Credit>]
246
+ #
247
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
248
+ #
249
+ # @param customer_billing_provider_configuration [MetronomeSDK::Models::ContractV2::CustomerBillingProviderConfiguration] This field's availability is dependent on your client's configuration.
250
+ #
251
+ # @param discounts [Array<MetronomeSDK::Models::Discount>] This field's availability is dependent on your client's configuration.
252
+ #
253
+ # @param ending_before [Time]
254
+ #
255
+ # @param has_more [MetronomeSDK::Models::ContractV2::HasMore] Indicates whether there are more items than the limit for this endpoint. Use the
256
+ #
257
+ # @param hierarchy_configuration [MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration, MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2] Either a **parent** configuration with a list of children or a **child** configu
258
+ #
259
+ # @param multiplier_override_prioritization [Symbol, MetronomeSDK::Models::ContractV2::MultiplierOverridePrioritization] Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list price
260
+ #
261
+ # @param name [String]
262
+ #
263
+ # @param net_payment_terms_days [Float]
264
+ #
265
+ # @param netsuite_sales_order_id [String] This field's availability is dependent on your client's configuration.
266
+ #
267
+ # @param prepaid_balance_threshold_configuration [MetronomeSDK::Models::PrepaidBalanceThresholdConfigurationV2]
268
+ #
269
+ # @param priority [Float] Priority of the contract.
270
+ #
271
+ # @param professional_services [Array<MetronomeSDK::Models::ProService>] This field's availability is dependent on your client's configuration.
272
+ #
273
+ # @param rate_card_id [String]
274
+ #
275
+ # @param recurring_commits [Array<MetronomeSDK::Models::ContractV2::RecurringCommit>]
276
+ #
277
+ # @param recurring_credits [Array<MetronomeSDK::Models::ContractV2::RecurringCredit>]
278
+ #
279
+ # @param reseller_royalties [Array<MetronomeSDK::Models::ContractV2::ResellerRoyalty>] This field's availability is dependent on your client's configuration.
280
+ #
281
+ # @param salesforce_opportunity_id [String] This field's availability is dependent on your client's configuration.
282
+ #
283
+ # @param scheduled_charges_on_usage_invoices [Symbol, MetronomeSDK::Models::ContractV2::ScheduledChargesOnUsageInvoices] Determines which scheduled and commit charges to consolidate onto the Contract's
284
+ #
285
+ # @param spend_threshold_configuration [MetronomeSDK::Models::SpendThresholdConfigurationV2]
286
+ #
287
+ # @param subscriptions [Array<MetronomeSDK::Models::Subscription>] List of subscriptions on the contract.
288
+ #
289
+ # @param total_contract_value [Float]
290
+ #
291
+ # @param uniqueness_key [String] Optional uniqueness key to prevent duplicate contract creations.
292
+
293
+ class Commit < MetronomeSDK::Internal::Type::BaseModel
294
+ # @!attribute id
295
+ #
296
+ # @return [String]
297
+ required :id, String
298
+
299
+ # @!attribute created_at
300
+ # Timestamp of when the commit was created.
301
+ #
302
+ # - Recurring commits: latter of commit service period date and parent commit
303
+ # start date
304
+ # - Rollover commits: when the new contract started
305
+ #
306
+ # @return [Time]
307
+ required :created_at, Time
308
+
309
+ # @!attribute product
310
+ #
311
+ # @return [MetronomeSDK::Models::ContractV2::Commit::Product]
312
+ required :product, -> { MetronomeSDK::ContractV2::Commit::Product }
313
+
314
+ # @!attribute type
315
+ #
316
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Type]
317
+ required :type, enum: -> { MetronomeSDK::ContractV2::Commit::Type }
318
+
319
+ # @!attribute access_schedule
320
+ # The schedule that the customer will gain access to the credits purposed with
321
+ # this commit.
322
+ #
323
+ # @return [MetronomeSDK::Models::ScheduleDuration, nil]
324
+ optional :access_schedule, -> { MetronomeSDK::ScheduleDuration }
325
+
326
+ # @!attribute applicable_contract_ids
327
+ #
328
+ # @return [Array<String>, nil]
329
+ optional :applicable_contract_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
330
+
331
+ # @!attribute applicable_product_ids
332
+ #
333
+ # @return [Array<String>, nil]
334
+ optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
335
+
336
+ # @!attribute applicable_product_tags
337
+ #
338
+ # @return [Array<String>, nil]
339
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
340
+
341
+ # @!attribute archived_at
342
+ #
343
+ # @return [Time, nil]
344
+ optional :archived_at, Time
345
+
346
+ # @!attribute balance
347
+ # The current balance of the credit or commit. This balance reflects the amount of
348
+ # credit or commit that the customer has access to use at this moment - thus,
349
+ # expired and upcoming credit or commit segments contribute 0 to the balance. The
350
+ # balance will match the sum of all ledger entries with the exception of the case
351
+ # where the sum of negative manual ledger entries exceeds the positive amount
352
+ # remaining on the credit or commit - in that case, the balance will be 0. All
353
+ # manual ledger entries associated with active credit or commit segments are
354
+ # included in the balance, including future-dated manual ledger entries.
355
+ #
356
+ # @return [Float, nil]
357
+ optional :balance, Float
358
+
359
+ # @!attribute contract
360
+ #
361
+ # @return [MetronomeSDK::Models::ContractV2::Commit::Contract, nil]
362
+ optional :contract, -> { MetronomeSDK::ContractV2::Commit::Contract }
363
+
364
+ # @!attribute custom_fields
365
+ # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
366
+ #
367
+ # @return [Hash{Symbol=>String}, nil]
368
+ optional :custom_fields, MetronomeSDK::Internal::Type::HashOf[String]
369
+
370
+ # @!attribute description
371
+ #
372
+ # @return [String, nil]
373
+ optional :description, String
374
+
375
+ # @!attribute hierarchy_configuration
376
+ # Optional configuration for commit hierarchy access control
377
+ #
378
+ # @return [MetronomeSDK::Models::CommitHierarchyConfiguration, nil]
379
+ optional :hierarchy_configuration, -> { MetronomeSDK::CommitHierarchyConfiguration }
380
+
381
+ # @!attribute invoice_contract
382
+ # The contract that this commit will be billed on.
383
+ #
384
+ # @return [MetronomeSDK::Models::ContractV2::Commit::InvoiceContract, nil]
385
+ optional :invoice_contract, -> { MetronomeSDK::ContractV2::Commit::InvoiceContract }
386
+
387
+ # @!attribute invoice_schedule
388
+ # The schedule that the customer will be invoiced for this commit.
389
+ #
390
+ # @return [MetronomeSDK::Models::SchedulePointInTime, nil]
391
+ optional :invoice_schedule, -> { MetronomeSDK::SchedulePointInTime }
392
+
393
+ # @!attribute ledger
394
+ # A list of ordered events that impact the balance of a commit. For example, an
395
+ # invoice deduction or a rollover.
396
+ #
397
+ # @return [Array<MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitSegmentStartLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitRolloverLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitExpirationLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitCanceledLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitCreditedLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitSeatBasedAdjustmentLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitInitialBalanceLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitRolloverLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitTrueupLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitManualLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitManualLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitExpirationLedgerEntry>, nil]
398
+ optional :ledger,
399
+ -> { MetronomeSDK::Internal::Type::ArrayOf[union: MetronomeSDK::ContractV2::Commit::Ledger] }
400
+
401
+ # @!attribute name
402
+ #
403
+ # @return [String, nil]
404
+ optional :name, String
405
+
406
+ # @!attribute netsuite_sales_order_id
407
+ # This field's availability is dependent on your client's configuration.
408
+ #
409
+ # @return [String, nil]
410
+ optional :netsuite_sales_order_id, String
411
+
412
+ # @!attribute priority
413
+ # If multiple credits or commits are applicable, the one with the lower priority
414
+ # will apply first.
415
+ #
416
+ # @return [Float, nil]
417
+ optional :priority, Float
418
+
419
+ # @!attribute rate_type
420
+ #
421
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::RateType, nil]
422
+ optional :rate_type, enum: -> { MetronomeSDK::ContractV2::Commit::RateType }
423
+
424
+ # @!attribute rolled_over_from
425
+ #
426
+ # @return [MetronomeSDK::Models::ContractV2::Commit::RolledOverFrom, nil]
427
+ optional :rolled_over_from, -> { MetronomeSDK::ContractV2::Commit::RolledOverFrom }
428
+
429
+ # @!attribute rollover_fraction
430
+ #
431
+ # @return [Float, nil]
432
+ optional :rollover_fraction, Float
433
+
434
+ # @!attribute salesforce_opportunity_id
435
+ # This field's availability is dependent on your client's configuration.
436
+ #
437
+ # @return [String, nil]
438
+ optional :salesforce_opportunity_id, String
439
+
440
+ # @!attribute specifiers
441
+ # List of filters that determine what kind of customer usage draws down a commit
442
+ # or credit. A customer's usage needs to meet the condition of at least one of the
443
+ # specifiers to contribute to a commit's or credit's drawdown.
444
+ #
445
+ # @return [Array<MetronomeSDK::Models::CommitSpecifier>, nil]
446
+ optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifier] }
447
+
448
+ # @!method initialize(id:, created_at:, product:, type:, access_schedule: nil, applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, archived_at: nil, balance: nil, contract: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, invoice_contract: nil, invoice_schedule: nil, ledger: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, rolled_over_from: nil, rollover_fraction: nil, salesforce_opportunity_id: nil, specifiers: nil)
449
+ # Some parameter documentations has been truncated, see
450
+ # {MetronomeSDK::Models::ContractV2::Commit} for more details.
451
+ #
452
+ # @param id [String]
453
+ #
454
+ # @param created_at [Time] Timestamp of when the commit was created.
455
+ #
456
+ # @param product [MetronomeSDK::Models::ContractV2::Commit::Product]
457
+ #
458
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Type]
459
+ #
460
+ # @param access_schedule [MetronomeSDK::Models::ScheduleDuration] The schedule that the customer will gain access to the credits purposed with thi
461
+ #
462
+ # @param applicable_contract_ids [Array<String>]
463
+ #
464
+ # @param applicable_product_ids [Array<String>]
465
+ #
466
+ # @param applicable_product_tags [Array<String>]
467
+ #
468
+ # @param archived_at [Time]
469
+ #
470
+ # @param balance [Float] The current balance of the credit or commit. This balance reflects the amount of
471
+ #
472
+ # @param contract [MetronomeSDK::Models::ContractV2::Commit::Contract]
473
+ #
474
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
475
+ #
476
+ # @param description [String]
477
+ #
478
+ # @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for commit hierarchy access control
479
+ #
480
+ # @param invoice_contract [MetronomeSDK::Models::ContractV2::Commit::InvoiceContract] The contract that this commit will be billed on.
481
+ #
482
+ # @param invoice_schedule [MetronomeSDK::Models::SchedulePointInTime] The schedule that the customer will be invoiced for this commit.
483
+ #
484
+ # @param ledger [Array<MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitSegmentStartLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitRolloverLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitExpirationLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitCanceledLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitCreditedLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitSeatBasedAdjustmentLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitInitialBalanceLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitRolloverLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitTrueupLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitManualLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitManualLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitExpirationLedgerEntry>] A list of ordered events that impact the balance of a commit. For example, an in
485
+ #
486
+ # @param name [String]
487
+ #
488
+ # @param netsuite_sales_order_id [String] This field's availability is dependent on your client's configuration.
489
+ #
490
+ # @param priority [Float] If multiple credits or commits are applicable, the one with the lower priority w
491
+ #
492
+ # @param rate_type [Symbol, MetronomeSDK::Models::ContractV2::Commit::RateType]
493
+ #
494
+ # @param rolled_over_from [MetronomeSDK::Models::ContractV2::Commit::RolledOverFrom]
495
+ #
496
+ # @param rollover_fraction [Float]
497
+ #
498
+ # @param salesforce_opportunity_id [String] This field's availability is dependent on your client's configuration.
499
+ #
500
+ # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifier>] List of filters that determine what kind of customer usage draws down a commit o
501
+
502
+ # @see MetronomeSDK::Models::ContractV2::Commit#product
503
+ class Product < MetronomeSDK::Internal::Type::BaseModel
504
+ # @!attribute id
505
+ #
506
+ # @return [String]
507
+ required :id, String
508
+
509
+ # @!attribute name
510
+ #
511
+ # @return [String]
512
+ required :name, String
513
+
514
+ # @!method initialize(id:, name:)
515
+ # @param id [String]
516
+ # @param name [String]
517
+ end
518
+
519
+ # @see MetronomeSDK::Models::ContractV2::Commit#type
520
+ module Type
521
+ extend MetronomeSDK::Internal::Type::Enum
522
+
523
+ PREPAID = :PREPAID
524
+ POSTPAID = :POSTPAID
525
+
526
+ # @!method self.values
527
+ # @return [Array<Symbol>]
528
+ end
529
+
530
+ # @see MetronomeSDK::Models::ContractV2::Commit#contract
531
+ class Contract < MetronomeSDK::Internal::Type::BaseModel
532
+ # @!attribute id
533
+ #
534
+ # @return [String]
535
+ required :id, String
536
+
537
+ # @!method initialize(id:)
538
+ # @param id [String]
539
+ end
540
+
541
+ # @see MetronomeSDK::Models::ContractV2::Commit#invoice_contract
542
+ class InvoiceContract < MetronomeSDK::Internal::Type::BaseModel
543
+ # @!attribute id
544
+ #
545
+ # @return [String]
546
+ required :id, String
547
+
548
+ # @!method initialize(id:)
549
+ # The contract that this commit will be billed on.
550
+ #
551
+ # @param id [String]
552
+ end
553
+
554
+ module Ledger
555
+ extend MetronomeSDK::Internal::Type::Union
556
+
557
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitSegmentStartLedgerEntry }
558
+
559
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitAutomatedInvoiceDeductionLedgerEntry }
560
+
561
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitRolloverLedgerEntry }
562
+
563
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitExpirationLedgerEntry }
564
+
565
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitCanceledLedgerEntry }
566
+
567
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitCreditedLedgerEntry }
568
+
569
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitSeatBasedAdjustmentLedgerEntry }
570
+
571
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PostpaidCommitInitialBalanceLedgerEntry }
572
+
573
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PostpaidCommitAutomatedInvoiceDeductionLedgerEntry }
574
+
575
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PostpaidCommitRolloverLedgerEntry }
576
+
577
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PostpaidCommitTrueupLedgerEntry }
578
+
579
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitManualLedgerEntry }
580
+
581
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PostpaidCommitManualLedgerEntry }
582
+
583
+ variant -> { MetronomeSDK::ContractV2::Commit::Ledger::PostpaidCommitExpirationLedgerEntry }
584
+
585
+ class PrepaidCommitSegmentStartLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
586
+ # @!attribute amount
587
+ #
588
+ # @return [Float]
589
+ required :amount, Float
590
+
591
+ # @!attribute segment_id
592
+ #
593
+ # @return [String]
594
+ required :segment_id, String
595
+
596
+ # @!attribute timestamp
597
+ #
598
+ # @return [Time]
599
+ required :timestamp, Time
600
+
601
+ # @!attribute type
602
+ #
603
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitSegmentStartLedgerEntry::Type]
604
+ required :type,
605
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitSegmentStartLedgerEntry::Type }
606
+
607
+ # @!method initialize(amount:, segment_id:, timestamp:, type:)
608
+ # @param amount [Float]
609
+ # @param segment_id [String]
610
+ # @param timestamp [Time]
611
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitSegmentStartLedgerEntry::Type]
612
+
613
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitSegmentStartLedgerEntry#type
614
+ module Type
615
+ extend MetronomeSDK::Internal::Type::Enum
616
+
617
+ PREPAID_COMMIT_SEGMENT_START = :PREPAID_COMMIT_SEGMENT_START
618
+
619
+ # @!method self.values
620
+ # @return [Array<Symbol>]
621
+ end
622
+ end
623
+
624
+ class PrepaidCommitAutomatedInvoiceDeductionLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
625
+ # @!attribute amount
626
+ #
627
+ # @return [Float]
628
+ required :amount, Float
629
+
630
+ # @!attribute invoice_id
631
+ #
632
+ # @return [String]
633
+ required :invoice_id, String
634
+
635
+ # @!attribute segment_id
636
+ #
637
+ # @return [String]
638
+ required :segment_id, String
639
+
640
+ # @!attribute timestamp
641
+ #
642
+ # @return [Time]
643
+ required :timestamp, Time
644
+
645
+ # @!attribute type
646
+ #
647
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitAutomatedInvoiceDeductionLedgerEntry::Type]
648
+ required :type,
649
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitAutomatedInvoiceDeductionLedgerEntry::Type }
650
+
651
+ # @!attribute contract_id
652
+ #
653
+ # @return [String, nil]
654
+ optional :contract_id, String
655
+
656
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
657
+ # @param amount [Float]
658
+ # @param invoice_id [String]
659
+ # @param segment_id [String]
660
+ # @param timestamp [Time]
661
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitAutomatedInvoiceDeductionLedgerEntry::Type]
662
+ # @param contract_id [String]
663
+
664
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitAutomatedInvoiceDeductionLedgerEntry#type
665
+ module Type
666
+ extend MetronomeSDK::Internal::Type::Enum
667
+
668
+ PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION = :PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION
669
+
670
+ # @!method self.values
671
+ # @return [Array<Symbol>]
672
+ end
673
+ end
674
+
675
+ class PrepaidCommitRolloverLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
676
+ # @!attribute amount
677
+ #
678
+ # @return [Float]
679
+ required :amount, Float
680
+
681
+ # @!attribute new_contract_id
682
+ #
683
+ # @return [String]
684
+ required :new_contract_id, String
685
+
686
+ # @!attribute segment_id
687
+ #
688
+ # @return [String]
689
+ required :segment_id, String
690
+
691
+ # @!attribute timestamp
692
+ #
693
+ # @return [Time]
694
+ required :timestamp, Time
695
+
696
+ # @!attribute type
697
+ #
698
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitRolloverLedgerEntry::Type]
699
+ required :type,
700
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitRolloverLedgerEntry::Type }
701
+
702
+ # @!method initialize(amount:, new_contract_id:, segment_id:, timestamp:, type:)
703
+ # @param amount [Float]
704
+ # @param new_contract_id [String]
705
+ # @param segment_id [String]
706
+ # @param timestamp [Time]
707
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitRolloverLedgerEntry::Type]
708
+
709
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitRolloverLedgerEntry#type
710
+ module Type
711
+ extend MetronomeSDK::Internal::Type::Enum
712
+
713
+ PREPAID_COMMIT_ROLLOVER = :PREPAID_COMMIT_ROLLOVER
714
+
715
+ # @!method self.values
716
+ # @return [Array<Symbol>]
717
+ end
718
+ end
719
+
720
+ class PrepaidCommitExpirationLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
721
+ # @!attribute amount
722
+ #
723
+ # @return [Float]
724
+ required :amount, Float
725
+
726
+ # @!attribute segment_id
727
+ #
728
+ # @return [String]
729
+ required :segment_id, String
730
+
731
+ # @!attribute timestamp
732
+ #
733
+ # @return [Time]
734
+ required :timestamp, Time
735
+
736
+ # @!attribute type
737
+ #
738
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitExpirationLedgerEntry::Type]
739
+ required :type,
740
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitExpirationLedgerEntry::Type }
741
+
742
+ # @!method initialize(amount:, segment_id:, timestamp:, type:)
743
+ # @param amount [Float]
744
+ # @param segment_id [String]
745
+ # @param timestamp [Time]
746
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitExpirationLedgerEntry::Type]
747
+
748
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitExpirationLedgerEntry#type
749
+ module Type
750
+ extend MetronomeSDK::Internal::Type::Enum
751
+
752
+ PREPAID_COMMIT_EXPIRATION = :PREPAID_COMMIT_EXPIRATION
753
+
754
+ # @!method self.values
755
+ # @return [Array<Symbol>]
756
+ end
757
+ end
758
+
759
+ class PrepaidCommitCanceledLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
760
+ # @!attribute amount
761
+ #
762
+ # @return [Float]
763
+ required :amount, Float
764
+
765
+ # @!attribute invoice_id
766
+ #
767
+ # @return [String]
768
+ required :invoice_id, String
769
+
770
+ # @!attribute segment_id
771
+ #
772
+ # @return [String]
773
+ required :segment_id, String
774
+
775
+ # @!attribute timestamp
776
+ #
777
+ # @return [Time]
778
+ required :timestamp, Time
779
+
780
+ # @!attribute type
781
+ #
782
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitCanceledLedgerEntry::Type]
783
+ required :type,
784
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitCanceledLedgerEntry::Type }
785
+
786
+ # @!attribute contract_id
787
+ #
788
+ # @return [String, nil]
789
+ optional :contract_id, String
790
+
791
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
792
+ # @param amount [Float]
793
+ # @param invoice_id [String]
794
+ # @param segment_id [String]
795
+ # @param timestamp [Time]
796
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitCanceledLedgerEntry::Type]
797
+ # @param contract_id [String]
798
+
799
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitCanceledLedgerEntry#type
800
+ module Type
801
+ extend MetronomeSDK::Internal::Type::Enum
802
+
803
+ PREPAID_COMMIT_CANCELED = :PREPAID_COMMIT_CANCELED
804
+
805
+ # @!method self.values
806
+ # @return [Array<Symbol>]
807
+ end
808
+ end
809
+
810
+ class PrepaidCommitCreditedLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
811
+ # @!attribute amount
812
+ #
813
+ # @return [Float]
814
+ required :amount, Float
815
+
816
+ # @!attribute invoice_id
817
+ #
818
+ # @return [String]
819
+ required :invoice_id, String
820
+
821
+ # @!attribute segment_id
822
+ #
823
+ # @return [String]
824
+ required :segment_id, String
825
+
826
+ # @!attribute timestamp
827
+ #
828
+ # @return [Time]
829
+ required :timestamp, Time
830
+
831
+ # @!attribute type
832
+ #
833
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitCreditedLedgerEntry::Type]
834
+ required :type,
835
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitCreditedLedgerEntry::Type }
836
+
837
+ # @!attribute contract_id
838
+ #
839
+ # @return [String, nil]
840
+ optional :contract_id, String
841
+
842
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
843
+ # @param amount [Float]
844
+ # @param invoice_id [String]
845
+ # @param segment_id [String]
846
+ # @param timestamp [Time]
847
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitCreditedLedgerEntry::Type]
848
+ # @param contract_id [String]
849
+
850
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitCreditedLedgerEntry#type
851
+ module Type
852
+ extend MetronomeSDK::Internal::Type::Enum
853
+
854
+ PREPAID_COMMIT_CREDITED = :PREPAID_COMMIT_CREDITED
855
+
856
+ # @!method self.values
857
+ # @return [Array<Symbol>]
858
+ end
859
+ end
860
+
861
+ class PrepaidCommitSeatBasedAdjustmentLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
862
+ # @!attribute amount
863
+ #
864
+ # @return [Float]
865
+ required :amount, Float
866
+
867
+ # @!attribute segment_id
868
+ #
869
+ # @return [String]
870
+ required :segment_id, String
871
+
872
+ # @!attribute timestamp
873
+ #
874
+ # @return [Time]
875
+ required :timestamp, Time
876
+
877
+ # @!attribute type
878
+ #
879
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitSeatBasedAdjustmentLedgerEntry::Type]
880
+ required :type,
881
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitSeatBasedAdjustmentLedgerEntry::Type }
882
+
883
+ # @!method initialize(amount:, segment_id:, timestamp:, type:)
884
+ # @param amount [Float]
885
+ # @param segment_id [String]
886
+ # @param timestamp [Time]
887
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitSeatBasedAdjustmentLedgerEntry::Type]
888
+
889
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitSeatBasedAdjustmentLedgerEntry#type
890
+ module Type
891
+ extend MetronomeSDK::Internal::Type::Enum
892
+
893
+ PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT = :PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT
894
+
895
+ # @!method self.values
896
+ # @return [Array<Symbol>]
897
+ end
898
+ end
899
+
900
+ class PostpaidCommitInitialBalanceLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
901
+ # @!attribute amount
902
+ #
903
+ # @return [Float]
904
+ required :amount, Float
905
+
906
+ # @!attribute timestamp
907
+ #
908
+ # @return [Time]
909
+ required :timestamp, Time
910
+
911
+ # @!attribute type
912
+ #
913
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitInitialBalanceLedgerEntry::Type]
914
+ required :type,
915
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PostpaidCommitInitialBalanceLedgerEntry::Type }
916
+
917
+ # @!method initialize(amount:, timestamp:, type:)
918
+ # @param amount [Float]
919
+ # @param timestamp [Time]
920
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitInitialBalanceLedgerEntry::Type]
921
+
922
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitInitialBalanceLedgerEntry#type
923
+ module Type
924
+ extend MetronomeSDK::Internal::Type::Enum
925
+
926
+ POSTPAID_COMMIT_INITIAL_BALANCE = :POSTPAID_COMMIT_INITIAL_BALANCE
927
+
928
+ # @!method self.values
929
+ # @return [Array<Symbol>]
930
+ end
931
+ end
932
+
933
+ class PostpaidCommitAutomatedInvoiceDeductionLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
934
+ # @!attribute amount
935
+ #
936
+ # @return [Float]
937
+ required :amount, Float
938
+
939
+ # @!attribute invoice_id
940
+ #
941
+ # @return [String]
942
+ required :invoice_id, String
943
+
944
+ # @!attribute segment_id
945
+ #
946
+ # @return [String]
947
+ required :segment_id, String
948
+
949
+ # @!attribute timestamp
950
+ #
951
+ # @return [Time]
952
+ required :timestamp, Time
953
+
954
+ # @!attribute type
955
+ #
956
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitAutomatedInvoiceDeductionLedgerEntry::Type]
957
+ required :type,
958
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PostpaidCommitAutomatedInvoiceDeductionLedgerEntry::Type }
959
+
960
+ # @!attribute contract_id
961
+ #
962
+ # @return [String, nil]
963
+ optional :contract_id, String
964
+
965
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
966
+ # @param amount [Float]
967
+ # @param invoice_id [String]
968
+ # @param segment_id [String]
969
+ # @param timestamp [Time]
970
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitAutomatedInvoiceDeductionLedgerEntry::Type]
971
+ # @param contract_id [String]
972
+
973
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitAutomatedInvoiceDeductionLedgerEntry#type
974
+ module Type
975
+ extend MetronomeSDK::Internal::Type::Enum
976
+
977
+ POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION = :POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION
978
+
979
+ # @!method self.values
980
+ # @return [Array<Symbol>]
981
+ end
982
+ end
983
+
984
+ class PostpaidCommitRolloverLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
985
+ # @!attribute amount
986
+ #
987
+ # @return [Float]
988
+ required :amount, Float
989
+
990
+ # @!attribute new_contract_id
991
+ #
992
+ # @return [String]
993
+ required :new_contract_id, String
994
+
995
+ # @!attribute segment_id
996
+ #
997
+ # @return [String]
998
+ required :segment_id, String
999
+
1000
+ # @!attribute timestamp
1001
+ #
1002
+ # @return [Time]
1003
+ required :timestamp, Time
1004
+
1005
+ # @!attribute type
1006
+ #
1007
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitRolloverLedgerEntry::Type]
1008
+ required :type,
1009
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PostpaidCommitRolloverLedgerEntry::Type }
1010
+
1011
+ # @!method initialize(amount:, new_contract_id:, segment_id:, timestamp:, type:)
1012
+ # @param amount [Float]
1013
+ # @param new_contract_id [String]
1014
+ # @param segment_id [String]
1015
+ # @param timestamp [Time]
1016
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitRolloverLedgerEntry::Type]
1017
+
1018
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitRolloverLedgerEntry#type
1019
+ module Type
1020
+ extend MetronomeSDK::Internal::Type::Enum
1021
+
1022
+ POSTPAID_COMMIT_ROLLOVER = :POSTPAID_COMMIT_ROLLOVER
1023
+
1024
+ # @!method self.values
1025
+ # @return [Array<Symbol>]
1026
+ end
1027
+ end
1028
+
1029
+ class PostpaidCommitTrueupLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
1030
+ # @!attribute amount
1031
+ #
1032
+ # @return [Float]
1033
+ required :amount, Float
1034
+
1035
+ # @!attribute invoice_id
1036
+ #
1037
+ # @return [String]
1038
+ required :invoice_id, String
1039
+
1040
+ # @!attribute timestamp
1041
+ #
1042
+ # @return [Time]
1043
+ required :timestamp, Time
1044
+
1045
+ # @!attribute type
1046
+ #
1047
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitTrueupLedgerEntry::Type]
1048
+ required :type,
1049
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PostpaidCommitTrueupLedgerEntry::Type }
1050
+
1051
+ # @!attribute contract_id
1052
+ #
1053
+ # @return [String, nil]
1054
+ optional :contract_id, String
1055
+
1056
+ # @!method initialize(amount:, invoice_id:, timestamp:, type:, contract_id: nil)
1057
+ # @param amount [Float]
1058
+ # @param invoice_id [String]
1059
+ # @param timestamp [Time]
1060
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitTrueupLedgerEntry::Type]
1061
+ # @param contract_id [String]
1062
+
1063
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitTrueupLedgerEntry#type
1064
+ module Type
1065
+ extend MetronomeSDK::Internal::Type::Enum
1066
+
1067
+ POSTPAID_COMMIT_TRUEUP = :POSTPAID_COMMIT_TRUEUP
1068
+
1069
+ # @!method self.values
1070
+ # @return [Array<Symbol>]
1071
+ end
1072
+ end
1073
+
1074
+ class PrepaidCommitManualLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
1075
+ # @!attribute amount
1076
+ #
1077
+ # @return [Float]
1078
+ required :amount, Float
1079
+
1080
+ # @!attribute reason
1081
+ #
1082
+ # @return [String]
1083
+ required :reason, String
1084
+
1085
+ # @!attribute timestamp
1086
+ #
1087
+ # @return [Time]
1088
+ required :timestamp, Time
1089
+
1090
+ # @!attribute type
1091
+ #
1092
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitManualLedgerEntry::Type]
1093
+ required :type,
1094
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PrepaidCommitManualLedgerEntry::Type }
1095
+
1096
+ # @!method initialize(amount:, reason:, timestamp:, type:)
1097
+ # @param amount [Float]
1098
+ # @param reason [String]
1099
+ # @param timestamp [Time]
1100
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitManualLedgerEntry::Type]
1101
+
1102
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitManualLedgerEntry#type
1103
+ module Type
1104
+ extend MetronomeSDK::Internal::Type::Enum
1105
+
1106
+ PREPAID_COMMIT_MANUAL = :PREPAID_COMMIT_MANUAL
1107
+
1108
+ # @!method self.values
1109
+ # @return [Array<Symbol>]
1110
+ end
1111
+ end
1112
+
1113
+ class PostpaidCommitManualLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
1114
+ # @!attribute amount
1115
+ #
1116
+ # @return [Float]
1117
+ required :amount, Float
1118
+
1119
+ # @!attribute reason
1120
+ #
1121
+ # @return [String]
1122
+ required :reason, String
1123
+
1124
+ # @!attribute timestamp
1125
+ #
1126
+ # @return [Time]
1127
+ required :timestamp, Time
1128
+
1129
+ # @!attribute type
1130
+ #
1131
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitManualLedgerEntry::Type]
1132
+ required :type,
1133
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PostpaidCommitManualLedgerEntry::Type }
1134
+
1135
+ # @!method initialize(amount:, reason:, timestamp:, type:)
1136
+ # @param amount [Float]
1137
+ # @param reason [String]
1138
+ # @param timestamp [Time]
1139
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitManualLedgerEntry::Type]
1140
+
1141
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitManualLedgerEntry#type
1142
+ module Type
1143
+ extend MetronomeSDK::Internal::Type::Enum
1144
+
1145
+ POSTPAID_COMMIT_MANUAL = :POSTPAID_COMMIT_MANUAL
1146
+
1147
+ # @!method self.values
1148
+ # @return [Array<Symbol>]
1149
+ end
1150
+ end
1151
+
1152
+ class PostpaidCommitExpirationLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
1153
+ # @!attribute amount
1154
+ #
1155
+ # @return [Float]
1156
+ required :amount, Float
1157
+
1158
+ # @!attribute timestamp
1159
+ #
1160
+ # @return [Time]
1161
+ required :timestamp, Time
1162
+
1163
+ # @!attribute type
1164
+ #
1165
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitExpirationLedgerEntry::Type]
1166
+ required :type,
1167
+ enum: -> { MetronomeSDK::ContractV2::Commit::Ledger::PostpaidCommitExpirationLedgerEntry::Type }
1168
+
1169
+ # @!method initialize(amount:, timestamp:, type:)
1170
+ # @param amount [Float]
1171
+ # @param timestamp [Time]
1172
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitExpirationLedgerEntry::Type]
1173
+
1174
+ # @see MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitExpirationLedgerEntry#type
1175
+ module Type
1176
+ extend MetronomeSDK::Internal::Type::Enum
1177
+
1178
+ POSTPAID_COMMIT_EXPIRATION = :POSTPAID_COMMIT_EXPIRATION
1179
+
1180
+ # @!method self.values
1181
+ # @return [Array<Symbol>]
1182
+ end
1183
+ end
1184
+
1185
+ # @!method self.variants
1186
+ # @return [Array(MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitSegmentStartLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitRolloverLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitExpirationLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitCanceledLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitCreditedLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitSeatBasedAdjustmentLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitInitialBalanceLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitRolloverLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitTrueupLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PrepaidCommitManualLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitManualLedgerEntry, MetronomeSDK::Models::ContractV2::Commit::Ledger::PostpaidCommitExpirationLedgerEntry)]
1187
+ end
1188
+
1189
+ # @see MetronomeSDK::Models::ContractV2::Commit#rate_type
1190
+ module RateType
1191
+ extend MetronomeSDK::Internal::Type::Enum
1192
+
1193
+ COMMIT_RATE = :COMMIT_RATE
1194
+ LIST_RATE = :LIST_RATE
1195
+
1196
+ # @!method self.values
1197
+ # @return [Array<Symbol>]
1198
+ end
1199
+
1200
+ # @see MetronomeSDK::Models::ContractV2::Commit#rolled_over_from
1201
+ class RolledOverFrom < MetronomeSDK::Internal::Type::BaseModel
1202
+ # @!attribute commit_id
1203
+ #
1204
+ # @return [String]
1205
+ required :commit_id, String
1206
+
1207
+ # @!attribute contract_id
1208
+ #
1209
+ # @return [String]
1210
+ required :contract_id, String
1211
+
1212
+ # @!method initialize(commit_id:, contract_id:)
1213
+ # @param commit_id [String]
1214
+ # @param contract_id [String]
1215
+ end
1216
+ end
1217
+
1218
+ class Override < MetronomeSDK::Internal::Type::BaseModel
1219
+ # @!attribute id
1220
+ #
1221
+ # @return [String]
1222
+ required :id, String
1223
+
1224
+ # @!attribute starting_at
1225
+ #
1226
+ # @return [Time]
1227
+ required :starting_at, Time
1228
+
1229
+ # @!attribute applicable_product_tags
1230
+ #
1231
+ # @return [Array<String>, nil]
1232
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
1233
+
1234
+ # @!attribute ending_before
1235
+ #
1236
+ # @return [Time, nil]
1237
+ optional :ending_before, Time
1238
+
1239
+ # @!attribute entitled
1240
+ #
1241
+ # @return [Boolean, nil]
1242
+ optional :entitled, MetronomeSDK::Internal::Type::Boolean
1243
+
1244
+ # @!attribute is_commit_specific
1245
+ #
1246
+ # @return [Boolean, nil]
1247
+ optional :is_commit_specific, MetronomeSDK::Internal::Type::Boolean
1248
+
1249
+ # @!attribute multiplier
1250
+ #
1251
+ # @return [Float, nil]
1252
+ optional :multiplier, Float
1253
+
1254
+ # @!attribute override_specifiers
1255
+ #
1256
+ # @return [Array<MetronomeSDK::Models::ContractV2::Override::OverrideSpecifier>, nil]
1257
+ optional :override_specifiers,
1258
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractV2::Override::OverrideSpecifier] }
1259
+
1260
+ # @!attribute override_tiers
1261
+ #
1262
+ # @return [Array<MetronomeSDK::Models::OverrideTier>, nil]
1263
+ optional :override_tiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::OverrideTier] }
1264
+
1265
+ # @!attribute overwrite_rate
1266
+ #
1267
+ # @return [MetronomeSDK::Models::ContractV2::Override::OverwriteRate, nil]
1268
+ optional :overwrite_rate, -> { MetronomeSDK::ContractV2::Override::OverwriteRate }
1269
+
1270
+ # @!attribute priority
1271
+ #
1272
+ # @return [Float, nil]
1273
+ optional :priority, Float
1274
+
1275
+ # @!attribute product
1276
+ #
1277
+ # @return [MetronomeSDK::Models::ContractV2::Override::Product, nil]
1278
+ optional :product, -> { MetronomeSDK::ContractV2::Override::Product }
1279
+
1280
+ # @!attribute target
1281
+ #
1282
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Override::Target, nil]
1283
+ optional :target, enum: -> { MetronomeSDK::ContractV2::Override::Target }
1284
+
1285
+ # @!attribute type
1286
+ #
1287
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Override::Type, nil]
1288
+ optional :type, enum: -> { MetronomeSDK::ContractV2::Override::Type }
1289
+
1290
+ # @!method initialize(id:, 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)
1291
+ # @param id [String]
1292
+ # @param starting_at [Time]
1293
+ # @param applicable_product_tags [Array<String>]
1294
+ # @param ending_before [Time]
1295
+ # @param entitled [Boolean]
1296
+ # @param is_commit_specific [Boolean]
1297
+ # @param multiplier [Float]
1298
+ # @param override_specifiers [Array<MetronomeSDK::Models::ContractV2::Override::OverrideSpecifier>]
1299
+ # @param override_tiers [Array<MetronomeSDK::Models::OverrideTier>]
1300
+ # @param overwrite_rate [MetronomeSDK::Models::ContractV2::Override::OverwriteRate]
1301
+ # @param priority [Float]
1302
+ # @param product [MetronomeSDK::Models::ContractV2::Override::Product]
1303
+ # @param target [Symbol, MetronomeSDK::Models::ContractV2::Override::Target]
1304
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Override::Type]
1305
+
1306
+ class OverrideSpecifier < MetronomeSDK::Internal::Type::BaseModel
1307
+ # @!attribute billing_frequency
1308
+ #
1309
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Override::OverrideSpecifier::BillingFrequency, nil]
1310
+ optional :billing_frequency,
1311
+ enum: -> { MetronomeSDK::ContractV2::Override::OverrideSpecifier::BillingFrequency }
1312
+
1313
+ # @!attribute commit_ids
1314
+ #
1315
+ # @return [Array<String>, nil]
1316
+ optional :commit_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
1317
+
1318
+ # @!attribute presentation_group_values
1319
+ #
1320
+ # @return [Hash{Symbol=>String, nil}, nil]
1321
+ optional :presentation_group_values, MetronomeSDK::Internal::Type::HashOf[String, nil?: true]
1322
+
1323
+ # @!attribute pricing_group_values
1324
+ #
1325
+ # @return [Hash{Symbol=>String}, nil]
1326
+ optional :pricing_group_values, MetronomeSDK::Internal::Type::HashOf[String]
1327
+
1328
+ # @!attribute product_id
1329
+ #
1330
+ # @return [String, nil]
1331
+ optional :product_id, String
1332
+
1333
+ # @!attribute product_tags
1334
+ #
1335
+ # @return [Array<String>, nil]
1336
+ optional :product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
1337
+
1338
+ # @!attribute recurring_commit_ids
1339
+ #
1340
+ # @return [Array<String>, nil]
1341
+ optional :recurring_commit_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
1342
+
1343
+ # @!attribute recurring_credit_ids
1344
+ #
1345
+ # @return [Array<String>, nil]
1346
+ optional :recurring_credit_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
1347
+
1348
+ # @!method initialize(billing_frequency: nil, commit_ids: nil, presentation_group_values: nil, pricing_group_values: nil, product_id: nil, product_tags: nil, recurring_commit_ids: nil, recurring_credit_ids: nil)
1349
+ # @param billing_frequency [Symbol, MetronomeSDK::Models::ContractV2::Override::OverrideSpecifier::BillingFrequency]
1350
+ # @param commit_ids [Array<String>]
1351
+ # @param presentation_group_values [Hash{Symbol=>String, nil}]
1352
+ # @param pricing_group_values [Hash{Symbol=>String}]
1353
+ # @param product_id [String]
1354
+ # @param product_tags [Array<String>]
1355
+ # @param recurring_commit_ids [Array<String>]
1356
+ # @param recurring_credit_ids [Array<String>]
1357
+
1358
+ # @see MetronomeSDK::Models::ContractV2::Override::OverrideSpecifier#billing_frequency
1359
+ module BillingFrequency
1360
+ extend MetronomeSDK::Internal::Type::Enum
1361
+
1362
+ MONTHLY = :MONTHLY
1363
+ QUARTERLY = :QUARTERLY
1364
+ ANNUAL = :ANNUAL
1365
+ WEEKLY = :WEEKLY
1366
+
1367
+ # @!method self.values
1368
+ # @return [Array<Symbol>]
1369
+ end
1370
+ end
1371
+
1372
+ # @see MetronomeSDK::Models::ContractV2::Override#overwrite_rate
1373
+ class OverwriteRate < MetronomeSDK::Internal::Type::BaseModel
1374
+ # @!attribute rate_type
1375
+ #
1376
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Override::OverwriteRate::RateType]
1377
+ required :rate_type, enum: -> { MetronomeSDK::ContractV2::Override::OverwriteRate::RateType }
1378
+
1379
+ # @!attribute credit_type
1380
+ #
1381
+ # @return [MetronomeSDK::Models::CreditTypeData, nil]
1382
+ optional :credit_type, -> { MetronomeSDK::CreditTypeData }
1383
+
1384
+ # @!attribute custom_rate
1385
+ # Only set for CUSTOM rate_type. This field is interpreted by custom rate
1386
+ # processors.
1387
+ #
1388
+ # @return [Hash{Symbol=>Object}, nil]
1389
+ optional :custom_rate, MetronomeSDK::Internal::Type::HashOf[MetronomeSDK::Internal::Type::Unknown]
1390
+
1391
+ # @!attribute is_prorated
1392
+ # Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1393
+ # set to true.
1394
+ #
1395
+ # @return [Boolean, nil]
1396
+ optional :is_prorated, MetronomeSDK::Internal::Type::Boolean
1397
+
1398
+ # @!attribute price
1399
+ # Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
1400
+ # this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
1401
+ #
1402
+ # @return [Float, nil]
1403
+ optional :price, Float
1404
+
1405
+ # @!attribute quantity
1406
+ # Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
1407
+ #
1408
+ # @return [Float, nil]
1409
+ optional :quantity, Float
1410
+
1411
+ # @!attribute tiers
1412
+ # Only set for TIERED rate_type.
1413
+ #
1414
+ # @return [Array<MetronomeSDK::Models::Tier>, nil]
1415
+ optional :tiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Tier] }
1416
+
1417
+ # @!method initialize(rate_type:, credit_type: nil, custom_rate: nil, is_prorated: nil, price: nil, quantity: nil, tiers: nil)
1418
+ # Some parameter documentations has been truncated, see
1419
+ # {MetronomeSDK::Models::ContractV2::Override::OverwriteRate} for more details.
1420
+ #
1421
+ # @param rate_type [Symbol, MetronomeSDK::Models::ContractV2::Override::OverwriteRate::RateType]
1422
+ #
1423
+ # @param credit_type [MetronomeSDK::Models::CreditTypeData]
1424
+ #
1425
+ # @param custom_rate [Hash{Symbol=>Object}] Only set for CUSTOM rate_type. This field is interpreted by custom rate processo
1426
+ #
1427
+ # @param is_prorated [Boolean] Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1428
+ #
1429
+ # @param price [Float] Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, t
1430
+ #
1431
+ # @param quantity [Float] Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
1432
+ #
1433
+ # @param tiers [Array<MetronomeSDK::Models::Tier>] Only set for TIERED rate_type.
1434
+
1435
+ # @see MetronomeSDK::Models::ContractV2::Override::OverwriteRate#rate_type
1436
+ module RateType
1437
+ extend MetronomeSDK::Internal::Type::Enum
1438
+
1439
+ FLAT = :FLAT
1440
+ PERCENTAGE = :PERCENTAGE
1441
+ SUBSCRIPTION = :SUBSCRIPTION
1442
+ TIERED = :TIERED
1443
+ CUSTOM = :CUSTOM
1444
+
1445
+ # @!method self.values
1446
+ # @return [Array<Symbol>]
1447
+ end
1448
+ end
1449
+
1450
+ # @see MetronomeSDK::Models::ContractV2::Override#product
1451
+ class Product < MetronomeSDK::Internal::Type::BaseModel
1452
+ # @!attribute id
1453
+ #
1454
+ # @return [String]
1455
+ required :id, String
1456
+
1457
+ # @!attribute name
1458
+ #
1459
+ # @return [String]
1460
+ required :name, String
1461
+
1462
+ # @!method initialize(id:, name:)
1463
+ # @param id [String]
1464
+ # @param name [String]
1465
+ end
1466
+
1467
+ # @see MetronomeSDK::Models::ContractV2::Override#target
1468
+ module Target
1469
+ extend MetronomeSDK::Internal::Type::Enum
1470
+
1471
+ COMMIT_RATE = :COMMIT_RATE
1472
+ LIST_RATE = :LIST_RATE
1473
+
1474
+ # @!method self.values
1475
+ # @return [Array<Symbol>]
1476
+ end
1477
+
1478
+ # @see MetronomeSDK::Models::ContractV2::Override#type
1479
+ module Type
1480
+ extend MetronomeSDK::Internal::Type::Enum
1481
+
1482
+ OVERWRITE = :OVERWRITE
1483
+ MULTIPLIER = :MULTIPLIER
1484
+ TIERED = :TIERED
1485
+
1486
+ # @!method self.values
1487
+ # @return [Array<Symbol>]
1488
+ end
1489
+ end
1490
+
1491
+ class Transition < MetronomeSDK::Internal::Type::BaseModel
1492
+ # @!attribute from_contract_id
1493
+ #
1494
+ # @return [String]
1495
+ required :from_contract_id, String
1496
+
1497
+ # @!attribute to_contract_id
1498
+ #
1499
+ # @return [String]
1500
+ required :to_contract_id, String
1501
+
1502
+ # @!attribute type
1503
+ #
1504
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Transition::Type]
1505
+ required :type, enum: -> { MetronomeSDK::ContractV2::Transition::Type }
1506
+
1507
+ # @!method initialize(from_contract_id:, to_contract_id:, type:)
1508
+ # @param from_contract_id [String]
1509
+ # @param to_contract_id [String]
1510
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Transition::Type]
1511
+
1512
+ # @see MetronomeSDK::Models::ContractV2::Transition#type
1513
+ module Type
1514
+ extend MetronomeSDK::Internal::Type::Enum
1515
+
1516
+ SUPERSEDE = :SUPERSEDE
1517
+ RENEWAL = :RENEWAL
1518
+
1519
+ # @!method self.values
1520
+ # @return [Array<Symbol>]
1521
+ end
1522
+ end
1523
+
1524
+ class UsageFilter < MetronomeSDK::Internal::Type::BaseModel
1525
+ # @!attribute group_key
1526
+ #
1527
+ # @return [String]
1528
+ required :group_key, String
1529
+
1530
+ # @!attribute group_values
1531
+ #
1532
+ # @return [Array<String>]
1533
+ required :group_values, MetronomeSDK::Internal::Type::ArrayOf[String]
1534
+
1535
+ # @!attribute starting_at
1536
+ # This will match contract starting_at value if usage filter is active from the
1537
+ # beginning of the contract.
1538
+ #
1539
+ # @return [Time]
1540
+ required :starting_at, Time
1541
+
1542
+ # @!attribute ending_before
1543
+ # This will match contract ending_before value if usage filter is active until the
1544
+ # end of the contract. It will be undefined if the contract is open-ended.
1545
+ #
1546
+ # @return [Time, nil]
1547
+ optional :ending_before, Time
1548
+
1549
+ # @!method initialize(group_key:, group_values:, starting_at:, ending_before: nil)
1550
+ # Some parameter documentations has been truncated, see
1551
+ # {MetronomeSDK::Models::ContractV2::UsageFilter} for more details.
1552
+ #
1553
+ # @param group_key [String]
1554
+ #
1555
+ # @param group_values [Array<String>]
1556
+ #
1557
+ # @param starting_at [Time] This will match contract starting_at value if usage filter is active from the be
1558
+ #
1559
+ # @param ending_before [Time] This will match contract ending_before value if usage filter is active until the
1560
+ end
1561
+
1562
+ # @see MetronomeSDK::Models::ContractV2#usage_statement_schedule
1563
+ class UsageStatementSchedule < MetronomeSDK::Internal::Type::BaseModel
1564
+ # @!attribute billing_anchor_date
1565
+ # Contract usage statements follow a selected cadence based on this date.
1566
+ #
1567
+ # @return [Time]
1568
+ required :billing_anchor_date, Time
1569
+
1570
+ # @!attribute frequency
1571
+ #
1572
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::UsageStatementSchedule::Frequency]
1573
+ required :frequency, enum: -> { MetronomeSDK::ContractV2::UsageStatementSchedule::Frequency }
1574
+
1575
+ # @!method initialize(billing_anchor_date:, frequency:)
1576
+ # @param billing_anchor_date [Time] Contract usage statements follow a selected cadence based on this date.
1577
+ #
1578
+ # @param frequency [Symbol, MetronomeSDK::Models::ContractV2::UsageStatementSchedule::Frequency]
1579
+
1580
+ # @see MetronomeSDK::Models::ContractV2::UsageStatementSchedule#frequency
1581
+ module Frequency
1582
+ extend MetronomeSDK::Internal::Type::Enum
1583
+
1584
+ MONTHLY = :MONTHLY
1585
+ QUARTERLY = :QUARTERLY
1586
+ ANNUAL = :ANNUAL
1587
+ WEEKLY = :WEEKLY
1588
+
1589
+ # @!method self.values
1590
+ # @return [Array<Symbol>]
1591
+ end
1592
+ end
1593
+
1594
+ class Credit < MetronomeSDK::Internal::Type::BaseModel
1595
+ # @!attribute id
1596
+ #
1597
+ # @return [String]
1598
+ required :id, String
1599
+
1600
+ # @!attribute product
1601
+ #
1602
+ # @return [MetronomeSDK::Models::ContractV2::Credit::Product]
1603
+ required :product, -> { MetronomeSDK::ContractV2::Credit::Product }
1604
+
1605
+ # @!attribute type
1606
+ #
1607
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Credit::Type]
1608
+ required :type, enum: -> { MetronomeSDK::ContractV2::Credit::Type }
1609
+
1610
+ # @!attribute access_schedule
1611
+ # The schedule that the customer will gain access to the credits.
1612
+ #
1613
+ # @return [MetronomeSDK::Models::ScheduleDuration, nil]
1614
+ optional :access_schedule, -> { MetronomeSDK::ScheduleDuration }
1615
+
1616
+ # @!attribute applicable_contract_ids
1617
+ #
1618
+ # @return [Array<String>, nil]
1619
+ optional :applicable_contract_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
1620
+
1621
+ # @!attribute applicable_product_ids
1622
+ #
1623
+ # @return [Array<String>, nil]
1624
+ optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
1625
+
1626
+ # @!attribute applicable_product_tags
1627
+ #
1628
+ # @return [Array<String>, nil]
1629
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
1630
+
1631
+ # @!attribute balance
1632
+ # The current balance of the credit or commit. This balance reflects the amount of
1633
+ # credit or commit that the customer has access to use at this moment - thus,
1634
+ # expired and upcoming credit or commit segments contribute 0 to the balance. The
1635
+ # balance will match the sum of all ledger entries with the exception of the case
1636
+ # where the sum of negative manual ledger entries exceeds the positive amount
1637
+ # remaining on the credit or commit - in that case, the balance will be 0. All
1638
+ # manual ledger entries associated with active credit or commit segments are
1639
+ # included in the balance, including future-dated manual ledger entries.
1640
+ #
1641
+ # @return [Float, nil]
1642
+ optional :balance, Float
1643
+
1644
+ # @!attribute contract
1645
+ #
1646
+ # @return [MetronomeSDK::Models::ContractV2::Credit::Contract, nil]
1647
+ optional :contract, -> { MetronomeSDK::ContractV2::Credit::Contract }
1648
+
1649
+ # @!attribute custom_fields
1650
+ # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1651
+ #
1652
+ # @return [Hash{Symbol=>String}, nil]
1653
+ optional :custom_fields, MetronomeSDK::Internal::Type::HashOf[String]
1654
+
1655
+ # @!attribute description
1656
+ #
1657
+ # @return [String, nil]
1658
+ optional :description, String
1659
+
1660
+ # @!attribute hierarchy_configuration
1661
+ # Optional configuration for credit hierarchy access control
1662
+ #
1663
+ # @return [MetronomeSDK::Models::CommitHierarchyConfiguration, nil]
1664
+ optional :hierarchy_configuration, -> { MetronomeSDK::CommitHierarchyConfiguration }
1665
+
1666
+ # @!attribute ledger
1667
+ # A list of ordered events that impact the balance of a credit. For example, an
1668
+ # invoice deduction or an expiration.
1669
+ #
1670
+ # @return [Array<MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditSegmentStartLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditExpirationLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditCanceledLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditCreditedLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditManualLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry>, nil]
1671
+ optional :ledger,
1672
+ -> { MetronomeSDK::Internal::Type::ArrayOf[union: MetronomeSDK::ContractV2::Credit::Ledger] }
1673
+
1674
+ # @!attribute name
1675
+ #
1676
+ # @return [String, nil]
1677
+ optional :name, String
1678
+
1679
+ # @!attribute netsuite_sales_order_id
1680
+ # This field's availability is dependent on your client's configuration.
1681
+ #
1682
+ # @return [String, nil]
1683
+ optional :netsuite_sales_order_id, String
1684
+
1685
+ # @!attribute priority
1686
+ # If multiple credits or commits are applicable, the one with the lower priority
1687
+ # will apply first.
1688
+ #
1689
+ # @return [Float, nil]
1690
+ optional :priority, Float
1691
+
1692
+ # @!attribute salesforce_opportunity_id
1693
+ # This field's availability is dependent on your client's configuration.
1694
+ #
1695
+ # @return [String, nil]
1696
+ optional :salesforce_opportunity_id, String
1697
+
1698
+ # @!attribute specifiers
1699
+ # List of filters that determine what kind of customer usage draws down a commit
1700
+ # or credit. A customer's usage needs to meet the condition of at least one of the
1701
+ # specifiers to contribute to a commit's or credit's drawdown.
1702
+ #
1703
+ # @return [Array<MetronomeSDK::Models::CommitSpecifier>, nil]
1704
+ optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifier] }
1705
+
1706
+ # @!method initialize(id:, product:, type:, access_schedule: nil, applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, balance: nil, contract: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, ledger: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, salesforce_opportunity_id: nil, specifiers: nil)
1707
+ # Some parameter documentations has been truncated, see
1708
+ # {MetronomeSDK::Models::ContractV2::Credit} for more details.
1709
+ #
1710
+ # @param id [String]
1711
+ #
1712
+ # @param product [MetronomeSDK::Models::ContractV2::Credit::Product]
1713
+ #
1714
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Credit::Type]
1715
+ #
1716
+ # @param access_schedule [MetronomeSDK::Models::ScheduleDuration] The schedule that the customer will gain access to the credits.
1717
+ #
1718
+ # @param applicable_contract_ids [Array<String>]
1719
+ #
1720
+ # @param applicable_product_ids [Array<String>]
1721
+ #
1722
+ # @param applicable_product_tags [Array<String>]
1723
+ #
1724
+ # @param balance [Float] The current balance of the credit or commit. This balance reflects the amount of
1725
+ #
1726
+ # @param contract [MetronomeSDK::Models::ContractV2::Credit::Contract]
1727
+ #
1728
+ # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1729
+ #
1730
+ # @param description [String]
1731
+ #
1732
+ # @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for credit hierarchy access control
1733
+ #
1734
+ # @param ledger [Array<MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditSegmentStartLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditExpirationLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditCanceledLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditCreditedLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditManualLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry>] A list of ordered events that impact the balance of a credit. For example, an in
1735
+ #
1736
+ # @param name [String]
1737
+ #
1738
+ # @param netsuite_sales_order_id [String] This field's availability is dependent on your client's configuration.
1739
+ #
1740
+ # @param priority [Float] If multiple credits or commits are applicable, the one with the lower priority w
1741
+ #
1742
+ # @param salesforce_opportunity_id [String] This field's availability is dependent on your client's configuration.
1743
+ #
1744
+ # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifier>] List of filters that determine what kind of customer usage draws down a commit o
1745
+
1746
+ # @see MetronomeSDK::Models::ContractV2::Credit#product
1747
+ class Product < MetronomeSDK::Internal::Type::BaseModel
1748
+ # @!attribute id
1749
+ #
1750
+ # @return [String]
1751
+ required :id, String
1752
+
1753
+ # @!attribute name
1754
+ #
1755
+ # @return [String]
1756
+ required :name, String
1757
+
1758
+ # @!method initialize(id:, name:)
1759
+ # @param id [String]
1760
+ # @param name [String]
1761
+ end
1762
+
1763
+ # @see MetronomeSDK::Models::ContractV2::Credit#type
1764
+ module Type
1765
+ extend MetronomeSDK::Internal::Type::Enum
1766
+
1767
+ CREDIT = :CREDIT
1768
+
1769
+ # @!method self.values
1770
+ # @return [Array<Symbol>]
1771
+ end
1772
+
1773
+ # @see MetronomeSDK::Models::ContractV2::Credit#contract
1774
+ class Contract < MetronomeSDK::Internal::Type::BaseModel
1775
+ # @!attribute id
1776
+ #
1777
+ # @return [String]
1778
+ required :id, String
1779
+
1780
+ # @!method initialize(id:)
1781
+ # @param id [String]
1782
+ end
1783
+
1784
+ module Ledger
1785
+ extend MetronomeSDK::Internal::Type::Union
1786
+
1787
+ variant -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditSegmentStartLedgerEntry }
1788
+
1789
+ variant -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry }
1790
+
1791
+ variant -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditExpirationLedgerEntry }
1792
+
1793
+ variant -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditCanceledLedgerEntry }
1794
+
1795
+ variant -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditCreditedLedgerEntry }
1796
+
1797
+ variant -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditManualLedgerEntry }
1798
+
1799
+ variant -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry }
1800
+
1801
+ class CreditSegmentStartLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
1802
+ # @!attribute amount
1803
+ #
1804
+ # @return [Float]
1805
+ required :amount, Float
1806
+
1807
+ # @!attribute segment_id
1808
+ #
1809
+ # @return [String]
1810
+ required :segment_id, String
1811
+
1812
+ # @!attribute timestamp
1813
+ #
1814
+ # @return [Time]
1815
+ required :timestamp, Time
1816
+
1817
+ # @!attribute type
1818
+ #
1819
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditSegmentStartLedgerEntry::Type]
1820
+ required :type, enum: -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditSegmentStartLedgerEntry::Type }
1821
+
1822
+ # @!method initialize(amount:, segment_id:, timestamp:, type:)
1823
+ # @param amount [Float]
1824
+ # @param segment_id [String]
1825
+ # @param timestamp [Time]
1826
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditSegmentStartLedgerEntry::Type]
1827
+
1828
+ # @see MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditSegmentStartLedgerEntry#type
1829
+ module Type
1830
+ extend MetronomeSDK::Internal::Type::Enum
1831
+
1832
+ CREDIT_SEGMENT_START = :CREDIT_SEGMENT_START
1833
+
1834
+ # @!method self.values
1835
+ # @return [Array<Symbol>]
1836
+ end
1837
+ end
1838
+
1839
+ class CreditAutomatedInvoiceDeductionLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
1840
+ # @!attribute amount
1841
+ #
1842
+ # @return [Float]
1843
+ required :amount, Float
1844
+
1845
+ # @!attribute invoice_id
1846
+ #
1847
+ # @return [String]
1848
+ required :invoice_id, String
1849
+
1850
+ # @!attribute segment_id
1851
+ #
1852
+ # @return [String]
1853
+ required :segment_id, String
1854
+
1855
+ # @!attribute timestamp
1856
+ #
1857
+ # @return [Time]
1858
+ required :timestamp, Time
1859
+
1860
+ # @!attribute type
1861
+ #
1862
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry::Type]
1863
+ required :type,
1864
+ enum: -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry::Type }
1865
+
1866
+ # @!attribute contract_id
1867
+ #
1868
+ # @return [String, nil]
1869
+ optional :contract_id, String
1870
+
1871
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
1872
+ # @param amount [Float]
1873
+ # @param invoice_id [String]
1874
+ # @param segment_id [String]
1875
+ # @param timestamp [Time]
1876
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry::Type]
1877
+ # @param contract_id [String]
1878
+
1879
+ # @see MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry#type
1880
+ module Type
1881
+ extend MetronomeSDK::Internal::Type::Enum
1882
+
1883
+ CREDIT_AUTOMATED_INVOICE_DEDUCTION = :CREDIT_AUTOMATED_INVOICE_DEDUCTION
1884
+
1885
+ # @!method self.values
1886
+ # @return [Array<Symbol>]
1887
+ end
1888
+ end
1889
+
1890
+ class CreditExpirationLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
1891
+ # @!attribute amount
1892
+ #
1893
+ # @return [Float]
1894
+ required :amount, Float
1895
+
1896
+ # @!attribute segment_id
1897
+ #
1898
+ # @return [String]
1899
+ required :segment_id, String
1900
+
1901
+ # @!attribute timestamp
1902
+ #
1903
+ # @return [Time]
1904
+ required :timestamp, Time
1905
+
1906
+ # @!attribute type
1907
+ #
1908
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditExpirationLedgerEntry::Type]
1909
+ required :type, enum: -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditExpirationLedgerEntry::Type }
1910
+
1911
+ # @!method initialize(amount:, segment_id:, timestamp:, type:)
1912
+ # @param amount [Float]
1913
+ # @param segment_id [String]
1914
+ # @param timestamp [Time]
1915
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditExpirationLedgerEntry::Type]
1916
+
1917
+ # @see MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditExpirationLedgerEntry#type
1918
+ module Type
1919
+ extend MetronomeSDK::Internal::Type::Enum
1920
+
1921
+ CREDIT_EXPIRATION = :CREDIT_EXPIRATION
1922
+
1923
+ # @!method self.values
1924
+ # @return [Array<Symbol>]
1925
+ end
1926
+ end
1927
+
1928
+ class CreditCanceledLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
1929
+ # @!attribute amount
1930
+ #
1931
+ # @return [Float]
1932
+ required :amount, Float
1933
+
1934
+ # @!attribute invoice_id
1935
+ #
1936
+ # @return [String]
1937
+ required :invoice_id, String
1938
+
1939
+ # @!attribute segment_id
1940
+ #
1941
+ # @return [String]
1942
+ required :segment_id, String
1943
+
1944
+ # @!attribute timestamp
1945
+ #
1946
+ # @return [Time]
1947
+ required :timestamp, Time
1948
+
1949
+ # @!attribute type
1950
+ #
1951
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditCanceledLedgerEntry::Type]
1952
+ required :type, enum: -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditCanceledLedgerEntry::Type }
1953
+
1954
+ # @!attribute contract_id
1955
+ #
1956
+ # @return [String, nil]
1957
+ optional :contract_id, String
1958
+
1959
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
1960
+ # @param amount [Float]
1961
+ # @param invoice_id [String]
1962
+ # @param segment_id [String]
1963
+ # @param timestamp [Time]
1964
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditCanceledLedgerEntry::Type]
1965
+ # @param contract_id [String]
1966
+
1967
+ # @see MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditCanceledLedgerEntry#type
1968
+ module Type
1969
+ extend MetronomeSDK::Internal::Type::Enum
1970
+
1971
+ CREDIT_CANCELED = :CREDIT_CANCELED
1972
+
1973
+ # @!method self.values
1974
+ # @return [Array<Symbol>]
1975
+ end
1976
+ end
1977
+
1978
+ class CreditCreditedLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
1979
+ # @!attribute amount
1980
+ #
1981
+ # @return [Float]
1982
+ required :amount, Float
1983
+
1984
+ # @!attribute invoice_id
1985
+ #
1986
+ # @return [String]
1987
+ required :invoice_id, String
1988
+
1989
+ # @!attribute segment_id
1990
+ #
1991
+ # @return [String]
1992
+ required :segment_id, String
1993
+
1994
+ # @!attribute timestamp
1995
+ #
1996
+ # @return [Time]
1997
+ required :timestamp, Time
1998
+
1999
+ # @!attribute type
2000
+ #
2001
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditCreditedLedgerEntry::Type]
2002
+ required :type, enum: -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditCreditedLedgerEntry::Type }
2003
+
2004
+ # @!attribute contract_id
2005
+ #
2006
+ # @return [String, nil]
2007
+ optional :contract_id, String
2008
+
2009
+ # @!method initialize(amount:, invoice_id:, segment_id:, timestamp:, type:, contract_id: nil)
2010
+ # @param amount [Float]
2011
+ # @param invoice_id [String]
2012
+ # @param segment_id [String]
2013
+ # @param timestamp [Time]
2014
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditCreditedLedgerEntry::Type]
2015
+ # @param contract_id [String]
2016
+
2017
+ # @see MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditCreditedLedgerEntry#type
2018
+ module Type
2019
+ extend MetronomeSDK::Internal::Type::Enum
2020
+
2021
+ CREDIT_CREDITED = :CREDIT_CREDITED
2022
+
2023
+ # @!method self.values
2024
+ # @return [Array<Symbol>]
2025
+ end
2026
+ end
2027
+
2028
+ class CreditManualLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
2029
+ # @!attribute amount
2030
+ #
2031
+ # @return [Float]
2032
+ required :amount, Float
2033
+
2034
+ # @!attribute reason
2035
+ #
2036
+ # @return [String]
2037
+ required :reason, String
2038
+
2039
+ # @!attribute timestamp
2040
+ #
2041
+ # @return [Time]
2042
+ required :timestamp, Time
2043
+
2044
+ # @!attribute type
2045
+ #
2046
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditManualLedgerEntry::Type]
2047
+ required :type, enum: -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditManualLedgerEntry::Type }
2048
+
2049
+ # @!method initialize(amount:, reason:, timestamp:, type:)
2050
+ # @param amount [Float]
2051
+ # @param reason [String]
2052
+ # @param timestamp [Time]
2053
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditManualLedgerEntry::Type]
2054
+
2055
+ # @see MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditManualLedgerEntry#type
2056
+ module Type
2057
+ extend MetronomeSDK::Internal::Type::Enum
2058
+
2059
+ CREDIT_MANUAL = :CREDIT_MANUAL
2060
+
2061
+ # @!method self.values
2062
+ # @return [Array<Symbol>]
2063
+ end
2064
+ end
2065
+
2066
+ class CreditSeatBasedAdjustmentLedgerEntry < MetronomeSDK::Internal::Type::BaseModel
2067
+ # @!attribute amount
2068
+ #
2069
+ # @return [Float]
2070
+ required :amount, Float
2071
+
2072
+ # @!attribute segment_id
2073
+ #
2074
+ # @return [String]
2075
+ required :segment_id, String
2076
+
2077
+ # @!attribute timestamp
2078
+ #
2079
+ # @return [Time]
2080
+ required :timestamp, Time
2081
+
2082
+ # @!attribute type
2083
+ #
2084
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry::Type]
2085
+ required :type,
2086
+ enum: -> { MetronomeSDK::ContractV2::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry::Type }
2087
+
2088
+ # @!method initialize(amount:, segment_id:, timestamp:, type:)
2089
+ # @param amount [Float]
2090
+ # @param segment_id [String]
2091
+ # @param timestamp [Time]
2092
+ # @param type [Symbol, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry::Type]
2093
+
2094
+ # @see MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry#type
2095
+ module Type
2096
+ extend MetronomeSDK::Internal::Type::Enum
2097
+
2098
+ CREDIT_SEAT_BASED_ADJUSTMENT = :CREDIT_SEAT_BASED_ADJUSTMENT
2099
+
2100
+ # @!method self.values
2101
+ # @return [Array<Symbol>]
2102
+ end
2103
+ end
2104
+
2105
+ # @!method self.variants
2106
+ # @return [Array(MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditSegmentStartLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditExpirationLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditCanceledLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditCreditedLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditManualLedgerEntry, MetronomeSDK::Models::ContractV2::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry)]
2107
+ end
2108
+ end
2109
+
2110
+ # @see MetronomeSDK::Models::ContractV2#customer_billing_provider_configuration
2111
+ class CustomerBillingProviderConfiguration < MetronomeSDK::Internal::Type::BaseModel
2112
+ # @!attribute id
2113
+ # ID of Customer's billing provider configuration.
2114
+ #
2115
+ # @return [String]
2116
+ required :id, String
2117
+
2118
+ # @!attribute billing_provider
2119
+ #
2120
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::CustomerBillingProviderConfiguration::BillingProvider]
2121
+ required :billing_provider,
2122
+ enum: -> { MetronomeSDK::ContractV2::CustomerBillingProviderConfiguration::BillingProvider }
2123
+
2124
+ # @!attribute delivery_method
2125
+ #
2126
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::CustomerBillingProviderConfiguration::DeliveryMethod]
2127
+ required :delivery_method,
2128
+ enum: -> { MetronomeSDK::ContractV2::CustomerBillingProviderConfiguration::DeliveryMethod }
2129
+
2130
+ # @!method initialize(id:, billing_provider:, delivery_method:)
2131
+ # This field's availability is dependent on your client's configuration.
2132
+ #
2133
+ # @param id [String] ID of Customer's billing provider configuration.
2134
+ #
2135
+ # @param billing_provider [Symbol, MetronomeSDK::Models::ContractV2::CustomerBillingProviderConfiguration::BillingProvider]
2136
+ #
2137
+ # @param delivery_method [Symbol, MetronomeSDK::Models::ContractV2::CustomerBillingProviderConfiguration::DeliveryMethod]
2138
+
2139
+ # @see MetronomeSDK::Models::ContractV2::CustomerBillingProviderConfiguration#billing_provider
2140
+ module BillingProvider
2141
+ extend MetronomeSDK::Internal::Type::Enum
2142
+
2143
+ AWS_MARKETPLACE = :aws_marketplace
2144
+ STRIPE = :stripe
2145
+ NETSUITE = :netsuite
2146
+ CUSTOM = :custom
2147
+ AZURE_MARKETPLACE = :azure_marketplace
2148
+ QUICKBOOKS_ONLINE = :quickbooks_online
2149
+ WORKDAY = :workday
2150
+ GCP_MARKETPLACE = :gcp_marketplace
2151
+
2152
+ # @!method self.values
2153
+ # @return [Array<Symbol>]
2154
+ end
2155
+
2156
+ # @see MetronomeSDK::Models::ContractV2::CustomerBillingProviderConfiguration#delivery_method
2157
+ module DeliveryMethod
2158
+ extend MetronomeSDK::Internal::Type::Enum
2159
+
2160
+ DIRECT_TO_BILLING_PROVIDER = :direct_to_billing_provider
2161
+ AWS_SQS = :aws_sqs
2162
+ TACKLE = :tackle
2163
+ AWS_SNS = :aws_sns
2164
+
2165
+ # @!method self.values
2166
+ # @return [Array<Symbol>]
2167
+ end
2168
+ end
2169
+
2170
+ # @see MetronomeSDK::Models::ContractV2#has_more
2171
+ class HasMore < MetronomeSDK::Internal::Type::BaseModel
2172
+ # @!attribute commits
2173
+ # Whether there are more commits on this contract than the limit for this
2174
+ # endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
2175
+ # of commits.
2176
+ #
2177
+ # @return [Boolean]
2178
+ required :commits, MetronomeSDK::Internal::Type::Boolean
2179
+
2180
+ # @!attribute credits
2181
+ # Whether there are more credits on this contract than the limit for this
2182
+ # endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
2183
+ # of credits.
2184
+ #
2185
+ # @return [Boolean]
2186
+ required :credits, MetronomeSDK::Internal::Type::Boolean
2187
+
2188
+ # @!method initialize(commits:, credits:)
2189
+ # Some parameter documentations has been truncated, see
2190
+ # {MetronomeSDK::Models::ContractV2::HasMore} for more details.
2191
+ #
2192
+ # Indicates whether there are more items than the limit for this endpoint. Use the
2193
+ # respective list endpoints to get the full lists.
2194
+ #
2195
+ # @param commits [Boolean] Whether there are more commits on this contract than the limit for this endpoint
2196
+ #
2197
+ # @param credits [Boolean] Whether there are more credits on this contract than the limit for this endpoint
2198
+ end
2199
+
2200
+ # Either a **parent** configuration with a list of children or a **child**
2201
+ # configuration with a single parent.
2202
+ #
2203
+ # @see MetronomeSDK::Models::ContractV2#hierarchy_configuration
2204
+ module HierarchyConfiguration
2205
+ extend MetronomeSDK::Internal::Type::Union
2206
+
2207
+ variant -> { MetronomeSDK::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration }
2208
+
2209
+ variant -> { MetronomeSDK::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2 }
2210
+
2211
+ class ParentHierarchyConfiguration < MetronomeSDK::Internal::Type::BaseModel
2212
+ # @!attribute children
2213
+ # List of contracts that belong to this parent.
2214
+ #
2215
+ # @return [Array<MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration::Child>]
2216
+ required :children,
2217
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration::Child] }
2218
+
2219
+ # @!attribute parent_behavior
2220
+ #
2221
+ # @return [MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration::ParentBehavior, nil]
2222
+ optional :parent_behavior,
2223
+ -> { MetronomeSDK::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration::ParentBehavior }
2224
+
2225
+ # @!method initialize(children:, parent_behavior: nil)
2226
+ # @param children [Array<MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration::Child>] List of contracts that belong to this parent.
2227
+ #
2228
+ # @param parent_behavior [MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration::ParentBehavior]
2229
+
2230
+ class Child < MetronomeSDK::Internal::Type::BaseModel
2231
+ # @!attribute contract_id
2232
+ #
2233
+ # @return [String]
2234
+ required :contract_id, String
2235
+
2236
+ # @!attribute customer_id
2237
+ #
2238
+ # @return [String]
2239
+ required :customer_id, String
2240
+
2241
+ # @!method initialize(contract_id:, customer_id:)
2242
+ # @param contract_id [String]
2243
+ # @param customer_id [String]
2244
+ end
2245
+
2246
+ # @see MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration#parent_behavior
2247
+ class ParentBehavior < MetronomeSDK::Internal::Type::BaseModel
2248
+ # @!attribute invoice_consolidation_type
2249
+ # Indicates the desired behavior of consolidated invoices generated by the parent
2250
+ # in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
2251
+ # customers will be appended to the consolidated invoice **NONE**: Do not generate
2252
+ # consolidated invoices
2253
+ #
2254
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration::ParentBehavior::InvoiceConsolidationType, nil]
2255
+ optional :invoice_consolidation_type,
2256
+ enum: -> { MetronomeSDK::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration::ParentBehavior::InvoiceConsolidationType }
2257
+
2258
+ # @!method initialize(invoice_consolidation_type: nil)
2259
+ # Some parameter documentations has been truncated, see
2260
+ # {MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration::ParentBehavior}
2261
+ # for more details.
2262
+ #
2263
+ # @param invoice_consolidation_type [Symbol, MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration::ParentBehavior::InvoiceConsolidationType] Indicates the desired behavior of consolidated invoices generated by the parent
2264
+
2265
+ # Indicates the desired behavior of consolidated invoices generated by the parent
2266
+ # in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
2267
+ # customers will be appended to the consolidated invoice **NONE**: Do not generate
2268
+ # consolidated invoices
2269
+ #
2270
+ # @see MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration::ParentBehavior#invoice_consolidation_type
2271
+ module InvoiceConsolidationType
2272
+ extend MetronomeSDK::Internal::Type::Enum
2273
+
2274
+ CONCATENATE = :CONCATENATE
2275
+ NONE = :NONE
2276
+
2277
+ # @!method self.values
2278
+ # @return [Array<Symbol>]
2279
+ end
2280
+ end
2281
+ end
2282
+
2283
+ class ChildHierarchyConfigurationV2 < MetronomeSDK::Internal::Type::BaseModel
2284
+ # @!attribute parent
2285
+ # The single parent contract/customer for this child.
2286
+ #
2287
+ # @return [MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2::Parent]
2288
+ required :parent,
2289
+ -> { MetronomeSDK::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2::Parent }
2290
+
2291
+ # @!attribute payer
2292
+ # Indicates whether the child or parent should pay for the child's invoice charges
2293
+ #
2294
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2::Payer, nil]
2295
+ optional :payer,
2296
+ enum: -> { MetronomeSDK::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2::Payer }
2297
+
2298
+ # @!attribute usage_statement_behavior
2299
+ # Indicates the behavior of the child's invoice statements on the parent's
2300
+ # invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
2301
+ # consolidated invoices **SEPARATE**: Child's invoice statements will appear not
2302
+ # appear on parent's consolidated invoices
2303
+ #
2304
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2::UsageStatementBehavior, nil]
2305
+ optional :usage_statement_behavior,
2306
+ enum: -> { MetronomeSDK::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2::UsageStatementBehavior }
2307
+
2308
+ # @!method initialize(parent:, payer: nil, usage_statement_behavior: nil)
2309
+ # Some parameter documentations has been truncated, see
2310
+ # {MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2}
2311
+ # for more details.
2312
+ #
2313
+ # @param parent [MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2::Parent] The single parent contract/customer for this child.
2314
+ #
2315
+ # @param payer [Symbol, MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2::Payer] Indicates whether the child or parent should pay for the child's invoice charges
2316
+ #
2317
+ # @param usage_statement_behavior [Symbol, MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2::UsageStatementBehavior] Indicates the behavior of the child's invoice statements on the parent's invoice
2318
+
2319
+ # @see MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2#parent
2320
+ class Parent < MetronomeSDK::Internal::Type::BaseModel
2321
+ # @!attribute contract_id
2322
+ #
2323
+ # @return [String]
2324
+ required :contract_id, String
2325
+
2326
+ # @!attribute customer_id
2327
+ #
2328
+ # @return [String]
2329
+ required :customer_id, String
2330
+
2331
+ # @!method initialize(contract_id:, customer_id:)
2332
+ # The single parent contract/customer for this child.
2333
+ #
2334
+ # @param contract_id [String]
2335
+ # @param customer_id [String]
2336
+ end
2337
+
2338
+ # Indicates whether the child or parent should pay for the child's invoice charges
2339
+ #
2340
+ # @see MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2#payer
2341
+ module Payer
2342
+ extend MetronomeSDK::Internal::Type::Enum
2343
+
2344
+ SELF = :SELF
2345
+ PARENT = :PARENT
2346
+
2347
+ # @!method self.values
2348
+ # @return [Array<Symbol>]
2349
+ end
2350
+
2351
+ # Indicates the behavior of the child's invoice statements on the parent's
2352
+ # invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
2353
+ # consolidated invoices **SEPARATE**: Child's invoice statements will appear not
2354
+ # appear on parent's consolidated invoices
2355
+ #
2356
+ # @see MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2#usage_statement_behavior
2357
+ module UsageStatementBehavior
2358
+ extend MetronomeSDK::Internal::Type::Enum
2359
+
2360
+ CONSOLIDATE = :CONSOLIDATE
2361
+ SEPARATE = :SEPARATE
2362
+
2363
+ # @!method self.values
2364
+ # @return [Array<Symbol>]
2365
+ end
2366
+ end
2367
+
2368
+ # @!method self.variants
2369
+ # @return [Array(MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ParentHierarchyConfiguration, MetronomeSDK::Models::ContractV2::HierarchyConfiguration::ChildHierarchyConfigurationV2)]
2370
+ end
2371
+
2372
+ # Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
2373
+ # prices automatically. EXPLICIT prioritization requires specifying priorities for
2374
+ # each multiplier; the one with the lowest priority value will be prioritized
2375
+ # first.
2376
+ #
2377
+ # @see MetronomeSDK::Models::ContractV2#multiplier_override_prioritization
2378
+ module MultiplierOverridePrioritization
2379
+ extend MetronomeSDK::Internal::Type::Enum
2380
+
2381
+ LOWEST_MULTIPLIER = :LOWEST_MULTIPLIER
2382
+ EXPLICIT = :EXPLICIT
2383
+
2384
+ # @!method self.values
2385
+ # @return [Array<Symbol>]
2386
+ end
2387
+
2388
+ class RecurringCommit < MetronomeSDK::Internal::Type::BaseModel
2389
+ # @!attribute id
2390
+ #
2391
+ # @return [String]
2392
+ required :id, String
2393
+
2394
+ # @!attribute access_amount
2395
+ # The amount of commit to grant.
2396
+ #
2397
+ # @return [MetronomeSDK::Models::ContractV2::RecurringCommit::AccessAmount]
2398
+ required :access_amount, -> { MetronomeSDK::ContractV2::RecurringCommit::AccessAmount }
2399
+
2400
+ # @!attribute commit_duration
2401
+ # The amount of time the created commits will be valid for
2402
+ #
2403
+ # @return [MetronomeSDK::Models::ContractV2::RecurringCommit::CommitDuration]
2404
+ required :commit_duration, -> { MetronomeSDK::ContractV2::RecurringCommit::CommitDuration }
2405
+
2406
+ # @!attribute priority
2407
+ # Will be passed down to the individual commits
2408
+ #
2409
+ # @return [Float]
2410
+ required :priority, Float
2411
+
2412
+ # @!attribute product
2413
+ #
2414
+ # @return [MetronomeSDK::Models::ContractV2::RecurringCommit::Product]
2415
+ required :product, -> { MetronomeSDK::ContractV2::RecurringCommit::Product }
2416
+
2417
+ # @!attribute rate_type
2418
+ # Whether the created commits will use the commit rate or list rate
2419
+ #
2420
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::RecurringCommit::RateType]
2421
+ required :rate_type, enum: -> { MetronomeSDK::ContractV2::RecurringCommit::RateType }
2422
+
2423
+ # @!attribute starting_at
2424
+ # Determines the start time for the first commit
2425
+ #
2426
+ # @return [Time]
2427
+ required :starting_at, Time
2428
+
2429
+ # @!attribute applicable_product_ids
2430
+ # Will be passed down to the individual commits
2431
+ #
2432
+ # @return [Array<String>, nil]
2433
+ optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
2434
+
2435
+ # @!attribute applicable_product_tags
2436
+ # Will be passed down to the individual commits
2437
+ #
2438
+ # @return [Array<String>, nil]
2439
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
2440
+
2441
+ # @!attribute contract
2442
+ #
2443
+ # @return [MetronomeSDK::Models::ContractV2::RecurringCommit::Contract, nil]
2444
+ optional :contract, -> { MetronomeSDK::ContractV2::RecurringCommit::Contract }
2445
+
2446
+ # @!attribute description
2447
+ # Will be passed down to the individual commits
2448
+ #
2449
+ # @return [String, nil]
2450
+ optional :description, String
2451
+
2452
+ # @!attribute ending_before
2453
+ # Determines when the contract will stop creating recurring commits. Optional
2454
+ #
2455
+ # @return [Time, nil]
2456
+ optional :ending_before, Time
2457
+
2458
+ # @!attribute hierarchy_configuration
2459
+ # Optional configuration for recurring credit hierarchy access control
2460
+ #
2461
+ # @return [MetronomeSDK::Models::CommitHierarchyConfiguration, nil]
2462
+ optional :hierarchy_configuration, -> { MetronomeSDK::CommitHierarchyConfiguration }
2463
+
2464
+ # @!attribute invoice_amount
2465
+ # The amount the customer should be billed for the commit. Not required.
2466
+ #
2467
+ # @return [MetronomeSDK::Models::ContractV2::RecurringCommit::InvoiceAmount, nil]
2468
+ optional :invoice_amount, -> { MetronomeSDK::ContractV2::RecurringCommit::InvoiceAmount }
2469
+
2470
+ # @!attribute name
2471
+ # Displayed on invoices. Will be passed through to the individual commits
2472
+ #
2473
+ # @return [String, nil]
2474
+ optional :name, String
2475
+
2476
+ # @!attribute netsuite_sales_order_id
2477
+ # Will be passed down to the individual commits
2478
+ #
2479
+ # @return [String, nil]
2480
+ optional :netsuite_sales_order_id, String
2481
+
2482
+ # @!attribute proration
2483
+ # Determines whether the first and last commit will be prorated. If not provided,
2484
+ # the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
2485
+ #
2486
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::RecurringCommit::Proration, nil]
2487
+ optional :proration, enum: -> { MetronomeSDK::ContractV2::RecurringCommit::Proration }
2488
+
2489
+ # @!attribute recurrence_frequency
2490
+ # The frequency at which the recurring commits will be created. If not provided: -
2491
+ # The commits will be created on the usage invoice frequency. If provided: - The
2492
+ # period defined in the duration will correspond to this frequency. - Commits will
2493
+ # be created aligned with the recurring commit's starting_at rather than the usage
2494
+ # invoice dates.
2495
+ #
2496
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::RecurringCommit::RecurrenceFrequency, nil]
2497
+ optional :recurrence_frequency,
2498
+ enum: -> { MetronomeSDK::ContractV2::RecurringCommit::RecurrenceFrequency }
2499
+
2500
+ # @!attribute rollover_fraction
2501
+ # Will be passed down to the individual commits. This controls how much of an
2502
+ # individual unexpired commit will roll over upon contract transition. Must be
2503
+ # between 0 and 1.
2504
+ #
2505
+ # @return [Float, nil]
2506
+ optional :rollover_fraction, Float
2507
+
2508
+ # @!attribute specifiers
2509
+ # List of filters that determine what kind of customer usage draws down a commit
2510
+ # or credit. A customer's usage needs to meet the condition of at least one of the
2511
+ # specifiers to contribute to a commit's or credit's drawdown.
2512
+ #
2513
+ # @return [Array<MetronomeSDK::Models::CommitSpecifier>, nil]
2514
+ optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifier] }
2515
+
2516
+ # @!attribute subscription_config
2517
+ # Attach a subscription to the recurring commit/credit.
2518
+ #
2519
+ # @return [MetronomeSDK::Models::RecurringCommitSubscriptionConfig, nil]
2520
+ optional :subscription_config, -> { MetronomeSDK::RecurringCommitSubscriptionConfig }
2521
+
2522
+ # @!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, recurrence_frequency: nil, rollover_fraction: nil, specifiers: nil, subscription_config: nil)
2523
+ # Some parameter documentations has been truncated, see
2524
+ # {MetronomeSDK::Models::ContractV2::RecurringCommit} for more details.
2525
+ #
2526
+ # @param id [String]
2527
+ #
2528
+ # @param access_amount [MetronomeSDK::Models::ContractV2::RecurringCommit::AccessAmount] The amount of commit to grant.
2529
+ #
2530
+ # @param commit_duration [MetronomeSDK::Models::ContractV2::RecurringCommit::CommitDuration] The amount of time the created commits will be valid for
2531
+ #
2532
+ # @param priority [Float] Will be passed down to the individual commits
2533
+ #
2534
+ # @param product [MetronomeSDK::Models::ContractV2::RecurringCommit::Product]
2535
+ #
2536
+ # @param rate_type [Symbol, MetronomeSDK::Models::ContractV2::RecurringCommit::RateType] Whether the created commits will use the commit rate or list rate
2537
+ #
2538
+ # @param starting_at [Time] Determines the start time for the first commit
2539
+ #
2540
+ # @param applicable_product_ids [Array<String>] Will be passed down to the individual commits
2541
+ #
2542
+ # @param applicable_product_tags [Array<String>] Will be passed down to the individual commits
2543
+ #
2544
+ # @param contract [MetronomeSDK::Models::ContractV2::RecurringCommit::Contract]
2545
+ #
2546
+ # @param description [String] Will be passed down to the individual commits
2547
+ #
2548
+ # @param ending_before [Time] Determines when the contract will stop creating recurring commits. Optional
2549
+ #
2550
+ # @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for recurring credit hierarchy access control
2551
+ #
2552
+ # @param invoice_amount [MetronomeSDK::Models::ContractV2::RecurringCommit::InvoiceAmount] The amount the customer should be billed for the commit. Not required.
2553
+ #
2554
+ # @param name [String] Displayed on invoices. Will be passed through to the individual commits
2555
+ #
2556
+ # @param netsuite_sales_order_id [String] Will be passed down to the individual commits
2557
+ #
2558
+ # @param proration [Symbol, MetronomeSDK::Models::ContractV2::RecurringCommit::Proration] Determines whether the first and last commit will be prorated. If not provided,
2559
+ #
2560
+ # @param recurrence_frequency [Symbol, MetronomeSDK::Models::ContractV2::RecurringCommit::RecurrenceFrequency] The frequency at which the recurring commits will be created. If not provided: -
2561
+ #
2562
+ # @param rollover_fraction [Float] Will be passed down to the individual commits. This controls how much of an indi
2563
+ #
2564
+ # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifier>] List of filters that determine what kind of customer usage draws down a commit o
2565
+ #
2566
+ # @param subscription_config [MetronomeSDK::Models::RecurringCommitSubscriptionConfig] Attach a subscription to the recurring commit/credit.
2567
+
2568
+ # @see MetronomeSDK::Models::ContractV2::RecurringCommit#access_amount
2569
+ class AccessAmount < MetronomeSDK::Internal::Type::BaseModel
2570
+ # @!attribute credit_type_id
2571
+ #
2572
+ # @return [String]
2573
+ required :credit_type_id, String
2574
+
2575
+ # @!attribute unit_price
2576
+ #
2577
+ # @return [Float]
2578
+ required :unit_price, Float
2579
+
2580
+ # @!attribute quantity
2581
+ #
2582
+ # @return [Float, nil]
2583
+ optional :quantity, Float
2584
+
2585
+ # @!method initialize(credit_type_id:, unit_price:, quantity: nil)
2586
+ # The amount of commit to grant.
2587
+ #
2588
+ # @param credit_type_id [String]
2589
+ # @param unit_price [Float]
2590
+ # @param quantity [Float]
2591
+ end
2592
+
2593
+ # @see MetronomeSDK::Models::ContractV2::RecurringCommit#commit_duration
2594
+ class CommitDuration < MetronomeSDK::Internal::Type::BaseModel
2595
+ # @!attribute value
2596
+ #
2597
+ # @return [Float]
2598
+ required :value, Float
2599
+
2600
+ # @!attribute unit
2601
+ #
2602
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::RecurringCommit::CommitDuration::Unit, nil]
2603
+ optional :unit, enum: -> { MetronomeSDK::ContractV2::RecurringCommit::CommitDuration::Unit }
2604
+
2605
+ # @!method initialize(value:, unit: nil)
2606
+ # The amount of time the created commits will be valid for
2607
+ #
2608
+ # @param value [Float]
2609
+ # @param unit [Symbol, MetronomeSDK::Models::ContractV2::RecurringCommit::CommitDuration::Unit]
2610
+
2611
+ # @see MetronomeSDK::Models::ContractV2::RecurringCommit::CommitDuration#unit
2612
+ module Unit
2613
+ extend MetronomeSDK::Internal::Type::Enum
2614
+
2615
+ PERIODS = :PERIODS
2616
+
2617
+ # @!method self.values
2618
+ # @return [Array<Symbol>]
2619
+ end
2620
+ end
2621
+
2622
+ # @see MetronomeSDK::Models::ContractV2::RecurringCommit#product
2623
+ class Product < MetronomeSDK::Internal::Type::BaseModel
2624
+ # @!attribute id
2625
+ #
2626
+ # @return [String]
2627
+ required :id, String
2628
+
2629
+ # @!attribute name
2630
+ #
2631
+ # @return [String]
2632
+ required :name, String
2633
+
2634
+ # @!method initialize(id:, name:)
2635
+ # @param id [String]
2636
+ # @param name [String]
2637
+ end
2638
+
2639
+ # Whether the created commits will use the commit rate or list rate
2640
+ #
2641
+ # @see MetronomeSDK::Models::ContractV2::RecurringCommit#rate_type
2642
+ module RateType
2643
+ extend MetronomeSDK::Internal::Type::Enum
2644
+
2645
+ COMMIT_RATE = :COMMIT_RATE
2646
+ LIST_RATE = :LIST_RATE
2647
+
2648
+ # @!method self.values
2649
+ # @return [Array<Symbol>]
2650
+ end
2651
+
2652
+ # @see MetronomeSDK::Models::ContractV2::RecurringCommit#contract
2653
+ class Contract < MetronomeSDK::Internal::Type::BaseModel
2654
+ # @!attribute id
2655
+ #
2656
+ # @return [String]
2657
+ required :id, String
2658
+
2659
+ # @!method initialize(id:)
2660
+ # @param id [String]
2661
+ end
2662
+
2663
+ # @see MetronomeSDK::Models::ContractV2::RecurringCommit#invoice_amount
2664
+ class InvoiceAmount < MetronomeSDK::Internal::Type::BaseModel
2665
+ # @!attribute credit_type_id
2666
+ #
2667
+ # @return [String]
2668
+ required :credit_type_id, String
2669
+
2670
+ # @!attribute quantity
2671
+ #
2672
+ # @return [Float]
2673
+ required :quantity, Float
2674
+
2675
+ # @!attribute unit_price
2676
+ #
2677
+ # @return [Float]
2678
+ required :unit_price, Float
2679
+
2680
+ # @!method initialize(credit_type_id:, quantity:, unit_price:)
2681
+ # The amount the customer should be billed for the commit. Not required.
2682
+ #
2683
+ # @param credit_type_id [String]
2684
+ # @param quantity [Float]
2685
+ # @param unit_price [Float]
2686
+ end
2687
+
2688
+ # Determines whether the first and last commit will be prorated. If not provided,
2689
+ # the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
2690
+ #
2691
+ # @see MetronomeSDK::Models::ContractV2::RecurringCommit#proration
2692
+ module Proration
2693
+ extend MetronomeSDK::Internal::Type::Enum
2694
+
2695
+ NONE = :NONE
2696
+ FIRST = :FIRST
2697
+ LAST = :LAST
2698
+ FIRST_AND_LAST = :FIRST_AND_LAST
2699
+
2700
+ # @!method self.values
2701
+ # @return [Array<Symbol>]
2702
+ end
2703
+
2704
+ # The frequency at which the recurring commits will be created. If not provided: -
2705
+ # The commits will be created on the usage invoice frequency. If provided: - The
2706
+ # period defined in the duration will correspond to this frequency. - Commits will
2707
+ # be created aligned with the recurring commit's starting_at rather than the usage
2708
+ # invoice dates.
2709
+ #
2710
+ # @see MetronomeSDK::Models::ContractV2::RecurringCommit#recurrence_frequency
2711
+ module RecurrenceFrequency
2712
+ extend MetronomeSDK::Internal::Type::Enum
2713
+
2714
+ MONTHLY = :MONTHLY
2715
+ QUARTERLY = :QUARTERLY
2716
+ ANNUAL = :ANNUAL
2717
+ WEEKLY = :WEEKLY
2718
+
2719
+ # @!method self.values
2720
+ # @return [Array<Symbol>]
2721
+ end
2722
+ end
2723
+
2724
+ class RecurringCredit < MetronomeSDK::Internal::Type::BaseModel
2725
+ # @!attribute id
2726
+ #
2727
+ # @return [String]
2728
+ required :id, String
2729
+
2730
+ # @!attribute access_amount
2731
+ # The amount of commit to grant.
2732
+ #
2733
+ # @return [MetronomeSDK::Models::ContractV2::RecurringCredit::AccessAmount]
2734
+ required :access_amount, -> { MetronomeSDK::ContractV2::RecurringCredit::AccessAmount }
2735
+
2736
+ # @!attribute commit_duration
2737
+ # The amount of time the created commits will be valid for
2738
+ #
2739
+ # @return [MetronomeSDK::Models::ContractV2::RecurringCredit::CommitDuration]
2740
+ required :commit_duration, -> { MetronomeSDK::ContractV2::RecurringCredit::CommitDuration }
2741
+
2742
+ # @!attribute priority
2743
+ # Will be passed down to the individual commits
2744
+ #
2745
+ # @return [Float]
2746
+ required :priority, Float
2747
+
2748
+ # @!attribute product
2749
+ #
2750
+ # @return [MetronomeSDK::Models::ContractV2::RecurringCredit::Product]
2751
+ required :product, -> { MetronomeSDK::ContractV2::RecurringCredit::Product }
2752
+
2753
+ # @!attribute rate_type
2754
+ # Whether the created commits will use the commit rate or list rate
2755
+ #
2756
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::RecurringCredit::RateType]
2757
+ required :rate_type, enum: -> { MetronomeSDK::ContractV2::RecurringCredit::RateType }
2758
+
2759
+ # @!attribute starting_at
2760
+ # Determines the start time for the first commit
2761
+ #
2762
+ # @return [Time]
2763
+ required :starting_at, Time
2764
+
2765
+ # @!attribute applicable_product_ids
2766
+ # Will be passed down to the individual commits
2767
+ #
2768
+ # @return [Array<String>, nil]
2769
+ optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
2770
+
2771
+ # @!attribute applicable_product_tags
2772
+ # Will be passed down to the individual commits
2773
+ #
2774
+ # @return [Array<String>, nil]
2775
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
2776
+
2777
+ # @!attribute contract
2778
+ #
2779
+ # @return [MetronomeSDK::Models::ContractV2::RecurringCredit::Contract, nil]
2780
+ optional :contract, -> { MetronomeSDK::ContractV2::RecurringCredit::Contract }
2781
+
2782
+ # @!attribute description
2783
+ # Will be passed down to the individual commits
2784
+ #
2785
+ # @return [String, nil]
2786
+ optional :description, String
2787
+
2788
+ # @!attribute ending_before
2789
+ # Determines when the contract will stop creating recurring commits. Optional
2790
+ #
2791
+ # @return [Time, nil]
2792
+ optional :ending_before, Time
2793
+
2794
+ # @!attribute hierarchy_configuration
2795
+ # Optional configuration for recurring credit hierarchy access control
2796
+ #
2797
+ # @return [MetronomeSDK::Models::CommitHierarchyConfiguration, nil]
2798
+ optional :hierarchy_configuration, -> { MetronomeSDK::CommitHierarchyConfiguration }
2799
+
2800
+ # @!attribute name
2801
+ # Displayed on invoices. Will be passed through to the individual commits
2802
+ #
2803
+ # @return [String, nil]
2804
+ optional :name, String
2805
+
2806
+ # @!attribute netsuite_sales_order_id
2807
+ # Will be passed down to the individual commits
2808
+ #
2809
+ # @return [String, nil]
2810
+ optional :netsuite_sales_order_id, String
2811
+
2812
+ # @!attribute proration
2813
+ # Determines whether the first and last commit will be prorated. If not provided,
2814
+ # the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
2815
+ #
2816
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::RecurringCredit::Proration, nil]
2817
+ optional :proration, enum: -> { MetronomeSDK::ContractV2::RecurringCredit::Proration }
2818
+
2819
+ # @!attribute recurrence_frequency
2820
+ # The frequency at which the recurring commits will be created. If not provided: -
2821
+ # The commits will be created on the usage invoice frequency. If provided: - The
2822
+ # period defined in the duration will correspond to this frequency. - Commits will
2823
+ # be created aligned with the recurring commit's starting_at rather than the usage
2824
+ # invoice dates.
2825
+ #
2826
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::RecurringCredit::RecurrenceFrequency, nil]
2827
+ optional :recurrence_frequency,
2828
+ enum: -> { MetronomeSDK::ContractV2::RecurringCredit::RecurrenceFrequency }
2829
+
2830
+ # @!attribute rollover_fraction
2831
+ # Will be passed down to the individual commits. This controls how much of an
2832
+ # individual unexpired commit will roll over upon contract transition. Must be
2833
+ # between 0 and 1.
2834
+ #
2835
+ # @return [Float, nil]
2836
+ optional :rollover_fraction, Float
2837
+
2838
+ # @!attribute specifiers
2839
+ # List of filters that determine what kind of customer usage draws down a commit
2840
+ # or credit. A customer's usage needs to meet the condition of at least one of the
2841
+ # specifiers to contribute to a commit's or credit's drawdown.
2842
+ #
2843
+ # @return [Array<MetronomeSDK::Models::CommitSpecifier>, nil]
2844
+ optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifier] }
2845
+
2846
+ # @!attribute subscription_config
2847
+ # Attach a subscription to the recurring commit/credit.
2848
+ #
2849
+ # @return [MetronomeSDK::Models::RecurringCommitSubscriptionConfig, nil]
2850
+ optional :subscription_config, -> { MetronomeSDK::RecurringCommitSubscriptionConfig }
2851
+
2852
+ # @!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, recurrence_frequency: nil, rollover_fraction: nil, specifiers: nil, subscription_config: nil)
2853
+ # Some parameter documentations has been truncated, see
2854
+ # {MetronomeSDK::Models::ContractV2::RecurringCredit} for more details.
2855
+ #
2856
+ # @param id [String]
2857
+ #
2858
+ # @param access_amount [MetronomeSDK::Models::ContractV2::RecurringCredit::AccessAmount] The amount of commit to grant.
2859
+ #
2860
+ # @param commit_duration [MetronomeSDK::Models::ContractV2::RecurringCredit::CommitDuration] The amount of time the created commits will be valid for
2861
+ #
2862
+ # @param priority [Float] Will be passed down to the individual commits
2863
+ #
2864
+ # @param product [MetronomeSDK::Models::ContractV2::RecurringCredit::Product]
2865
+ #
2866
+ # @param rate_type [Symbol, MetronomeSDK::Models::ContractV2::RecurringCredit::RateType] Whether the created commits will use the commit rate or list rate
2867
+ #
2868
+ # @param starting_at [Time] Determines the start time for the first commit
2869
+ #
2870
+ # @param applicable_product_ids [Array<String>] Will be passed down to the individual commits
2871
+ #
2872
+ # @param applicable_product_tags [Array<String>] Will be passed down to the individual commits
2873
+ #
2874
+ # @param contract [MetronomeSDK::Models::ContractV2::RecurringCredit::Contract]
2875
+ #
2876
+ # @param description [String] Will be passed down to the individual commits
2877
+ #
2878
+ # @param ending_before [Time] Determines when the contract will stop creating recurring commits. Optional
2879
+ #
2880
+ # @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for recurring credit hierarchy access control
2881
+ #
2882
+ # @param name [String] Displayed on invoices. Will be passed through to the individual commits
2883
+ #
2884
+ # @param netsuite_sales_order_id [String] Will be passed down to the individual commits
2885
+ #
2886
+ # @param proration [Symbol, MetronomeSDK::Models::ContractV2::RecurringCredit::Proration] Determines whether the first and last commit will be prorated. If not provided,
2887
+ #
2888
+ # @param recurrence_frequency [Symbol, MetronomeSDK::Models::ContractV2::RecurringCredit::RecurrenceFrequency] The frequency at which the recurring commits will be created. If not provided: -
2889
+ #
2890
+ # @param rollover_fraction [Float] Will be passed down to the individual commits. This controls how much of an indi
2891
+ #
2892
+ # @param specifiers [Array<MetronomeSDK::Models::CommitSpecifier>] List of filters that determine what kind of customer usage draws down a commit o
2893
+ #
2894
+ # @param subscription_config [MetronomeSDK::Models::RecurringCommitSubscriptionConfig] Attach a subscription to the recurring commit/credit.
2895
+
2896
+ # @see MetronomeSDK::Models::ContractV2::RecurringCredit#access_amount
2897
+ class AccessAmount < MetronomeSDK::Internal::Type::BaseModel
2898
+ # @!attribute credit_type_id
2899
+ #
2900
+ # @return [String]
2901
+ required :credit_type_id, String
2902
+
2903
+ # @!attribute unit_price
2904
+ #
2905
+ # @return [Float]
2906
+ required :unit_price, Float
2907
+
2908
+ # @!attribute quantity
2909
+ #
2910
+ # @return [Float, nil]
2911
+ optional :quantity, Float
2912
+
2913
+ # @!method initialize(credit_type_id:, unit_price:, quantity: nil)
2914
+ # The amount of commit to grant.
2915
+ #
2916
+ # @param credit_type_id [String]
2917
+ # @param unit_price [Float]
2918
+ # @param quantity [Float]
2919
+ end
2920
+
2921
+ # @see MetronomeSDK::Models::ContractV2::RecurringCredit#commit_duration
2922
+ class CommitDuration < MetronomeSDK::Internal::Type::BaseModel
2923
+ # @!attribute value
2924
+ #
2925
+ # @return [Float]
2926
+ required :value, Float
2927
+
2928
+ # @!attribute unit
2929
+ #
2930
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::RecurringCredit::CommitDuration::Unit, nil]
2931
+ optional :unit, enum: -> { MetronomeSDK::ContractV2::RecurringCredit::CommitDuration::Unit }
2932
+
2933
+ # @!method initialize(value:, unit: nil)
2934
+ # The amount of time the created commits will be valid for
2935
+ #
2936
+ # @param value [Float]
2937
+ # @param unit [Symbol, MetronomeSDK::Models::ContractV2::RecurringCredit::CommitDuration::Unit]
2938
+
2939
+ # @see MetronomeSDK::Models::ContractV2::RecurringCredit::CommitDuration#unit
2940
+ module Unit
2941
+ extend MetronomeSDK::Internal::Type::Enum
2942
+
2943
+ PERIODS = :PERIODS
2944
+
2945
+ # @!method self.values
2946
+ # @return [Array<Symbol>]
2947
+ end
2948
+ end
2949
+
2950
+ # @see MetronomeSDK::Models::ContractV2::RecurringCredit#product
2951
+ class Product < MetronomeSDK::Internal::Type::BaseModel
2952
+ # @!attribute id
2953
+ #
2954
+ # @return [String]
2955
+ required :id, String
2956
+
2957
+ # @!attribute name
2958
+ #
2959
+ # @return [String]
2960
+ required :name, String
2961
+
2962
+ # @!method initialize(id:, name:)
2963
+ # @param id [String]
2964
+ # @param name [String]
2965
+ end
2966
+
2967
+ # Whether the created commits will use the commit rate or list rate
2968
+ #
2969
+ # @see MetronomeSDK::Models::ContractV2::RecurringCredit#rate_type
2970
+ module RateType
2971
+ extend MetronomeSDK::Internal::Type::Enum
2972
+
2973
+ COMMIT_RATE = :COMMIT_RATE
2974
+ LIST_RATE = :LIST_RATE
2975
+
2976
+ # @!method self.values
2977
+ # @return [Array<Symbol>]
2978
+ end
2979
+
2980
+ # @see MetronomeSDK::Models::ContractV2::RecurringCredit#contract
2981
+ class Contract < MetronomeSDK::Internal::Type::BaseModel
2982
+ # @!attribute id
2983
+ #
2984
+ # @return [String]
2985
+ required :id, String
2986
+
2987
+ # @!method initialize(id:)
2988
+ # @param id [String]
2989
+ end
2990
+
2991
+ # Determines whether the first and last commit will be prorated. If not provided,
2992
+ # the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
2993
+ #
2994
+ # @see MetronomeSDK::Models::ContractV2::RecurringCredit#proration
2995
+ module Proration
2996
+ extend MetronomeSDK::Internal::Type::Enum
2997
+
2998
+ NONE = :NONE
2999
+ FIRST = :FIRST
3000
+ LAST = :LAST
3001
+ FIRST_AND_LAST = :FIRST_AND_LAST
3002
+
3003
+ # @!method self.values
3004
+ # @return [Array<Symbol>]
3005
+ end
3006
+
3007
+ # The frequency at which the recurring commits will be created. If not provided: -
3008
+ # The commits will be created on the usage invoice frequency. If provided: - The
3009
+ # period defined in the duration will correspond to this frequency. - Commits will
3010
+ # be created aligned with the recurring commit's starting_at rather than the usage
3011
+ # invoice dates.
3012
+ #
3013
+ # @see MetronomeSDK::Models::ContractV2::RecurringCredit#recurrence_frequency
3014
+ module RecurrenceFrequency
3015
+ extend MetronomeSDK::Internal::Type::Enum
3016
+
3017
+ MONTHLY = :MONTHLY
3018
+ QUARTERLY = :QUARTERLY
3019
+ ANNUAL = :ANNUAL
3020
+ WEEKLY = :WEEKLY
3021
+
3022
+ # @!method self.values
3023
+ # @return [Array<Symbol>]
3024
+ end
3025
+ end
3026
+
3027
+ class ResellerRoyalty < MetronomeSDK::Internal::Type::BaseModel
3028
+ # @!attribute reseller_type
3029
+ #
3030
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::ResellerRoyalty::ResellerType]
3031
+ required :reseller_type, enum: -> { MetronomeSDK::ContractV2::ResellerRoyalty::ResellerType }
3032
+
3033
+ # @!attribute segments
3034
+ #
3035
+ # @return [Array<MetronomeSDK::Models::ContractV2::ResellerRoyalty::Segment>]
3036
+ required :segments,
3037
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::ContractV2::ResellerRoyalty::Segment] }
3038
+
3039
+ # @!method initialize(reseller_type:, segments:)
3040
+ # @param reseller_type [Symbol, MetronomeSDK::Models::ContractV2::ResellerRoyalty::ResellerType]
3041
+ # @param segments [Array<MetronomeSDK::Models::ContractV2::ResellerRoyalty::Segment>]
3042
+
3043
+ # @see MetronomeSDK::Models::ContractV2::ResellerRoyalty#reseller_type
3044
+ module ResellerType
3045
+ extend MetronomeSDK::Internal::Type::Enum
3046
+
3047
+ AWS = :AWS
3048
+ AWS_PRO_SERVICE = :AWS_PRO_SERVICE
3049
+ GCP = :GCP
3050
+ GCP_PRO_SERVICE = :GCP_PRO_SERVICE
3051
+
3052
+ # @!method self.values
3053
+ # @return [Array<Symbol>]
3054
+ end
3055
+
3056
+ class Segment < MetronomeSDK::Internal::Type::BaseModel
3057
+ # @!attribute fraction
3058
+ #
3059
+ # @return [Float]
3060
+ required :fraction, Float
3061
+
3062
+ # @!attribute netsuite_reseller_id
3063
+ #
3064
+ # @return [String]
3065
+ required :netsuite_reseller_id, String
3066
+
3067
+ # @!attribute reseller_type
3068
+ #
3069
+ # @return [Symbol, MetronomeSDK::Models::ContractV2::ResellerRoyalty::Segment::ResellerType]
3070
+ required :reseller_type, enum: -> { MetronomeSDK::ContractV2::ResellerRoyalty::Segment::ResellerType }
3071
+
3072
+ # @!attribute starting_at
3073
+ #
3074
+ # @return [Time]
3075
+ required :starting_at, Time
3076
+
3077
+ # @!attribute applicable_product_ids
3078
+ #
3079
+ # @return [Array<String>, nil]
3080
+ optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
3081
+
3082
+ # @!attribute applicable_product_tags
3083
+ #
3084
+ # @return [Array<String>, nil]
3085
+ optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]
3086
+
3087
+ # @!attribute aws_account_number
3088
+ #
3089
+ # @return [String, nil]
3090
+ optional :aws_account_number, String
3091
+
3092
+ # @!attribute aws_offer_id
3093
+ #
3094
+ # @return [String, nil]
3095
+ optional :aws_offer_id, String
3096
+
3097
+ # @!attribute aws_payer_reference_id
3098
+ #
3099
+ # @return [String, nil]
3100
+ optional :aws_payer_reference_id, String
3101
+
3102
+ # @!attribute ending_before
3103
+ #
3104
+ # @return [Time, nil]
3105
+ optional :ending_before, Time
3106
+
3107
+ # @!attribute gcp_account_id
3108
+ #
3109
+ # @return [String, nil]
3110
+ optional :gcp_account_id, String
3111
+
3112
+ # @!attribute gcp_offer_id
3113
+ #
3114
+ # @return [String, nil]
3115
+ optional :gcp_offer_id, String
3116
+
3117
+ # @!attribute reseller_contract_value
3118
+ #
3119
+ # @return [Float, nil]
3120
+ optional :reseller_contract_value, Float
3121
+
3122
+ # @!method initialize(fraction:, netsuite_reseller_id:, reseller_type:, starting_at:, applicable_product_ids: nil, applicable_product_tags: nil, aws_account_number: nil, aws_offer_id: nil, aws_payer_reference_id: nil, ending_before: nil, gcp_account_id: nil, gcp_offer_id: nil, reseller_contract_value: nil)
3123
+ # @param fraction [Float]
3124
+ # @param netsuite_reseller_id [String]
3125
+ # @param reseller_type [Symbol, MetronomeSDK::Models::ContractV2::ResellerRoyalty::Segment::ResellerType]
3126
+ # @param starting_at [Time]
3127
+ # @param applicable_product_ids [Array<String>]
3128
+ # @param applicable_product_tags [Array<String>]
3129
+ # @param aws_account_number [String]
3130
+ # @param aws_offer_id [String]
3131
+ # @param aws_payer_reference_id [String]
3132
+ # @param ending_before [Time]
3133
+ # @param gcp_account_id [String]
3134
+ # @param gcp_offer_id [String]
3135
+ # @param reseller_contract_value [Float]
3136
+
3137
+ # @see MetronomeSDK::Models::ContractV2::ResellerRoyalty::Segment#reseller_type
3138
+ module ResellerType
3139
+ extend MetronomeSDK::Internal::Type::Enum
3140
+
3141
+ AWS = :AWS
3142
+ AWS_PRO_SERVICE = :AWS_PRO_SERVICE
3143
+ GCP = :GCP
3144
+ GCP_PRO_SERVICE = :GCP_PRO_SERVICE
3145
+
3146
+ # @!method self.values
3147
+ # @return [Array<Symbol>]
3148
+ end
3149
+ end
3150
+ end
3151
+
3152
+ # Determines which scheduled and commit charges to consolidate onto the Contract's
3153
+ # usage invoice. The charge's `timestamp` must match the usage invoice's
3154
+ # `ending_before` date for consolidation to occur. This field cannot be modified
3155
+ # after a Contract has been created. If this field is omitted, charges will appear
3156
+ # on a separate invoice from usage charges.
3157
+ #
3158
+ # @see MetronomeSDK::Models::ContractV2#scheduled_charges_on_usage_invoices
3159
+ module ScheduledChargesOnUsageInvoices
3160
+ extend MetronomeSDK::Internal::Type::Enum
3161
+
3162
+ ALL = :ALL
3163
+
3164
+ # @!method self.values
3165
+ # @return [Array<Symbol>]
3166
+ end
3167
+ end
3168
+ end
3169
+ end