metronome-sdk 3.10.0 → 3.12.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +50 -0
- data/README.md +1 -10
- data/lib/metronome_sdk/internal/body_cursor_page_cursor_field.rb +86 -0
- data/lib/metronome_sdk/models/contract_v2.rb +111 -7
- data/lib/metronome_sdk/models/contract_without_amendments.rb +86 -6
- data/lib/metronome_sdk/models/credit.rb +13 -1
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +70 -1
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +70 -1
- data/lib/metronome_sdk/models/schedule_duration.rb +28 -1
- data/lib/metronome_sdk/models/subscription.rb +27 -1
- data/lib/metronome_sdk/models/v1/alert_create_params.rb +43 -5
- data/lib/metronome_sdk/models/v1/billable_metric_update_params.rb +31 -0
- data/lib/metronome_sdk/models/v1/billable_metric_update_response.rb +18 -0
- data/lib/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rb +11 -1
- data/lib/metronome_sdk/models/v1/contract_amend_params.rb +62 -2
- data/lib/metronome_sdk/models/v1/contract_create_params.rb +128 -18
- data/lib/metronome_sdk/models/v1/contract_create_response.rb +86 -6
- data/lib/metronome_sdk/models/v1/contract_get_net_balance_params.rb +22 -1
- data/lib/metronome_sdk/models/v1/contract_get_net_balance_response.rb +4 -3
- data/lib/metronome_sdk/models/v1/contract_list_balances_params.rb +22 -1
- data/lib/metronome_sdk/models/v1/contract_list_params.rb +18 -2
- data/lib/metronome_sdk/models/v1/contract_list_seat_balances_response.rb +96 -4
- data/lib/metronome_sdk/models/v1/contract_retrieve_subscription_quantity_history_response.rb +16 -1
- data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +10 -1
- data/lib/metronome_sdk/models/v1/contracts/product_list_item_state.rb +10 -1
- data/lib/metronome_sdk/models/v1/contracts/product_list_response.rb +10 -1
- data/lib/metronome_sdk/models/v1/contracts/product_retrieve_response.rb +10 -1
- data/lib/metronome_sdk/models/v1/contracts/product_update_params.rb +10 -1
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/named_schedule_list_params.rb +82 -0
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/named_schedule_list_response.rb +69 -0
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/named_schedule_retrieve_params.rb +10 -1
- data/lib/metronome_sdk/models/v1/contracts/rate_cards/named_schedule_update_params.rb +10 -1
- data/lib/metronome_sdk/models/v1/customer_create_params.rb +4 -14
- data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_params.rb +2 -4
- data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +4 -3
- data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +2 -6
- data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +2 -6
- data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +31 -1
- data/lib/metronome_sdk/models/v1/customers/commit_list_params.rb +22 -1
- data/lib/metronome_sdk/models/v1/customers/credit_create_params.rb +31 -1
- data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +46 -5
- data/lib/metronome_sdk/models/v1/customers/invoice.rb +52 -13
- data/lib/metronome_sdk/models/v1/customers/invoice_list_params.rb +10 -1
- data/lib/metronome_sdk/models/v1/package_create_params.rb +129 -18
- data/lib/metronome_sdk/models/v1/package_list_response.rb +139 -7
- data/lib/metronome_sdk/models/v1/package_retrieve_response.rb +139 -7
- data/lib/metronome_sdk/models/v1/pricing_unit_archive_params.rb +16 -0
- data/lib/metronome_sdk/models/v1/pricing_unit_archive_response.rb +18 -0
- data/lib/metronome_sdk/models/v1/pricing_unit_create_params.rb +24 -0
- data/lib/metronome_sdk/models/v1/pricing_unit_create_response.rb +18 -0
- data/lib/metronome_sdk/models/v1/usage_list_params.rb +4 -2
- data/lib/metronome_sdk/models/v1/usage_list_with_groups_params.rb +11 -8
- data/lib/metronome_sdk/models/v2/contract_edit_params.rb +221 -20
- data/lib/metronome_sdk/models/v2/contract_edit_response.rb +200 -9
- data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +200 -9
- data/lib/metronome_sdk/models/v2/contract_list_params.rb +17 -1
- data/lib/metronome_sdk/models/v2/lifecycle_event_offset_notification_config.rb +104 -0
- data/lib/metronome_sdk/models/v2/lifecycle_event_system_notification_config.rb +45 -0
- data/lib/metronome_sdk/models/v2/notifications/offset_archive_params.rb +29 -0
- data/lib/metronome_sdk/models/v2/notifications/offset_archive_response.rb +20 -0
- data/lib/metronome_sdk/models/v2/notifications/offset_create_params.rb +77 -0
- data/lib/metronome_sdk/models/v2/notifications/offset_create_response.rb +20 -0
- data/lib/metronome_sdk/models/v2/notifications/offset_edit_params.rb +98 -0
- data/lib/metronome_sdk/models/v2/notifications/offset_edit_response.rb +32 -0
- data/lib/metronome_sdk/models/v2/notifications/offset_list_params.rb +57 -0
- data/lib/metronome_sdk/models/v2/notifications/offset_retrieve_params.rb +26 -0
- data/lib/metronome_sdk/models/v2/notifications/offset_retrieve_response.rb +20 -0
- data/lib/metronome_sdk/models/v2/notifications/system_list_params.rb +18 -0
- data/lib/metronome_sdk/models/v2/notifications/system_list_response.rb +27 -0
- data/lib/metronome_sdk/resources/v1/alerts.rb +6 -2
- data/lib/metronome_sdk/resources/v1/billable_metrics.rb +45 -0
- data/lib/metronome_sdk/resources/v1/contracts/products.rb +6 -2
- data/lib/metronome_sdk/resources/v1/contracts/rate_cards/named_schedules.rb +46 -2
- data/lib/metronome_sdk/resources/v1/contracts.rb +26 -9
- data/lib/metronome_sdk/resources/v1/custom_fields.rb +3 -0
- data/lib/metronome_sdk/resources/v1/customers/alerts.rb +1 -1
- data/lib/metronome_sdk/resources/v1/customers/commits.rb +6 -1
- data/lib/metronome_sdk/resources/v1/customers/credits.rb +3 -0
- data/lib/metronome_sdk/resources/v1/customers/invoices.rb +3 -1
- data/lib/metronome_sdk/resources/v1/pricing_units.rb +45 -0
- data/lib/metronome_sdk/resources/v1/usage.rb +12 -10
- data/lib/metronome_sdk/resources/v2/contracts.rb +15 -6
- data/lib/metronome_sdk/resources/v2/notifications/offset.rb +157 -0
- data/lib/metronome_sdk/resources/v2/notifications/system.rb +37 -0
- data/lib/metronome_sdk/resources/v2/notifications.rb +24 -0
- data/lib/metronome_sdk/resources/v2.rb +4 -0
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +25 -2
- data/rbi/metronome_sdk/internal/body_cursor_page_cursor_field.rbi +22 -0
- data/rbi/metronome_sdk/models/contract_v2.rbi +202 -4
- data/rbi/metronome_sdk/models/contract_without_amendments.rbi +168 -4
- data/rbi/metronome_sdk/models/credit.rbi +19 -0
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +186 -0
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +186 -0
- data/rbi/metronome_sdk/models/schedule_duration.rbi +57 -1
- data/rbi/metronome_sdk/models/subscription.rbi +34 -0
- data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +91 -6
- data/rbi/metronome_sdk/models/v1/billable_metric_update_params.rbi +54 -0
- data/rbi/metronome_sdk/models/v1/billable_metric_update_response.rbi +31 -0
- data/rbi/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rbi +15 -0
- data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +130 -0
- data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +284 -12
- data/rbi/metronome_sdk/models/v1/contract_create_response.rbi +158 -2
- data/rbi/metronome_sdk/models/v1/contract_get_net_balance_params.rbi +62 -0
- data/rbi/metronome_sdk/models/v1/contract_get_net_balance_response.rbi +6 -4
- data/rbi/metronome_sdk/models/v1/contract_list_balances_params.rbi +62 -0
- data/rbi/metronome_sdk/models/v1/contract_list_params.rbi +24 -2
- data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_response.rbi +219 -3
- data/rbi/metronome_sdk/models/v1/contract_retrieve_subscription_quantity_history_response.rbi +13 -0
- data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +13 -0
- data/rbi/metronome_sdk/models/v1/contracts/product_list_item_state.rbi +13 -0
- data/rbi/metronome_sdk/models/v1/contracts/product_list_response.rbi +13 -0
- data/rbi/metronome_sdk/models/v1/contracts/product_retrieve_response.rbi +13 -0
- data/rbi/metronome_sdk/models/v1/contracts/product_update_params.rbi +13 -0
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/named_schedule_list_params.rbi +122 -0
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/named_schedule_list_response.rbi +123 -0
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/named_schedule_retrieve_params.rbi +13 -0
- data/rbi/metronome_sdk/models/v1/contracts/rate_cards/named_schedule_update_params.rbi +13 -0
- data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +6 -22
- data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbi +3 -6
- data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +6 -4
- data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +3 -16
- data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +3 -16
- data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +65 -0
- data/rbi/metronome_sdk/models/v1/customers/commit_list_params.rbi +62 -0
- data/rbi/metronome_sdk/models/v1/customers/credit_create_params.rbi +65 -0
- data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +96 -6
- data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +99 -19
- data/rbi/metronome_sdk/models/v1/customers/invoice_list_params.rbi +13 -0
- data/rbi/metronome_sdk/models/v1/package_create_params.rbi +289 -12
- data/rbi/metronome_sdk/models/v1/package_list_response.rbi +306 -10
- data/rbi/metronome_sdk/models/v1/package_retrieve_response.rbi +306 -10
- data/rbi/metronome_sdk/models/v1/pricing_unit_archive_params.rbi +34 -0
- data/rbi/metronome_sdk/models/v1/pricing_unit_archive_response.rbi +31 -0
- data/rbi/metronome_sdk/models/v1/pricing_unit_create_params.rbi +45 -0
- data/rbi/metronome_sdk/models/v1/pricing_unit_create_response.rbi +31 -0
- data/rbi/metronome_sdk/models/v1/usage_list_params.rbi +4 -0
- data/rbi/metronome_sdk/models/v1/usage_list_with_groups_params.rbi +16 -10
- data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +492 -14
- data/rbi/metronome_sdk/models/v2/contract_edit_response.rbi +394 -2
- data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +402 -4
- data/rbi/metronome_sdk/models/v2/contract_list_params.rbi +22 -0
- data/rbi/metronome_sdk/models/v2/lifecycle_event_offset_notification_config.rbi +147 -0
- data/rbi/metronome_sdk/models/v2/lifecycle_event_system_notification_config.rbi +98 -0
- data/rbi/metronome_sdk/models/v2/notifications/offset_archive_params.rbi +47 -0
- data/rbi/metronome_sdk/models/v2/notifications/offset_archive_response.rbi +49 -0
- data/rbi/metronome_sdk/models/v2/notifications/offset_create_params.rbi +127 -0
- data/rbi/metronome_sdk/models/v2/notifications/offset_create_response.rbi +49 -0
- data/rbi/metronome_sdk/models/v2/notifications/offset_edit_params.rbi +181 -0
- data/rbi/metronome_sdk/models/v2/notifications/offset_edit_response.rbi +71 -0
- data/rbi/metronome_sdk/models/v2/notifications/offset_list_params.rbi +127 -0
- data/rbi/metronome_sdk/models/v2/notifications/offset_retrieve_params.rbi +47 -0
- data/rbi/metronome_sdk/models/v2/notifications/offset_retrieve_response.rbi +49 -0
- data/rbi/metronome_sdk/models/v2/notifications/system_list_params.rbi +36 -0
- data/rbi/metronome_sdk/models/v2/notifications/system_list_response.rbi +55 -0
- data/rbi/metronome_sdk/resources/v1/alerts.rbi +18 -3
- data/rbi/metronome_sdk/resources/v1/billable_metrics.rbi +34 -0
- data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +8 -0
- data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/named_schedules.rbi +47 -0
- data/rbi/metronome_sdk/resources/v1/contracts.rbi +36 -5
- data/rbi/metronome_sdk/resources/v1/custom_fields.rbi +3 -0
- data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +3 -2
- data/rbi/metronome_sdk/resources/v1/customers/billing_config.rbi +1 -2
- data/rbi/metronome_sdk/resources/v1/customers/commits.rbi +8 -0
- data/rbi/metronome_sdk/resources/v1/customers/credits.rbi +3 -0
- data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +4 -0
- data/rbi/metronome_sdk/resources/v1/pricing_units.rbi +26 -0
- data/rbi/metronome_sdk/resources/v1/usage.rbi +18 -13
- data/rbi/metronome_sdk/resources/v2/contracts.rbi +18 -4
- data/rbi/metronome_sdk/resources/v2/notifications/offset.rbi +130 -0
- data/rbi/metronome_sdk/resources/v2/notifications/system.rbi +28 -0
- data/rbi/metronome_sdk/resources/v2/notifications.rbi +20 -0
- data/rbi/metronome_sdk/resources/v2.rbi +3 -0
- data/sig/metronome_sdk/internal/body_cursor_page_cursor_field.rbs +13 -0
- data/sig/metronome_sdk/models/contract_v2.rbs +81 -2
- data/sig/metronome_sdk/models/contract_without_amendments.rbs +60 -2
- data/sig/metronome_sdk/models/credit.rbs +7 -0
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +71 -0
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +71 -0
- data/sig/metronome_sdk/models/schedule_duration.rbs +20 -0
- data/sig/metronome_sdk/models/subscription.rbs +21 -0
- data/sig/metronome_sdk/models/v1/alert_create_params.rbs +22 -0
- data/sig/metronome_sdk/models/v1/billable_metric_update_params.rbs +30 -0
- data/sig/metronome_sdk/models/v1/billable_metric_update_response.rbs +15 -0
- data/sig/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rbs +8 -1
- data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +40 -0
- data/sig/metronome_sdk/models/v1/contract_create_params.rbs +102 -10
- data/sig/metronome_sdk/models/v1/contract_create_response.rbs +60 -2
- data/sig/metronome_sdk/models/v1/contract_get_net_balance_params.rbs +20 -0
- data/sig/metronome_sdk/models/v1/contract_list_balances_params.rbs +20 -0
- data/sig/metronome_sdk/models/v1/contract_list_params.rbs +14 -0
- data/sig/metronome_sdk/models/v1/contract_list_seat_balances_response.rbs +81 -3
- data/sig/metronome_sdk/models/v1/contract_retrieve_subscription_quantity_history_response.rbs +7 -0
- data/sig/metronome_sdk/models/v1/contracts/product_create_params.rbs +7 -0
- data/sig/metronome_sdk/models/v1/contracts/product_list_item_state.rbs +7 -0
- data/sig/metronome_sdk/models/v1/contracts/product_list_response.rbs +7 -0
- data/sig/metronome_sdk/models/v1/contracts/product_retrieve_response.rbs +7 -0
- data/sig/metronome_sdk/models/v1/contracts/product_update_params.rbs +7 -0
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/named_schedule_list_params.rbs +74 -0
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/named_schedule_list_response.rbs +68 -0
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/named_schedule_retrieve_params.rbs +8 -1
- data/sig/metronome_sdk/models/v1/contracts/rate_cards/named_schedule_update_params.rbs +8 -1
- data/sig/metronome_sdk/models/v1/customer_create_params.rbs +1 -7
- data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +1 -7
- data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbs +1 -6
- data/sig/metronome_sdk/models/v1/customers/commit_create_params.rbs +20 -0
- data/sig/metronome_sdk/models/v1/customers/commit_list_params.rbs +20 -0
- data/sig/metronome_sdk/models/v1/customers/credit_create_params.rbs +20 -0
- data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +22 -0
- data/sig/metronome_sdk/models/v1/customers/invoice.rbs +30 -3
- data/sig/metronome_sdk/models/v1/customers/invoice_list_params.rbs +7 -0
- data/sig/metronome_sdk/models/v1/package_create_params.rbs +104 -11
- data/sig/metronome_sdk/models/v1/package_list_response.rbs +105 -9
- data/sig/metronome_sdk/models/v1/package_retrieve_response.rbs +105 -9
- data/sig/metronome_sdk/models/v1/pricing_unit_archive_params.rbs +17 -0
- data/sig/metronome_sdk/models/v1/pricing_unit_archive_response.rbs +15 -0
- data/sig/metronome_sdk/models/v1/pricing_unit_create_params.rbs +25 -0
- data/sig/metronome_sdk/models/v1/pricing_unit_create_response.rbs +15 -0
- data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +180 -10
- data/sig/metronome_sdk/models/v2/contract_edit_response.rbs +159 -2
- data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +159 -2
- data/sig/metronome_sdk/models/v2/contract_list_params.rbs +14 -0
- data/sig/metronome_sdk/models/v2/lifecycle_event_offset_notification_config.rbs +69 -0
- data/sig/metronome_sdk/models/v2/lifecycle_event_system_notification_config.rbs +44 -0
- data/sig/metronome_sdk/models/v2/notifications/offset_archive_params.rbs +27 -0
- data/sig/metronome_sdk/models/v2/notifications/offset_archive_response.rbs +22 -0
- data/sig/metronome_sdk/models/v2/notifications/offset_create_params.rbs +54 -0
- data/sig/metronome_sdk/models/v2/notifications/offset_create_response.rbs +22 -0
- data/sig/metronome_sdk/models/v2/notifications/offset_edit_params.rbs +77 -0
- data/sig/metronome_sdk/models/v2/notifications/offset_edit_response.rbs +34 -0
- data/sig/metronome_sdk/models/v2/notifications/offset_list_params.rbs +60 -0
- data/sig/metronome_sdk/models/v2/notifications/offset_retrieve_params.rbs +27 -0
- data/sig/metronome_sdk/models/v2/notifications/offset_retrieve_response.rbs +22 -0
- data/sig/metronome_sdk/models/v2/notifications/system_list_params.rbs +19 -0
- data/sig/metronome_sdk/models/v2/notifications/system_list_response.rbs +29 -0
- data/sig/metronome_sdk/resources/v1/alerts.rbs +1 -0
- data/sig/metronome_sdk/resources/v1/billable_metrics.rbs +6 -0
- data/sig/metronome_sdk/resources/v1/contracts/products.rbs +2 -0
- data/sig/metronome_sdk/resources/v1/contracts/rate_cards/named_schedules.rbs +13 -0
- data/sig/metronome_sdk/resources/v1/contracts.rbs +6 -1
- data/sig/metronome_sdk/resources/v1/customers/commits.rbs +1 -0
- data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +1 -0
- data/sig/metronome_sdk/resources/v1/pricing_units.rbs +10 -0
- data/sig/metronome_sdk/resources/v2/contracts.rbs +3 -1
- data/sig/metronome_sdk/resources/v2/notifications/offset.rbs +42 -0
- data/sig/metronome_sdk/resources/v2/notifications/system.rbs +15 -0
- data/sig/metronome_sdk/resources/v2/notifications.rbs +13 -0
- data/sig/metronome_sdk/resources/v2.rbs +2 -0
- metadata +77 -8
- data/lib/metronome_sdk/models/v1/contract_list_response.rb +0 -18
- data/lib/metronome_sdk/models/v2/contract_list_response.rb +0 -18
- data/rbi/metronome_sdk/models/v1/contract_list_response.rbi +0 -32
- data/rbi/metronome_sdk/models/v2/contract_list_response.rbi +0 -32
- data/sig/metronome_sdk/models/v1/contract_list_response.rbs +0 -15
- data/sig/metronome_sdk/models/v2/contract_list_response.rbs +0 -15
|
@@ -267,31 +267,40 @@ module MetronomeSDK
|
|
|
267
267
|
# Some parameter documentations has been truncated, see
|
|
268
268
|
# {MetronomeSDK::Models::V1::ContractListParams} for more details.
|
|
269
269
|
#
|
|
270
|
-
# Retrieves
|
|
270
|
+
# Retrieves a page of contracts for a specific customer, including pricing, terms,
|
|
271
271
|
# credits, and commitments. Use this to view a customer's contract history and
|
|
272
272
|
# current agreements for billing management. Returns contract details with
|
|
273
273
|
# optional ledgers and balance information.
|
|
274
274
|
#
|
|
275
|
+
# ### Usage guidelines:
|
|
276
|
+
#
|
|
277
|
+
# - Pagination: Results are limited to 20 contracts per page; use 'cursor' for
|
|
278
|
+
# more
|
|
279
|
+
#
|
|
275
280
|
# ⚠️ Note: This is the legacy v1 endpoint - new integrations should use the v2
|
|
276
281
|
# endpoint for enhanced features.
|
|
277
282
|
#
|
|
278
|
-
# @overload list(customer_id:, covering_date: nil, include_archived: nil, include_balance: nil, include_ledgers: nil, starting_at: nil, request_options: {})
|
|
283
|
+
# @overload list(customer_id:, covering_date: nil, cursor: nil, include_archived: nil, include_balance: nil, include_ledgers: nil, limit: nil, starting_at: nil, request_options: {})
|
|
279
284
|
#
|
|
280
285
|
# @param customer_id [String]
|
|
281
286
|
#
|
|
282
287
|
# @param covering_date [Time] Optional RFC 3339 timestamp. If provided, the response will include only contrac
|
|
283
288
|
#
|
|
289
|
+
# @param cursor [String] Cursor from a previous response to fetch the next page of contracts.
|
|
290
|
+
#
|
|
284
291
|
# @param include_archived [Boolean] Include archived contracts in the response
|
|
285
292
|
#
|
|
286
293
|
# @param include_balance [Boolean] Include the balance of credits and commits in the response. Setting this flag ma
|
|
287
294
|
#
|
|
288
295
|
# @param include_ledgers [Boolean] Include commit ledgers in the response. Setting this flag may cause the query to
|
|
289
296
|
#
|
|
297
|
+
# @param limit [Integer] Max number of contracts to return per page. Range: 1-20. Default: 20.
|
|
298
|
+
#
|
|
290
299
|
# @param starting_at [Time] Optional RFC 3339 timestamp. If provided, the response will include only contrac
|
|
291
300
|
#
|
|
292
301
|
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
293
302
|
#
|
|
294
|
-
# @return [MetronomeSDK::Models::
|
|
303
|
+
# @return [MetronomeSDK::Internal::BodyCursorPageCursorField<MetronomeSDK::Models::Contract>]
|
|
295
304
|
#
|
|
296
305
|
# @see MetronomeSDK::Models::V1::ContractListParams
|
|
297
306
|
def list(params)
|
|
@@ -300,7 +309,8 @@ module MetronomeSDK
|
|
|
300
309
|
method: :post,
|
|
301
310
|
path: "v1/contracts/list",
|
|
302
311
|
body: parsed,
|
|
303
|
-
|
|
312
|
+
page: MetronomeSDK::Internal::BodyCursorPageCursorField,
|
|
313
|
+
model: MetronomeSDK::Contract,
|
|
304
314
|
options: options
|
|
305
315
|
)
|
|
306
316
|
end
|
|
@@ -328,7 +338,7 @@ module MetronomeSDK
|
|
|
328
338
|
# upstream of the commit, whether that is via contract editing, rate editing, or
|
|
329
339
|
# other actions that cause an invoice to be recalculated.
|
|
330
340
|
#
|
|
331
|
-
# @overload add_manual_balance_entry(id:, amount:, customer_id:, reason:, segment_id:, contract_id: nil, per_group_amounts: nil, timestamp: nil, request_options: {})
|
|
341
|
+
# @overload add_manual_balance_entry(id:, amount:, customer_id:, reason:, segment_id:, contract_id: nil, per_group_amounts: nil, timestamp: nil, uniqueness_key: nil, request_options: {})
|
|
332
342
|
#
|
|
333
343
|
# @param id [String] ID of the balance (commit or credit) to update.
|
|
334
344
|
#
|
|
@@ -346,6 +356,8 @@ module MetronomeSDK
|
|
|
346
356
|
#
|
|
347
357
|
# @param timestamp [Time] RFC 3339 timestamp indicating when the manual adjustment takes place. If not pro
|
|
348
358
|
#
|
|
359
|
+
# @param uniqueness_key [String] Prevents the creation of duplicates. If a request to create a record is made wit
|
|
360
|
+
#
|
|
349
361
|
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
350
362
|
#
|
|
351
363
|
# @return [nil]
|
|
@@ -365,8 +377,9 @@ module MetronomeSDK
|
|
|
365
377
|
# Amendments will be replaced by Contract editing. New clients should implement
|
|
366
378
|
# using the `editContract` endpoint. Read more about the migration to contract
|
|
367
379
|
# editing [here](/guides/implement-metronome/migrate-amendments-to-edits/) and
|
|
368
|
-
#
|
|
369
|
-
# editing is enabled, access to this endpoint will
|
|
380
|
+
# contact us via the [Metronome support portal](https://app.metronome.com/support)
|
|
381
|
+
# for more details. Once contract editing is enabled, access to this endpoint will
|
|
382
|
+
# be removed.
|
|
370
383
|
#
|
|
371
384
|
# @overload amend(contract_id:, customer_id:, starting_at:, commits: nil, credits: nil, custom_fields: nil, discounts: nil, netsuite_sales_order_id: nil, overrides: nil, professional_services: nil, reseller_royalties: nil, salesforce_opportunity_id: nil, scheduled_charges: nil, total_contract_value: nil, request_options: {})
|
|
372
385
|
#
|
|
@@ -542,10 +555,12 @@ module MetronomeSDK
|
|
|
542
555
|
# - **Credit types**: If `credit_type_id` is not specified, the balance defaults
|
|
543
556
|
# to USD (cents)
|
|
544
557
|
#
|
|
545
|
-
# @overload get_net_balance(customer_id:, credit_type_id: nil, filters: nil, invoice_inclusion_mode: nil, request_options: {})
|
|
558
|
+
# @overload get_net_balance(customer_id:, access_type: nil, credit_type_id: nil, filters: nil, invoice_inclusion_mode: nil, request_options: {})
|
|
546
559
|
#
|
|
547
560
|
# @param customer_id [String] The ID of the customer.
|
|
548
561
|
#
|
|
562
|
+
# @param access_type [Symbol, MetronomeSDK::Models::V1::ContractGetNetBalanceParams::AccessType] Filters balances by how they are drawn down. Defaults to `SPEND`. If set to `QUA
|
|
563
|
+
#
|
|
549
564
|
# @param credit_type_id [String] The ID of the credit type (can be fiat or a custom pricing unit) to get the bala
|
|
550
565
|
#
|
|
551
566
|
# @param filters [Array<MetronomeSDK::Models::BalanceFilter>] Balance filters are OR'd together, so if a given commit or credit matches any of
|
|
@@ -674,12 +689,14 @@ module MetronomeSDK
|
|
|
674
689
|
# segments
|
|
675
690
|
# - Manual adjustments: Includes all manual ledger entries, even future-dated ones
|
|
676
691
|
#
|
|
677
|
-
# @overload list_balances(customer_id:, id: nil, covering_date: nil, effective_before: nil, exclude_zero_balances: nil, include_archived: nil, include_balance: nil, include_contract_balances: nil, include_ledgers: nil, limit: nil, next_page: nil, starting_at: nil, request_options: {})
|
|
692
|
+
# @overload list_balances(customer_id:, id: nil, access_type: nil, covering_date: nil, effective_before: nil, exclude_zero_balances: nil, include_archived: nil, include_balance: nil, include_contract_balances: nil, include_ledgers: nil, limit: nil, next_page: nil, starting_at: nil, request_options: {})
|
|
678
693
|
#
|
|
679
694
|
# @param customer_id [String]
|
|
680
695
|
#
|
|
681
696
|
# @param id [String]
|
|
682
697
|
#
|
|
698
|
+
# @param access_type [Symbol, MetronomeSDK::Models::V1::ContractListBalancesParams::AccessType] Filters balances by how they are drawn down. `SPEND` deducts the dollar cost of
|
|
699
|
+
#
|
|
683
700
|
# @param covering_date [Time] Return only balances that have access schedules that "cover" the provided date
|
|
684
701
|
#
|
|
685
702
|
# @param effective_before [Time] Include only balances that have any access before the provided date (exclusive)
|
|
@@ -145,6 +145,9 @@ module MetronomeSDK
|
|
|
145
145
|
# transactional—either all values are set or none are. Custom field values are
|
|
146
146
|
# limited to 200 characters each.
|
|
147
147
|
#
|
|
148
|
+
# Adding or updating custom fields on credits, commits, or contracts does not emit
|
|
149
|
+
# `credit.edit`, `commit.edit`, or `contract.edit` events.
|
|
150
|
+
#
|
|
148
151
|
# @overload set_values(custom_fields:, entity:, entity_id:, request_options: {})
|
|
149
152
|
#
|
|
150
153
|
# @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
@@ -75,7 +75,7 @@ module MetronomeSDK
|
|
|
75
75
|
#
|
|
76
76
|
# @param customer_id [String] The Metronome ID of the customer
|
|
77
77
|
#
|
|
78
|
-
# @param alert_specifiers [Array<MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::AlertSpecifier>] Can be used with
|
|
78
|
+
# @param alert_specifiers [Array<MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::AlertSpecifier>] Can be used only with `low_remaining_contract_credit_and_commit_balance_reached`
|
|
79
79
|
#
|
|
80
80
|
# @param group_values [Array<MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::GroupValue>] Only present for `spend_threshold_reached` notifications. Retrieve the notificat
|
|
81
81
|
#
|
|
@@ -9,6 +9,9 @@ module MetronomeSDK
|
|
|
9
9
|
# Some parameter documentations has been truncated, see
|
|
10
10
|
# {MetronomeSDK::Models::V1::Customers::CommitCreateParams} for more details.
|
|
11
11
|
#
|
|
12
|
+
# ⚠️ For most contract amendments, use `contracts/edit` directly. Use this
|
|
13
|
+
# endpoint only for cross-contract or enterprise-wide commits.
|
|
14
|
+
#
|
|
12
15
|
# Creates customer-level commits that establish spending commitments for customers
|
|
13
16
|
# across their Metronome usage. Commits represent contracted spending obligations
|
|
14
17
|
# that can be either prepaid (paid upfront) or postpaid (billed later).
|
|
@@ -174,10 +177,12 @@ module MetronomeSDK
|
|
|
174
177
|
# - include_balance: Adds current balance calculation (slower)
|
|
175
178
|
# - Optional filtering: Use commit_id to retrieve a specific commit
|
|
176
179
|
#
|
|
177
|
-
# @overload list(customer_id:, commit_id: nil, covering_date: nil, effective_before: nil, include_archived: nil, include_balance: nil, include_contract_commits: nil, include_ledgers: nil, limit: nil, next_page: nil, starting_at: nil, request_options: {})
|
|
180
|
+
# @overload list(customer_id:, access_type: nil, commit_id: nil, covering_date: nil, effective_before: nil, include_archived: nil, include_balance: nil, include_contract_commits: nil, include_ledgers: nil, limit: nil, next_page: nil, starting_at: nil, request_options: {})
|
|
178
181
|
#
|
|
179
182
|
# @param customer_id [String]
|
|
180
183
|
#
|
|
184
|
+
# @param access_type [Symbol, MetronomeSDK::Models::V1::Customers::CommitListParams::AccessType] Filters commits by how their balances are drawn down. `SPEND` deducts the dollar
|
|
185
|
+
#
|
|
181
186
|
# @param commit_id [String]
|
|
182
187
|
#
|
|
183
188
|
# @param covering_date [Time] Include only commits that have access schedules that "cover" the provided date
|
|
@@ -9,6 +9,9 @@ module MetronomeSDK
|
|
|
9
9
|
# Some parameter documentations has been truncated, see
|
|
10
10
|
# {MetronomeSDK::Models::V1::Customers::CreditCreateParams} for more details.
|
|
11
11
|
#
|
|
12
|
+
# ⚠️ For most contract amendments, use `contracts/edit` directly. Use this
|
|
13
|
+
# endpoint only for cross-contract or enterprise-wide commits.
|
|
14
|
+
#
|
|
12
15
|
# Creates customer-level credits that provide spending allowances or free credit
|
|
13
16
|
# balances for customers across their Metronome usage. Note: In most cases, you
|
|
14
17
|
# should add credits directly to customer contracts using the contract/create or
|
|
@@ -136,7 +136,7 @@ module MetronomeSDK
|
|
|
136
136
|
# - Voided invoices are included in results by default unless filtered out by
|
|
137
137
|
# status
|
|
138
138
|
#
|
|
139
|
-
# @overload list(customer_id:, contract_id: nil, credit_type_id: nil, ending_before: nil, limit: nil, next_page: nil, skip_zero_qty_line_items: nil, sort: nil, starting_on: nil, status: nil, type: nil, webhook_notification_id: nil, request_options: {})
|
|
139
|
+
# @overload list(customer_id:, contract_id: nil, credit_type_id: nil, ending_before: nil, include_historical_commit_invoices: nil, limit: nil, next_page: nil, skip_zero_qty_line_items: nil, sort: nil, starting_on: nil, status: nil, type: nil, webhook_notification_id: nil, request_options: {})
|
|
140
140
|
#
|
|
141
141
|
# @param customer_id [String] Path param
|
|
142
142
|
#
|
|
@@ -146,6 +146,8 @@ module MetronomeSDK
|
|
|
146
146
|
#
|
|
147
147
|
# @param ending_before [Time] Query param: RFC 3339 timestamp (exclusive). Invoices will only be returned for
|
|
148
148
|
#
|
|
149
|
+
# @param include_historical_commit_invoices [Boolean] Query param: When true, includes historical commit invoices alongside active inv
|
|
150
|
+
#
|
|
149
151
|
# @param limit [Integer] Query param: Max number of results that should be returned
|
|
150
152
|
#
|
|
151
153
|
# @param next_page [String] Query param: Cursor that indicates where the next page of results should start.
|
|
@@ -6,6 +6,29 @@ module MetronomeSDK
|
|
|
6
6
|
# Use these endpoints to configure a billing API key, a webhook secret, or invoice
|
|
7
7
|
# finalization behavior.
|
|
8
8
|
class PricingUnits
|
|
9
|
+
# Create a custom pricing unit. Custom pricing units can be used to charge for
|
|
10
|
+
# usage in a non-fiat pricing unit, for example AI credits.
|
|
11
|
+
#
|
|
12
|
+
# @overload create(name:, request_options: {})
|
|
13
|
+
#
|
|
14
|
+
# @param name [String] The name of the custom pricing unit. This will appear on invoices.
|
|
15
|
+
#
|
|
16
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
17
|
+
#
|
|
18
|
+
# @return [MetronomeSDK::Models::V1::PricingUnitCreateResponse]
|
|
19
|
+
#
|
|
20
|
+
# @see MetronomeSDK::Models::V1::PricingUnitCreateParams
|
|
21
|
+
def create(params)
|
|
22
|
+
parsed, options = MetronomeSDK::V1::PricingUnitCreateParams.dump_request(params)
|
|
23
|
+
@client.request(
|
|
24
|
+
method: :post,
|
|
25
|
+
path: "v1/credit-types/create",
|
|
26
|
+
body: parsed,
|
|
27
|
+
model: MetronomeSDK::Models::V1::PricingUnitCreateResponse,
|
|
28
|
+
options: options
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
|
|
9
32
|
# List all pricing units. All fiat currency types (for example, USD or GBP) will
|
|
10
33
|
# be included, as well as any custom pricing units that were configured. Custom
|
|
11
34
|
# pricing units can be used to charge for usage in a non-fiat pricing unit, for
|
|
@@ -37,6 +60,28 @@ module MetronomeSDK
|
|
|
37
60
|
)
|
|
38
61
|
end
|
|
39
62
|
|
|
63
|
+
# Archive a custom pricing unit. Once archived, it will no longer appear in
|
|
64
|
+
# pricing unit selectors by default.
|
|
65
|
+
#
|
|
66
|
+
# @overload archive(id:, request_options: {})
|
|
67
|
+
#
|
|
68
|
+
# @param id [String]
|
|
69
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
70
|
+
#
|
|
71
|
+
# @return [MetronomeSDK::Models::V1::PricingUnitArchiveResponse]
|
|
72
|
+
#
|
|
73
|
+
# @see MetronomeSDK::Models::V1::PricingUnitArchiveParams
|
|
74
|
+
def archive(params)
|
|
75
|
+
parsed, options = MetronomeSDK::V1::PricingUnitArchiveParams.dump_request(params)
|
|
76
|
+
@client.request(
|
|
77
|
+
method: :post,
|
|
78
|
+
path: "v1/credit-types/archive",
|
|
79
|
+
body: parsed,
|
|
80
|
+
model: MetronomeSDK::Models::V1::PricingUnitArchiveResponse,
|
|
81
|
+
options: options
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
|
|
40
85
|
# @api private
|
|
41
86
|
#
|
|
42
87
|
# @param client [MetronomeSDK::Client]
|
|
@@ -46,9 +46,9 @@ module MetronomeSDK
|
|
|
46
46
|
#
|
|
47
47
|
# @overload list(ending_before:, starting_on:, window_size:, next_page: nil, billable_metrics: nil, customer_ids: nil, request_options: {})
|
|
48
48
|
#
|
|
49
|
-
# @param ending_before [Time] Body param
|
|
49
|
+
# @param ending_before [Time] Body param: Must be aligned to UTC midnight and at least one day after `starting
|
|
50
50
|
#
|
|
51
|
-
# @param starting_on [Time] Body param
|
|
51
|
+
# @param starting_on [Time] Body param: Must be aligned to UTC midnight, e.g. `2024-01-01T00:00:00Z`.
|
|
52
52
|
#
|
|
53
53
|
# @param window_size [Symbol, MetronomeSDK::Models::V1::UsageListParams::WindowSize] Body param: A window_size of "day" or "hour" will return the usage for the speci
|
|
54
54
|
#
|
|
@@ -216,9 +216,9 @@ module MetronomeSDK
|
|
|
216
216
|
#
|
|
217
217
|
# Important: For compound group keys, you must pass the complete set of keys that
|
|
218
218
|
# make up the compound key. Partial key combinations are not supported. For
|
|
219
|
-
# example, if your billable metric has a compound group key
|
|
220
|
-
# environment]
|
|
221
|
-
# `[region]` or `[region, team]`.
|
|
219
|
+
# example, if your billable metric has a compound group key
|
|
220
|
+
# `[region, team, environment]`, you must pass all three keys in group_key—you
|
|
221
|
+
# cannot pass just `[region]` or `[region, team]`.
|
|
222
222
|
#
|
|
223
223
|
# ### Key response fields:
|
|
224
224
|
#
|
|
@@ -240,9 +240,11 @@ module MetronomeSDK
|
|
|
240
240
|
# - Time windows: Set `window_size` to hour, day, or none for different
|
|
241
241
|
# granularities
|
|
242
242
|
# - Group filtering: Use `group_key` and `group_filters` to specify groups and
|
|
243
|
-
# group filters
|
|
244
|
-
#
|
|
245
|
-
#
|
|
243
|
+
# group filters. Across all arrays in `group_filters`, include at most 200
|
|
244
|
+
# filter values total. Requests with more than 200 filter values are rejected
|
|
245
|
+
# when this limit is enforced
|
|
246
|
+
# - Response limit: When using compound group keys (2+ keys in `group_key`), the
|
|
247
|
+
# default and maximum page size is 100
|
|
246
248
|
# - Pagination: Use limit and `next_page` for large result sets
|
|
247
249
|
# - Null handling: Group values may be null for events missing the group key
|
|
248
250
|
# property
|
|
@@ -261,7 +263,7 @@ module MetronomeSDK
|
|
|
261
263
|
#
|
|
262
264
|
# @param current_period [Boolean] Body param: If true, will return the usage for the current billing period. Will
|
|
263
265
|
#
|
|
264
|
-
# @param ending_before [Time] Body param
|
|
266
|
+
# @param ending_before [Time] Body param: Must be aligned to UTC midnight and at least one day after `starting
|
|
265
267
|
#
|
|
266
268
|
# @param group_by [MetronomeSDK::Models::V1::UsageListWithGroupsParams::GroupBy] Body param: Use group_key and group_filters instead. Use a single group key to g
|
|
267
269
|
#
|
|
@@ -269,7 +271,7 @@ module MetronomeSDK
|
|
|
269
271
|
#
|
|
270
272
|
# @param group_key [Array<String>] Body param: Group key to group usage by. Supports both simple (single key) and c
|
|
271
273
|
#
|
|
272
|
-
# @param starting_on [Time] Body param
|
|
274
|
+
# @param starting_on [Time] Body param: Must be aligned to UTC midnight, e.g. `2024-01-01T00:00:00Z`.
|
|
273
275
|
#
|
|
274
276
|
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
275
277
|
#
|
|
@@ -56,7 +56,7 @@ module MetronomeSDK
|
|
|
56
56
|
# Some parameter documentations has been truncated, see
|
|
57
57
|
# {MetronomeSDK::Models::V2::ContractListParams} for more details.
|
|
58
58
|
#
|
|
59
|
-
# For a given customer, lists
|
|
59
|
+
# For a given customer, lists a page of their contracts in chronological order.
|
|
60
60
|
#
|
|
61
61
|
# ### Use this endpoint to:
|
|
62
62
|
#
|
|
@@ -72,23 +72,31 @@ module MetronomeSDK
|
|
|
72
72
|
# filter the list of returned contracts. For example, to list only currently
|
|
73
73
|
# active contracts, pass `covering_date` equal to the current time.
|
|
74
74
|
#
|
|
75
|
-
#
|
|
75
|
+
# Results are limited to 20 contracts per page. When the response includes a
|
|
76
|
+
# non-null `cursor`, pass it back as the `cursor` parameter to fetch the next
|
|
77
|
+
# page.
|
|
78
|
+
#
|
|
79
|
+
# @overload list(customer_id:, covering_date: nil, cursor: nil, include_archived: nil, include_balance: nil, include_ledgers: nil, limit: nil, starting_at: nil, request_options: {})
|
|
76
80
|
#
|
|
77
81
|
# @param customer_id [String]
|
|
78
82
|
#
|
|
79
83
|
# @param covering_date [Time] Optional RFC 3339 timestamp. Only include contracts active on the provided date.
|
|
80
84
|
#
|
|
85
|
+
# @param cursor [String] Cursor from a previous response to fetch the next page of contracts.
|
|
86
|
+
#
|
|
81
87
|
# @param include_archived [Boolean] Include archived contracts in the response.
|
|
82
88
|
#
|
|
83
89
|
# @param include_balance [Boolean] Include the balance of credits and commits in the response. Setting this flag ma
|
|
84
90
|
#
|
|
85
91
|
# @param include_ledgers [Boolean] Include commit/credit ledgers in the response. Setting this flag may cause the r
|
|
86
92
|
#
|
|
93
|
+
# @param limit [Float] Max number of contracts to return per page. Range: 1-20. Default: 20.
|
|
94
|
+
#
|
|
87
95
|
# @param starting_at [Time] Optional RFC 3339 timestamp. Only include contracts that started on or after thi
|
|
88
96
|
#
|
|
89
97
|
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
90
98
|
#
|
|
91
|
-
# @return [MetronomeSDK::Models::
|
|
99
|
+
# @return [MetronomeSDK::Internal::BodyCursorPageCursorField<MetronomeSDK::Models::ContractV2>]
|
|
92
100
|
#
|
|
93
101
|
# @see MetronomeSDK::Models::V2::ContractListParams
|
|
94
102
|
def list(params)
|
|
@@ -97,7 +105,8 @@ module MetronomeSDK
|
|
|
97
105
|
method: :post,
|
|
98
106
|
path: "v2/contracts/list",
|
|
99
107
|
body: parsed,
|
|
100
|
-
|
|
108
|
+
page: MetronomeSDK::Internal::BodyCursorPageCursorField,
|
|
109
|
+
model: MetronomeSDK::ContractV2,
|
|
101
110
|
options: options
|
|
102
111
|
)
|
|
103
112
|
end
|
|
@@ -125,8 +134,8 @@ module MetronomeSDK
|
|
|
125
134
|
# - When you edit a contract, any draft invoices update immediately to reflect
|
|
126
135
|
# that edit. Finalized invoices remain unchanged - you must void and regenerate
|
|
127
136
|
# them in the UI or API to reflect the edit.
|
|
128
|
-
# - Contract editing must be enabled to use this endpoint.
|
|
129
|
-
# Metronome
|
|
137
|
+
# - Contract editing must be enabled to use this endpoint. Contact us via the
|
|
138
|
+
# [Metronome support portal](https://app.metronome.com/support) to learn more.
|
|
130
139
|
#
|
|
131
140
|
# @overload edit(contract_id:, customer_id:, add_billing_provider_configuration_update: nil, add_commits: nil, add_credits: nil, add_discounts: nil, add_overrides: nil, add_prepaid_balance_threshold_configuration: nil, add_professional_services: nil, add_recurring_commits: nil, add_recurring_credits: nil, add_reseller_royalties: nil, add_revenue_system_configuration_update: nil, add_scheduled_charges: nil, add_spend_threshold_configuration: nil, add_spend_trackers: nil, add_subscriptions: nil, allow_contract_ending_before_finalized_invoice: nil, archive_commits: nil, archive_credits: nil, archive_scheduled_charges: nil, archive_spend_trackers: nil, remove_overrides: nil, uniqueness_key: nil, update_commits: nil, update_contract_end_date: nil, update_contract_name: nil, update_credits: nil, update_net_payment_terms_days: nil, update_prepaid_balance_threshold_configuration: nil, update_recurring_commits: nil, update_recurring_credits: nil, update_scheduled_charges: nil, update_spend_threshold_configuration: nil, update_subscriptions: nil, request_options: {})
|
|
132
141
|
#
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Resources
|
|
5
|
+
class V2
|
|
6
|
+
class Notifications
|
|
7
|
+
class Offset
|
|
8
|
+
# Some parameter documentations has been truncated, see
|
|
9
|
+
# {MetronomeSDK::Models::V2::Notifications::OffsetCreateParams} for more details.
|
|
10
|
+
#
|
|
11
|
+
# Create an offset lifecycle event notification configuration. The lifecycle event
|
|
12
|
+
# type is inferred from the policy.type field.
|
|
13
|
+
#
|
|
14
|
+
# @overload create(name:, policy:, uniqueness_key: nil, request_options: {})
|
|
15
|
+
#
|
|
16
|
+
# @param name [String] The name for this offset notification configuration.
|
|
17
|
+
#
|
|
18
|
+
# @param policy [MetronomeSDK::Models::V2::Notifications::OffsetCreateParams::Policy] The offset lifecycle event policy that defines when and how this notification sh
|
|
19
|
+
#
|
|
20
|
+
# @param uniqueness_key [String] Optional uniqueness key to prevent duplicate notification configurations.
|
|
21
|
+
#
|
|
22
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
23
|
+
#
|
|
24
|
+
# @return [MetronomeSDK::Models::V2::Notifications::OffsetCreateResponse]
|
|
25
|
+
#
|
|
26
|
+
# @see MetronomeSDK::Models::V2::Notifications::OffsetCreateParams
|
|
27
|
+
def create(params)
|
|
28
|
+
parsed, options = MetronomeSDK::V2::Notifications::OffsetCreateParams.dump_request(params)
|
|
29
|
+
@client.request(
|
|
30
|
+
method: :post,
|
|
31
|
+
path: "v2/notifications/create",
|
|
32
|
+
body: parsed,
|
|
33
|
+
model: MetronomeSDK::Models::V2::Notifications::OffsetCreateResponse,
|
|
34
|
+
options: options
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Retrieve a specific offset lifecycle event notification configuration by ID.
|
|
39
|
+
#
|
|
40
|
+
# @overload retrieve(id:, request_options: {})
|
|
41
|
+
#
|
|
42
|
+
# @param id [String] The ID of the notification configuration to retrieve
|
|
43
|
+
#
|
|
44
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
45
|
+
#
|
|
46
|
+
# @return [MetronomeSDK::Models::V2::Notifications::OffsetRetrieveResponse]
|
|
47
|
+
#
|
|
48
|
+
# @see MetronomeSDK::Models::V2::Notifications::OffsetRetrieveParams
|
|
49
|
+
def retrieve(params)
|
|
50
|
+
parsed, options = MetronomeSDK::V2::Notifications::OffsetRetrieveParams.dump_request(params)
|
|
51
|
+
@client.request(
|
|
52
|
+
method: :post,
|
|
53
|
+
path: "v2/notifications/get",
|
|
54
|
+
body: parsed,
|
|
55
|
+
model: MetronomeSDK::Models::V2::Notifications::OffsetRetrieveResponse,
|
|
56
|
+
options: options
|
|
57
|
+
)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Some parameter documentations has been truncated, see
|
|
61
|
+
# {MetronomeSDK::Models::V2::Notifications::OffsetListParams} for more details.
|
|
62
|
+
#
|
|
63
|
+
# List offset lifecycle event notification configurations. These are user-created
|
|
64
|
+
# notifications that trigger at a specified time offset relative to lifecycle
|
|
65
|
+
# events. Returns a maximum of 400 results per request.
|
|
66
|
+
#
|
|
67
|
+
# @overload list(archive_filter: nil, cursor: nil, limit: nil, request_options: {})
|
|
68
|
+
#
|
|
69
|
+
# @param archive_filter [Symbol, MetronomeSDK::Models::V2::Notifications::OffsetListParams::ArchiveFilter] Filter options for the notification configurations. If not provided, defaults to
|
|
70
|
+
#
|
|
71
|
+
# @param cursor [String]
|
|
72
|
+
#
|
|
73
|
+
# @param limit [Float]
|
|
74
|
+
#
|
|
75
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
76
|
+
#
|
|
77
|
+
# @return [MetronomeSDK::Internal::BodyCursorPageCursorField<MetronomeSDK::Models::V2::LifecycleEventOffsetNotificationConfig>]
|
|
78
|
+
#
|
|
79
|
+
# @see MetronomeSDK::Models::V2::Notifications::OffsetListParams
|
|
80
|
+
def list(params = {})
|
|
81
|
+
parsed, options = MetronomeSDK::V2::Notifications::OffsetListParams.dump_request(params)
|
|
82
|
+
@client.request(
|
|
83
|
+
method: :post,
|
|
84
|
+
path: "v2/notifications/offset/list",
|
|
85
|
+
body: parsed,
|
|
86
|
+
page: MetronomeSDK::Internal::BodyCursorPageCursorField,
|
|
87
|
+
model: MetronomeSDK::V2::LifecycleEventOffsetNotificationConfig,
|
|
88
|
+
options: options
|
|
89
|
+
)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Some parameter documentations has been truncated, see
|
|
93
|
+
# {MetronomeSDK::Models::V2::Notifications::OffsetArchiveParams} for more details.
|
|
94
|
+
#
|
|
95
|
+
# Archive an offset lifecycle event notification configuration. Archived
|
|
96
|
+
# notifications are not processed.
|
|
97
|
+
#
|
|
98
|
+
# @overload archive(id:, request_options: {})
|
|
99
|
+
#
|
|
100
|
+
# @param id [String] The ID of the offset lifecycle event notification configuration to archive.
|
|
101
|
+
#
|
|
102
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
103
|
+
#
|
|
104
|
+
# @return [MetronomeSDK::Models::V2::Notifications::OffsetArchiveResponse]
|
|
105
|
+
#
|
|
106
|
+
# @see MetronomeSDK::Models::V2::Notifications::OffsetArchiveParams
|
|
107
|
+
def archive(params)
|
|
108
|
+
parsed, options = MetronomeSDK::V2::Notifications::OffsetArchiveParams.dump_request(params)
|
|
109
|
+
@client.request(
|
|
110
|
+
method: :post,
|
|
111
|
+
path: "v2/notifications/archive",
|
|
112
|
+
body: parsed,
|
|
113
|
+
model: MetronomeSDK::Models::V2::Notifications::OffsetArchiveResponse,
|
|
114
|
+
options: options
|
|
115
|
+
)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Some parameter documentations has been truncated, see
|
|
119
|
+
# {MetronomeSDK::Models::V2::Notifications::OffsetEditParams} for more details.
|
|
120
|
+
#
|
|
121
|
+
# Edit an existing offset notification, or enable/disable a system notification
|
|
122
|
+
#
|
|
123
|
+
# @overload edit(policy:, id: nil, is_enabled: nil, request_options: {})
|
|
124
|
+
#
|
|
125
|
+
# @param policy [MetronomeSDK::Models::V2::Notifications::OffsetEditParams::Policy::LifecycleEventOffsetPolicy, MetronomeSDK::Models::V2::Notifications::OffsetEditParams::Policy::LifecycleEventSystemPolicy] Updated policy configuration. The policy.type must match the existing lifecycle
|
|
126
|
+
#
|
|
127
|
+
# @param id [String] The ID of the notification configuration to edit. Not provided when updating the
|
|
128
|
+
#
|
|
129
|
+
# @param is_enabled [Boolean] Set to true to enable webhook messages for the notification indicated in the pol
|
|
130
|
+
#
|
|
131
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
132
|
+
#
|
|
133
|
+
# @return [MetronomeSDK::Models::V2::Notifications::OffsetEditResponse]
|
|
134
|
+
#
|
|
135
|
+
# @see MetronomeSDK::Models::V2::Notifications::OffsetEditParams
|
|
136
|
+
def edit(params)
|
|
137
|
+
parsed, options = MetronomeSDK::V2::Notifications::OffsetEditParams.dump_request(params)
|
|
138
|
+
@client.request(
|
|
139
|
+
method: :post,
|
|
140
|
+
path: "v2/notifications/edit",
|
|
141
|
+
body: parsed,
|
|
142
|
+
model: MetronomeSDK::Models::V2::Notifications::OffsetEditResponse,
|
|
143
|
+
options: options
|
|
144
|
+
)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# @api private
|
|
148
|
+
#
|
|
149
|
+
# @param client [MetronomeSDK::Client]
|
|
150
|
+
def initialize(client:)
|
|
151
|
+
@client = client
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Resources
|
|
5
|
+
class V2
|
|
6
|
+
class Notifications
|
|
7
|
+
class System
|
|
8
|
+
# List available system notification types. You can enable these notifications
|
|
9
|
+
# directly or use supported types to create offset notifications.
|
|
10
|
+
#
|
|
11
|
+
# @overload list(request_options: {})
|
|
12
|
+
#
|
|
13
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
14
|
+
#
|
|
15
|
+
# @return [MetronomeSDK::Models::V2::Notifications::SystemListResponse]
|
|
16
|
+
#
|
|
17
|
+
# @see MetronomeSDK::Models::V2::Notifications::SystemListParams
|
|
18
|
+
def list(params = {})
|
|
19
|
+
@client.request(
|
|
20
|
+
method: :post,
|
|
21
|
+
path: "v2/notifications/system/list",
|
|
22
|
+
model: MetronomeSDK::Models::V2::Notifications::SystemListResponse,
|
|
23
|
+
options: params[:request_options]
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# @api private
|
|
28
|
+
#
|
|
29
|
+
# @param client [MetronomeSDK::Client]
|
|
30
|
+
def initialize(client:)
|
|
31
|
+
@client = client
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Resources
|
|
5
|
+
class V2
|
|
6
|
+
class Notifications
|
|
7
|
+
# @return [MetronomeSDK::Resources::V2::Notifications::Offset]
|
|
8
|
+
attr_reader :offset
|
|
9
|
+
|
|
10
|
+
# @return [MetronomeSDK::Resources::V2::Notifications::System]
|
|
11
|
+
attr_reader :system_
|
|
12
|
+
|
|
13
|
+
# @api private
|
|
14
|
+
#
|
|
15
|
+
# @param client [MetronomeSDK::Client]
|
|
16
|
+
def initialize(client:)
|
|
17
|
+
@client = client
|
|
18
|
+
@offset = MetronomeSDK::Resources::V2::Notifications::Offset.new(client: client)
|
|
19
|
+
@system_ = MetronomeSDK::Resources::V2::Notifications::System.new(client: client)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -6,12 +6,16 @@ module MetronomeSDK
|
|
|
6
6
|
# @return [MetronomeSDK::Resources::V2::Contracts]
|
|
7
7
|
attr_reader :contracts
|
|
8
8
|
|
|
9
|
+
# @return [MetronomeSDK::Resources::V2::Notifications]
|
|
10
|
+
attr_reader :notifications
|
|
11
|
+
|
|
9
12
|
# @api private
|
|
10
13
|
#
|
|
11
14
|
# @param client [MetronomeSDK::Client]
|
|
12
15
|
def initialize(client:)
|
|
13
16
|
@client = client
|
|
14
17
|
@contracts = MetronomeSDK::Resources::V2::Contracts.new(client: client)
|
|
18
|
+
@notifications = MetronomeSDK::Resources::V2::Notifications.new(client: client)
|
|
15
19
|
end
|
|
16
20
|
end
|
|
17
21
|
end
|