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
|
@@ -16,6 +16,7 @@ module MetronomeSDK
|
|
|
16
16
|
customer_id: String,
|
|
17
17
|
schedule_name: String,
|
|
18
18
|
covering_date: Time,
|
|
19
|
+
properties: T::Hash[Symbol, String],
|
|
19
20
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
20
21
|
).returns(
|
|
21
22
|
MetronomeSDK::Models::V1::Contracts::RateCards::NamedScheduleRetrieveResponse
|
|
@@ -31,6 +32,9 @@ module MetronomeSDK
|
|
|
31
32
|
# If provided, at most one schedule segment will be returned (the one that covers
|
|
32
33
|
# this date). If not provided, all segments will be returned.
|
|
33
34
|
covering_date: nil,
|
|
35
|
+
# A set of key-value pairs that qualifies which schedule should be applied when
|
|
36
|
+
# looking up a schedule by name.
|
|
37
|
+
properties: nil,
|
|
34
38
|
request_options: {}
|
|
35
39
|
)
|
|
36
40
|
end
|
|
@@ -45,6 +49,7 @@ module MetronomeSDK
|
|
|
45
49
|
starting_at: Time,
|
|
46
50
|
value: T.anything,
|
|
47
51
|
ending_before: Time,
|
|
52
|
+
properties: T::Hash[Symbol, String],
|
|
48
53
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
49
54
|
).void
|
|
50
55
|
end
|
|
@@ -60,6 +65,48 @@ module MetronomeSDK
|
|
|
60
65
|
# specific to the named schedule.
|
|
61
66
|
value:,
|
|
62
67
|
ending_before: nil,
|
|
68
|
+
# A set of key-value pairs that qualifies which schedule should be applied when
|
|
69
|
+
# looking up a schedule by name.
|
|
70
|
+
properties: nil,
|
|
71
|
+
request_options: {}
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# List contract-level named schedules for a customer, optionally scoped to a
|
|
76
|
+
# single contract.
|
|
77
|
+
sig do
|
|
78
|
+
params(
|
|
79
|
+
customer_id: String,
|
|
80
|
+
contract_id: String,
|
|
81
|
+
covering_date: Time,
|
|
82
|
+
limit: Integer,
|
|
83
|
+
next_page: String,
|
|
84
|
+
properties: T::Hash[Symbol, String],
|
|
85
|
+
schedule_name: String,
|
|
86
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
87
|
+
).returns(
|
|
88
|
+
MetronomeSDK::Internal::BodyCursorPage[
|
|
89
|
+
MetronomeSDK::Models::V1::Contracts::RateCards::NamedScheduleListResponse
|
|
90
|
+
]
|
|
91
|
+
)
|
|
92
|
+
end
|
|
93
|
+
def list(
|
|
94
|
+
# ID of the customer to list contract named schedules for
|
|
95
|
+
customer_id:,
|
|
96
|
+
# Optional ID of a contract to scope the results to a single contract
|
|
97
|
+
contract_id: nil,
|
|
98
|
+
# If provided, result contains at most one segment covering this date for each
|
|
99
|
+
# schedule.
|
|
100
|
+
covering_date: nil,
|
|
101
|
+
# Maximum number of named schedules to return.
|
|
102
|
+
limit: nil,
|
|
103
|
+
# Cursor for pagination. Use the value from a previous response's next_page.
|
|
104
|
+
next_page: nil,
|
|
105
|
+
# Optional key-value filters. A schedule matches when it contains at least this
|
|
106
|
+
# subset of properties.
|
|
107
|
+
properties: nil,
|
|
108
|
+
# Optional filter to scope the results to a single schedule name
|
|
109
|
+
schedule_name: nil,
|
|
63
110
|
request_options: {}
|
|
64
111
|
)
|
|
65
112
|
end
|
|
@@ -319,23 +319,34 @@ module MetronomeSDK
|
|
|
319
319
|
)
|
|
320
320
|
end
|
|
321
321
|
|
|
322
|
-
# Retrieves
|
|
322
|
+
# Retrieves a page of contracts for a specific customer, including pricing, terms,
|
|
323
323
|
# credits, and commitments. Use this to view a customer's contract history and
|
|
324
324
|
# current agreements for billing management. Returns contract details with
|
|
325
325
|
# optional ledgers and balance information.
|
|
326
326
|
#
|
|
327
|
+
# ### Usage guidelines:
|
|
328
|
+
#
|
|
329
|
+
# - Pagination: Results are limited to 20 contracts per page; use 'cursor' for
|
|
330
|
+
# more
|
|
331
|
+
#
|
|
327
332
|
# ⚠️ Note: This is the legacy v1 endpoint - new integrations should use the v2
|
|
328
333
|
# endpoint for enhanced features.
|
|
329
334
|
sig do
|
|
330
335
|
params(
|
|
331
336
|
customer_id: String,
|
|
332
337
|
covering_date: Time,
|
|
338
|
+
cursor: String,
|
|
333
339
|
include_archived: T::Boolean,
|
|
334
340
|
include_balance: T::Boolean,
|
|
335
341
|
include_ledgers: T::Boolean,
|
|
342
|
+
limit: Integer,
|
|
336
343
|
starting_at: Time,
|
|
337
344
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
338
|
-
).returns(
|
|
345
|
+
).returns(
|
|
346
|
+
MetronomeSDK::Internal::BodyCursorPageCursorField[
|
|
347
|
+
MetronomeSDK::Contract
|
|
348
|
+
]
|
|
349
|
+
)
|
|
339
350
|
end
|
|
340
351
|
def list(
|
|
341
352
|
customer_id:,
|
|
@@ -343,6 +354,8 @@ module MetronomeSDK
|
|
|
343
354
|
# contracts effective on the provided date. This cannot be provided if the
|
|
344
355
|
# starting_at filter is provided.
|
|
345
356
|
covering_date: nil,
|
|
357
|
+
# Cursor from a previous response to fetch the next page of contracts.
|
|
358
|
+
cursor: nil,
|
|
346
359
|
# Include archived contracts in the response
|
|
347
360
|
include_archived: nil,
|
|
348
361
|
# Include the balance of credits and commits in the response. Setting this flag
|
|
@@ -351,8 +364,10 @@ module MetronomeSDK
|
|
|
351
364
|
# Include commit ledgers in the response. Setting this flag may cause the query to
|
|
352
365
|
# be slower.
|
|
353
366
|
include_ledgers: nil,
|
|
367
|
+
# Max number of contracts to return per page. Range: 1-20. Default: 20.
|
|
368
|
+
limit: nil,
|
|
354
369
|
# Optional RFC 3339 timestamp. If provided, the response will include only
|
|
355
|
-
# contracts where
|
|
370
|
+
# contracts where starting_at is on or after the provided date. This cannot be
|
|
356
371
|
# provided if the covering_date filter is provided.
|
|
357
372
|
starting_at: nil,
|
|
358
373
|
request_options: {}
|
|
@@ -387,6 +402,7 @@ module MetronomeSDK
|
|
|
387
402
|
contract_id: String,
|
|
388
403
|
per_group_amounts: T::Hash[Symbol, Float],
|
|
389
404
|
timestamp: Time,
|
|
405
|
+
uniqueness_key: String,
|
|
390
406
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
391
407
|
).void
|
|
392
408
|
end
|
|
@@ -409,6 +425,10 @@ module MetronomeSDK
|
|
|
409
425
|
# RFC 3339 timestamp indicating when the manual adjustment takes place. If not
|
|
410
426
|
# provided, it will default to the start of the segment.
|
|
411
427
|
timestamp: nil,
|
|
428
|
+
# Prevents the creation of duplicates. If a request to create a record is made
|
|
429
|
+
# with a previously used uniqueness key, a new record will not be created and the
|
|
430
|
+
# request will fail with a 409 error.
|
|
431
|
+
uniqueness_key: nil,
|
|
412
432
|
request_options: {}
|
|
413
433
|
)
|
|
414
434
|
end
|
|
@@ -416,8 +436,9 @@ module MetronomeSDK
|
|
|
416
436
|
# Amendments will be replaced by Contract editing. New clients should implement
|
|
417
437
|
# using the `editContract` endpoint. Read more about the migration to contract
|
|
418
438
|
# editing [here](/guides/implement-metronome/migrate-amendments-to-edits/) and
|
|
419
|
-
#
|
|
420
|
-
# editing is enabled, access to this endpoint will
|
|
439
|
+
# contact us via the [Metronome support portal](https://app.metronome.com/support)
|
|
440
|
+
# for more details. Once contract editing is enabled, access to this endpoint will
|
|
441
|
+
# be removed.
|
|
421
442
|
sig do
|
|
422
443
|
params(
|
|
423
444
|
contract_id: String,
|
|
@@ -592,6 +613,8 @@ module MetronomeSDK
|
|
|
592
613
|
sig do
|
|
593
614
|
params(
|
|
594
615
|
customer_id: String,
|
|
616
|
+
access_type:
|
|
617
|
+
MetronomeSDK::V1::ContractGetNetBalanceParams::AccessType::OrSymbol,
|
|
595
618
|
credit_type_id: String,
|
|
596
619
|
filters: T::Array[MetronomeSDK::BalanceFilter::OrHash],
|
|
597
620
|
invoice_inclusion_mode:
|
|
@@ -602,6 +625,9 @@ module MetronomeSDK
|
|
|
602
625
|
def get_net_balance(
|
|
603
626
|
# The ID of the customer.
|
|
604
627
|
customer_id:,
|
|
628
|
+
# Filters balances by how they are drawn down. Defaults to `SPEND`. If set to
|
|
629
|
+
# `QUANTITY`, `credit_type_id` must not be provided.
|
|
630
|
+
access_type: nil,
|
|
605
631
|
# The ID of the credit type (can be fiat or a custom pricing unit) to get the
|
|
606
632
|
# balance for. Defaults to USD (cents) if not specified.
|
|
607
633
|
credit_type_id: nil,
|
|
@@ -723,6 +749,8 @@ module MetronomeSDK
|
|
|
723
749
|
params(
|
|
724
750
|
customer_id: String,
|
|
725
751
|
id: String,
|
|
752
|
+
access_type:
|
|
753
|
+
MetronomeSDK::V1::ContractListBalancesParams::AccessType::OrSymbol,
|
|
726
754
|
covering_date: Time,
|
|
727
755
|
effective_before: Time,
|
|
728
756
|
exclude_zero_balances: T::Boolean,
|
|
@@ -743,6 +771,9 @@ module MetronomeSDK
|
|
|
743
771
|
def list_balances(
|
|
744
772
|
customer_id:,
|
|
745
773
|
id: nil,
|
|
774
|
+
# Filters balances by how they are drawn down. `SPEND` deducts the dollar cost of
|
|
775
|
+
# usage. `QUANTITY` deducts the number of units used.
|
|
776
|
+
access_type: nil,
|
|
746
777
|
# Return only balances that have access schedules that "cover" the provided date
|
|
747
778
|
covering_date: nil,
|
|
748
779
|
# Include only balances that have any access before the provided date (exclusive)
|
|
@@ -109,6 +109,9 @@ module MetronomeSDK
|
|
|
109
109
|
# existing values for matching keys while preserving other fields. All updates are
|
|
110
110
|
# transactional—either all values are set or none are. Custom field values are
|
|
111
111
|
# limited to 200 characters each.
|
|
112
|
+
#
|
|
113
|
+
# Adding or updating custom fields on credits, commits, or contracts does not emit
|
|
114
|
+
# `credit.edit`, `commit.edit`, or `contract.edit` events.
|
|
112
115
|
sig do
|
|
113
116
|
params(
|
|
114
117
|
custom_fields: T::Hash[Symbol, String],
|
|
@@ -91,8 +91,9 @@ module MetronomeSDK
|
|
|
91
91
|
alert_id:,
|
|
92
92
|
# The Metronome ID of the customer
|
|
93
93
|
customer_id:,
|
|
94
|
-
# Can be used with
|
|
95
|
-
#
|
|
94
|
+
# Can be used only with `low_remaining_contract_credit_and_commit_balance_reached`
|
|
95
|
+
# and `low_remaining_contract_credit_and_commit_percentage_reached` notifications.
|
|
96
|
+
# Used to filter the alert by the custom field key-value pair.
|
|
96
97
|
alert_specifiers: nil,
|
|
97
98
|
# Only present for `spend_threshold_reached` notifications. Retrieve the
|
|
98
99
|
# notification for a specific group key-value pair.
|
|
@@ -43,8 +43,7 @@ module MetronomeSDK
|
|
|
43
43
|
aws_product_code: nil,
|
|
44
44
|
# Body param
|
|
45
45
|
aws_region: nil,
|
|
46
|
-
# Body param: The collection method for the customer's invoices.
|
|
47
|
-
# `auto_charge_payment_intent` and `manually_charge_payment_intent` are in beta.
|
|
46
|
+
# Body param: The collection method for the customer's invoices.
|
|
48
47
|
stripe_collection_method: nil,
|
|
49
48
|
request_options: {}
|
|
50
49
|
)
|
|
@@ -6,6 +6,9 @@ module MetronomeSDK
|
|
|
6
6
|
class Customers
|
|
7
7
|
# Credits and commits are used to manage customer balances.
|
|
8
8
|
class Commits
|
|
9
|
+
# ⚠️ For most contract amendments, use `contracts/edit` directly. Use this
|
|
10
|
+
# endpoint only for cross-contract or enterprise-wide commits.
|
|
11
|
+
#
|
|
9
12
|
# Creates customer-level commits that establish spending commitments for customers
|
|
10
13
|
# across their Metronome usage. Commits represent contracted spending obligations
|
|
11
14
|
# that can be either prepaid (paid upfront) or postpaid (billed later).
|
|
@@ -199,6 +202,8 @@ module MetronomeSDK
|
|
|
199
202
|
sig do
|
|
200
203
|
params(
|
|
201
204
|
customer_id: String,
|
|
205
|
+
access_type:
|
|
206
|
+
MetronomeSDK::V1::Customers::CommitListParams::AccessType::OrSymbol,
|
|
202
207
|
commit_id: String,
|
|
203
208
|
covering_date: Time,
|
|
204
209
|
effective_before: Time,
|
|
@@ -216,6 +221,9 @@ module MetronomeSDK
|
|
|
216
221
|
end
|
|
217
222
|
def list(
|
|
218
223
|
customer_id:,
|
|
224
|
+
# Filters commits by how their balances are drawn down. `SPEND` deducts the dollar
|
|
225
|
+
# cost of usage. `QUANTITY` deducts the number of units used.
|
|
226
|
+
access_type: nil,
|
|
219
227
|
commit_id: nil,
|
|
220
228
|
# Include only commits that have access schedules that "cover" the provided date
|
|
221
229
|
covering_date: nil,
|
|
@@ -6,6 +6,9 @@ module MetronomeSDK
|
|
|
6
6
|
class Customers
|
|
7
7
|
# Credits and commits are used to manage customer balances.
|
|
8
8
|
class Credits
|
|
9
|
+
# ⚠️ For most contract amendments, use `contracts/edit` directly. Use this
|
|
10
|
+
# endpoint only for cross-contract or enterprise-wide commits.
|
|
11
|
+
#
|
|
9
12
|
# Creates customer-level credits that provide spending allowances or free credit
|
|
10
13
|
# balances for customers across their Metronome usage. Note: In most cases, you
|
|
11
14
|
# should add credits directly to customer contracts using the contract/create or
|
|
@@ -123,6 +123,7 @@ module MetronomeSDK
|
|
|
123
123
|
contract_id: String,
|
|
124
124
|
credit_type_id: String,
|
|
125
125
|
ending_before: Time,
|
|
126
|
+
include_historical_commit_invoices: T::Boolean,
|
|
126
127
|
limit: Integer,
|
|
127
128
|
next_page: String,
|
|
128
129
|
skip_zero_qty_line_items: T::Boolean,
|
|
@@ -150,6 +151,9 @@ module MetronomeSDK
|
|
|
150
151
|
# Query param: RFC 3339 timestamp (exclusive). Invoices will only be returned for
|
|
151
152
|
# billing periods that end before this time.
|
|
152
153
|
ending_before: nil,
|
|
154
|
+
# Query param: When true, includes historical commit invoices alongside active
|
|
155
|
+
# invoices. Defaults to false.
|
|
156
|
+
include_historical_commit_invoices: nil,
|
|
153
157
|
# Query param: Max number of results that should be returned
|
|
154
158
|
limit: nil,
|
|
155
159
|
# Query param: Cursor that indicates where the next page of results should start.
|
|
@@ -6,6 +6,21 @@ 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
|
+
sig do
|
|
12
|
+
params(
|
|
13
|
+
name: String,
|
|
14
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
15
|
+
).returns(MetronomeSDK::Models::V1::PricingUnitCreateResponse)
|
|
16
|
+
end
|
|
17
|
+
def create(
|
|
18
|
+
# The name of the custom pricing unit. This will appear on invoices.
|
|
19
|
+
name:,
|
|
20
|
+
request_options: {}
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
9
24
|
# List all pricing units. All fiat currency types (for example, USD or GBP) will
|
|
10
25
|
# be included, as well as any custom pricing units that were configured. Custom
|
|
11
26
|
# pricing units can be used to charge for usage in a non-fiat pricing unit, for
|
|
@@ -32,6 +47,17 @@ module MetronomeSDK
|
|
|
32
47
|
)
|
|
33
48
|
end
|
|
34
49
|
|
|
50
|
+
# Archive a custom pricing unit. Once archived, it will no longer appear in
|
|
51
|
+
# pricing unit selectors by default.
|
|
52
|
+
sig do
|
|
53
|
+
params(
|
|
54
|
+
id: String,
|
|
55
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
56
|
+
).returns(MetronomeSDK::Models::V1::PricingUnitArchiveResponse)
|
|
57
|
+
end
|
|
58
|
+
def archive(id:, request_options: {})
|
|
59
|
+
end
|
|
60
|
+
|
|
35
61
|
# @api private
|
|
36
62
|
sig { params(client: MetronomeSDK::Client).returns(T.attached_class) }
|
|
37
63
|
def self.new(client:)
|
|
@@ -60,9 +60,10 @@ module MetronomeSDK
|
|
|
60
60
|
)
|
|
61
61
|
end
|
|
62
62
|
def list(
|
|
63
|
-
# Body param
|
|
63
|
+
# Body param: Must be aligned to UTC midnight and at least one day after
|
|
64
|
+
# `starting_on`.
|
|
64
65
|
ending_before:,
|
|
65
|
-
# Body param
|
|
66
|
+
# Body param: Must be aligned to UTC midnight, e.g. `2024-01-01T00:00:00Z`.
|
|
66
67
|
starting_on:,
|
|
67
68
|
# Body param: A window_size of "day" or "hour" will return the usage for the
|
|
68
69
|
# specified period segmented into daily or hourly aggregates. A window_size of
|
|
@@ -205,9 +206,9 @@ module MetronomeSDK
|
|
|
205
206
|
#
|
|
206
207
|
# Important: For compound group keys, you must pass the complete set of keys that
|
|
207
208
|
# make up the compound key. Partial key combinations are not supported. For
|
|
208
|
-
# example, if your billable metric has a compound group key
|
|
209
|
-
# environment]
|
|
210
|
-
# `[region]` or `[region, team]`.
|
|
209
|
+
# example, if your billable metric has a compound group key
|
|
210
|
+
# `[region, team, environment]`, you must pass all three keys in group_key—you
|
|
211
|
+
# cannot pass just `[region]` or `[region, team]`.
|
|
211
212
|
#
|
|
212
213
|
# ### Key response fields:
|
|
213
214
|
#
|
|
@@ -229,9 +230,11 @@ module MetronomeSDK
|
|
|
229
230
|
# - Time windows: Set `window_size` to hour, day, or none for different
|
|
230
231
|
# granularities
|
|
231
232
|
# - Group filtering: Use `group_key` and `group_filters` to specify groups and
|
|
232
|
-
# group filters
|
|
233
|
-
#
|
|
234
|
-
#
|
|
233
|
+
# group filters. Across all arrays in `group_filters`, include at most 200
|
|
234
|
+
# filter values total. Requests with more than 200 filter values are rejected
|
|
235
|
+
# when this limit is enforced
|
|
236
|
+
# - Response limit: When using compound group keys (2+ keys in `group_key`), the
|
|
237
|
+
# default and maximum page size is 100
|
|
235
238
|
# - Pagination: Use limit and `next_page` for large result sets
|
|
236
239
|
# - Null handling: Group values may be null for events missing the group key
|
|
237
240
|
# property
|
|
@@ -272,10 +275,11 @@ module MetronomeSDK
|
|
|
272
275
|
# Query param: Cursor that indicates where the next page of results should start.
|
|
273
276
|
next_page: nil,
|
|
274
277
|
# Body param: If true, will return the usage for the current billing period. Will
|
|
275
|
-
# return an error if the customer
|
|
276
|
-
# ending_before are specified when this is true.
|
|
278
|
+
# return an error if the customer does not have an active plan, or if starting_on
|
|
279
|
+
# and ending_before are specified when this is true.
|
|
277
280
|
current_period: nil,
|
|
278
|
-
# Body param
|
|
281
|
+
# Body param: Must be aligned to UTC midnight and at least one day after
|
|
282
|
+
# `starting_on`.
|
|
279
283
|
ending_before: nil,
|
|
280
284
|
# Body param: Use group_key and group_filters instead. Use a single group key to
|
|
281
285
|
# group by. Compound group keys are not supported.
|
|
@@ -283,7 +287,8 @@ module MetronomeSDK
|
|
|
283
287
|
# Body param: Object mapping group keys to arrays of values to filter on. Only
|
|
284
288
|
# usage matching these filter values will be returned. Keys must be present in
|
|
285
289
|
# group_key. Omit a key or use an empty array to include all values for that
|
|
286
|
-
# dimension.
|
|
290
|
+
# dimension. The combined number of entries across all value arrays may not
|
|
291
|
+
# exceed 200.
|
|
287
292
|
group_filters: nil,
|
|
288
293
|
# Body param: Group key to group usage by. Supports both simple (single key) and
|
|
289
294
|
# compound (multiple keys) group keys.
|
|
@@ -297,7 +302,7 @@ module MetronomeSDK
|
|
|
297
302
|
#
|
|
298
303
|
# Cannot be used together with `group_by`.
|
|
299
304
|
group_key: nil,
|
|
300
|
-
# Body param
|
|
305
|
+
# Body param: Must be aligned to UTC midnight, e.g. `2024-01-01T00:00:00Z`.
|
|
301
306
|
starting_on: nil,
|
|
302
307
|
request_options: {}
|
|
303
308
|
)
|
|
@@ -47,7 +47,7 @@ module MetronomeSDK
|
|
|
47
47
|
)
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
# For a given customer, lists
|
|
50
|
+
# For a given customer, lists a page of their contracts in chronological order.
|
|
51
51
|
#
|
|
52
52
|
# ### Use this endpoint to:
|
|
53
53
|
#
|
|
@@ -62,22 +62,34 @@ module MetronomeSDK
|
|
|
62
62
|
# Use the `starting_at`, `covering_date`, and `include_archived` parameters to
|
|
63
63
|
# filter the list of returned contracts. For example, to list only currently
|
|
64
64
|
# active contracts, pass `covering_date` equal to the current time.
|
|
65
|
+
#
|
|
66
|
+
# Results are limited to 20 contracts per page. When the response includes a
|
|
67
|
+
# non-null `cursor`, pass it back as the `cursor` parameter to fetch the next
|
|
68
|
+
# page.
|
|
65
69
|
sig do
|
|
66
70
|
params(
|
|
67
71
|
customer_id: String,
|
|
68
72
|
covering_date: Time,
|
|
73
|
+
cursor: String,
|
|
69
74
|
include_archived: T::Boolean,
|
|
70
75
|
include_balance: T::Boolean,
|
|
71
76
|
include_ledgers: T::Boolean,
|
|
77
|
+
limit: Float,
|
|
72
78
|
starting_at: Time,
|
|
73
79
|
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
74
|
-
).returns(
|
|
80
|
+
).returns(
|
|
81
|
+
MetronomeSDK::Internal::BodyCursorPageCursorField[
|
|
82
|
+
MetronomeSDK::ContractV2
|
|
83
|
+
]
|
|
84
|
+
)
|
|
75
85
|
end
|
|
76
86
|
def list(
|
|
77
87
|
customer_id:,
|
|
78
88
|
# Optional RFC 3339 timestamp. Only include contracts active on the provided date.
|
|
79
89
|
# This cannot be provided if starting_at filter is provided.
|
|
80
90
|
covering_date: nil,
|
|
91
|
+
# Cursor from a previous response to fetch the next page of contracts.
|
|
92
|
+
cursor: nil,
|
|
81
93
|
# Include archived contracts in the response.
|
|
82
94
|
include_archived: nil,
|
|
83
95
|
# Include the balance of credits and commits in the response. Setting this flag
|
|
@@ -86,6 +98,8 @@ module MetronomeSDK
|
|
|
86
98
|
# Include commit/credit ledgers in the response. Setting this flag may cause the
|
|
87
99
|
# response to be slower.
|
|
88
100
|
include_ledgers: nil,
|
|
101
|
+
# Max number of contracts to return per page. Range: 1-20. Default: 20.
|
|
102
|
+
limit: nil,
|
|
89
103
|
# Optional RFC 3339 timestamp. Only include contracts that started on or after
|
|
90
104
|
# this date. This cannot be provided if covering_date filter is provided.
|
|
91
105
|
starting_at: nil,
|
|
@@ -113,8 +127,8 @@ module MetronomeSDK
|
|
|
113
127
|
# - When you edit a contract, any draft invoices update immediately to reflect
|
|
114
128
|
# that edit. Finalized invoices remain unchanged - you must void and regenerate
|
|
115
129
|
# them in the UI or API to reflect the edit.
|
|
116
|
-
# - Contract editing must be enabled to use this endpoint.
|
|
117
|
-
# Metronome
|
|
130
|
+
# - Contract editing must be enabled to use this endpoint. Contact us via the
|
|
131
|
+
# [Metronome support portal](https://app.metronome.com/support) to learn more.
|
|
118
132
|
sig do
|
|
119
133
|
params(
|
|
120
134
|
contract_id: String,
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Resources
|
|
5
|
+
class V2
|
|
6
|
+
class Notifications
|
|
7
|
+
class Offset
|
|
8
|
+
# Create an offset lifecycle event notification configuration. The lifecycle event
|
|
9
|
+
# type is inferred from the policy.type field.
|
|
10
|
+
sig do
|
|
11
|
+
params(
|
|
12
|
+
name: String,
|
|
13
|
+
policy:
|
|
14
|
+
MetronomeSDK::V2::Notifications::OffsetCreateParams::Policy::OrHash,
|
|
15
|
+
uniqueness_key: String,
|
|
16
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
17
|
+
).returns(
|
|
18
|
+
MetronomeSDK::Models::V2::Notifications::OffsetCreateResponse
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
def create(
|
|
22
|
+
# The name for this offset notification configuration.
|
|
23
|
+
name:,
|
|
24
|
+
# The offset lifecycle event policy that defines when and how this notification
|
|
25
|
+
# should be triggered. The lifecycle event type is inferred from the policy.type
|
|
26
|
+
# field.
|
|
27
|
+
policy:,
|
|
28
|
+
# Optional uniqueness key to prevent duplicate notification configurations.
|
|
29
|
+
uniqueness_key: nil,
|
|
30
|
+
request_options: {}
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Retrieve a specific offset lifecycle event notification configuration by ID.
|
|
35
|
+
sig do
|
|
36
|
+
params(
|
|
37
|
+
id: String,
|
|
38
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
39
|
+
).returns(
|
|
40
|
+
MetronomeSDK::Models::V2::Notifications::OffsetRetrieveResponse
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
def retrieve(
|
|
44
|
+
# The ID of the notification configuration to retrieve
|
|
45
|
+
id:,
|
|
46
|
+
request_options: {}
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List offset lifecycle event notification configurations. These are user-created
|
|
51
|
+
# notifications that trigger at a specified time offset relative to lifecycle
|
|
52
|
+
# events. Returns a maximum of 400 results per request.
|
|
53
|
+
sig do
|
|
54
|
+
params(
|
|
55
|
+
archive_filter:
|
|
56
|
+
MetronomeSDK::V2::Notifications::OffsetListParams::ArchiveFilter::OrSymbol,
|
|
57
|
+
cursor: String,
|
|
58
|
+
limit: Float,
|
|
59
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
60
|
+
).returns(
|
|
61
|
+
MetronomeSDK::Internal::BodyCursorPageCursorField[
|
|
62
|
+
MetronomeSDK::V2::LifecycleEventOffsetNotificationConfig
|
|
63
|
+
]
|
|
64
|
+
)
|
|
65
|
+
end
|
|
66
|
+
def list(
|
|
67
|
+
# Filter options for the notification configurations. If not provided, defaults to
|
|
68
|
+
# NOT_ARCHIVED.
|
|
69
|
+
archive_filter: nil,
|
|
70
|
+
cursor: nil,
|
|
71
|
+
limit: nil,
|
|
72
|
+
request_options: {}
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Archive an offset lifecycle event notification configuration. Archived
|
|
77
|
+
# notifications are not processed.
|
|
78
|
+
sig do
|
|
79
|
+
params(
|
|
80
|
+
id: String,
|
|
81
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
82
|
+
).returns(
|
|
83
|
+
MetronomeSDK::Models::V2::Notifications::OffsetArchiveResponse
|
|
84
|
+
)
|
|
85
|
+
end
|
|
86
|
+
def archive(
|
|
87
|
+
# The ID of the offset lifecycle event notification configuration to archive.
|
|
88
|
+
id:,
|
|
89
|
+
request_options: {}
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Edit an existing offset notification, or enable/disable a system notification
|
|
94
|
+
sig do
|
|
95
|
+
params(
|
|
96
|
+
policy:
|
|
97
|
+
T.any(
|
|
98
|
+
MetronomeSDK::V2::Notifications::OffsetEditParams::Policy::LifecycleEventOffsetPolicy::OrHash,
|
|
99
|
+
MetronomeSDK::V2::Notifications::OffsetEditParams::Policy::LifecycleEventSystemPolicy::OrHash
|
|
100
|
+
),
|
|
101
|
+
id: String,
|
|
102
|
+
is_enabled: T::Boolean,
|
|
103
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
104
|
+
).returns(
|
|
105
|
+
MetronomeSDK::Models::V2::Notifications::OffsetEditResponse
|
|
106
|
+
)
|
|
107
|
+
end
|
|
108
|
+
def edit(
|
|
109
|
+
# Updated policy configuration. The policy.type must match the existing lifecycle
|
|
110
|
+
# event type.
|
|
111
|
+
policy:,
|
|
112
|
+
# The ID of the notification configuration to edit. Not provided when updating the
|
|
113
|
+
# configuration for system events
|
|
114
|
+
id: nil,
|
|
115
|
+
# Set to true to enable webhook messages for the notification indicated in the
|
|
116
|
+
# policy, false to disable. Only supported by system lifecycle events.
|
|
117
|
+
is_enabled: nil,
|
|
118
|
+
request_options: {}
|
|
119
|
+
)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# @api private
|
|
123
|
+
sig { params(client: MetronomeSDK::Client).returns(T.attached_class) }
|
|
124
|
+
def self.new(client:)
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# typed: strong
|
|
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
|
+
sig do
|
|
11
|
+
params(
|
|
12
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
13
|
+
).returns(
|
|
14
|
+
MetronomeSDK::Models::V2::Notifications::SystemListResponse
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
def list(request_options: {})
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# @api private
|
|
21
|
+
sig { params(client: MetronomeSDK::Client).returns(T.attached_class) }
|
|
22
|
+
def self.new(client:)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Resources
|
|
5
|
+
class V2
|
|
6
|
+
class Notifications
|
|
7
|
+
sig { returns(MetronomeSDK::Resources::V2::Notifications::Offset) }
|
|
8
|
+
attr_reader :offset
|
|
9
|
+
|
|
10
|
+
sig { returns(MetronomeSDK::Resources::V2::Notifications::System) }
|
|
11
|
+
attr_reader :system_
|
|
12
|
+
|
|
13
|
+
# @api private
|
|
14
|
+
sig { params(client: MetronomeSDK::Client).returns(T.attached_class) }
|
|
15
|
+
def self.new(client:)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -6,6 +6,9 @@ module MetronomeSDK
|
|
|
6
6
|
sig { returns(MetronomeSDK::Resources::V2::Contracts) }
|
|
7
7
|
attr_reader :contracts
|
|
8
8
|
|
|
9
|
+
sig { returns(MetronomeSDK::Resources::V2::Notifications) }
|
|
10
|
+
attr_reader :notifications
|
|
11
|
+
|
|
9
12
|
# @api private
|
|
10
13
|
sig { params(client: MetronomeSDK::Client).returns(T.attached_class) }
|
|
11
14
|
def self.new(client:)
|