metronome-sdk 3.6.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +54 -0
- data/README.md +1 -1
- data/lib/metronome_sdk/internal/transport/base_client.rb +4 -1
- data/lib/metronome_sdk/internal/type/enum.rb +0 -25
- data/lib/metronome_sdk/models/commit.rb +36 -1
- data/lib/metronome_sdk/models/contract.rb +140 -1
- data/lib/metronome_sdk/models/contract_v2.rb +457 -8
- data/lib/metronome_sdk/models/contract_without_amendments.rb +320 -5
- data/lib/metronome_sdk/models/credit.rb +10 -1
- data/lib/metronome_sdk/models/override.rb +7 -1
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +113 -2
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +105 -2
- data/lib/metronome_sdk/models/spend_threshold_configuration.rb +33 -1
- data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +33 -1
- data/lib/metronome_sdk/models/subscription.rb +90 -2
- data/lib/metronome_sdk/models/v1/alert_create_params.rb +127 -1
- data/lib/metronome_sdk/models/v1/contract_amend_params.rb +46 -5
- data/lib/metronome_sdk/models/v1/contract_create_params.rb +436 -12
- data/lib/metronome_sdk/models/v1/contract_create_response.rb +1308 -3
- data/lib/metronome_sdk/models/v1/contract_get_subscription_seats_history_params.rb +88 -0
- data/lib/metronome_sdk/models/v1/contract_get_subscription_seats_history_response.rb +62 -0
- data/lib/metronome_sdk/models/v1/contract_list_seat_balances_params.rb +10 -1
- data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +127 -1
- data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +130 -3
- data/lib/metronome_sdk/models/v1/customers/invoice_list_params.rb +10 -1
- data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +2 -0
- data/lib/metronome_sdk/models/v1/package_create_params.rb +394 -11
- data/lib/metronome_sdk/models/v1/package_list_response.rb +374 -8
- data/lib/metronome_sdk/models/v1/package_retrieve_response.rb +378 -8
- data/lib/metronome_sdk/models/v2/contract_edit_params.rb +817 -13
- data/lib/metronome_sdk/models/v2/contract_edit_response.rb +4310 -3
- data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +600 -10
- data/lib/metronome_sdk/resources/v1/alerts.rb +3 -1
- data/lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb +4 -0
- data/lib/metronome_sdk/resources/v1/contracts.rb +71 -2
- data/lib/metronome_sdk/resources/v1/customers/alerts.rb +4 -2
- data/lib/metronome_sdk/resources/v1/customers/invoices.rb +3 -1
- data/lib/metronome_sdk/resources/v1/dashboards.rb +7 -2
- data/lib/metronome_sdk/resources/v1/packages.rb +6 -5
- data/lib/metronome_sdk/resources/v1.rb +0 -4
- data/lib/metronome_sdk/resources/v2/contracts.rb +5 -1
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +2 -8
- data/rbi/metronome_sdk/models/commit.rbi +61 -0
- data/rbi/metronome_sdk/models/contract.rbi +354 -0
- data/rbi/metronome_sdk/models/contract_v2.rbi +1132 -11
- data/rbi/metronome_sdk/models/contract_without_amendments.rbi +831 -0
- data/rbi/metronome_sdk/models/credit.rbi +13 -0
- data/rbi/metronome_sdk/models/override.rbi +9 -0
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +299 -6
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +287 -6
- data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +78 -3
- data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +78 -3
- data/rbi/metronome_sdk/models/subscription.rbi +212 -3
- data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +373 -0
- data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +81 -6
- data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +1095 -17
- data/rbi/metronome_sdk/models/v1/contract_create_response.rbi +2911 -4
- data/rbi/metronome_sdk/models/v1/contract_get_subscription_seats_history_params.rbi +112 -0
- data/rbi/metronome_sdk/models/v1/contract_get_subscription_seats_history_response.rbi +119 -0
- data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_params.rbi +13 -0
- data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +360 -0
- data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +379 -2
- data/rbi/metronome_sdk/models/v1/customers/invoice_list_params.rbi +13 -0
- data/rbi/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbi +10 -0
- data/rbi/metronome_sdk/models/v1/package_create_params.rbi +1049 -42
- data/rbi/metronome_sdk/models/v1/package_list_response.rbi +1051 -54
- data/rbi/metronome_sdk/models/v1/package_retrieve_response.rbi +1051 -54
- data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +2130 -114
- data/rbi/metronome_sdk/models/v2/contract_edit_response.rbi +9749 -4
- data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1567 -82
- data/rbi/metronome_sdk/resources/v1/alerts.rbi +8 -0
- data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbi +4 -0
- data/rbi/metronome_sdk/resources/v1/contracts.rbi +77 -0
- data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +8 -1
- data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +4 -0
- data/rbi/metronome_sdk/resources/v1/dashboards.rbi +7 -2
- data/rbi/metronome_sdk/resources/v1/packages.rbi +8 -4
- data/rbi/metronome_sdk/resources/v1.rbi +0 -3
- data/rbi/metronome_sdk/resources/v2/contracts.rbi +10 -0
- data/sig/metronome_sdk/models/commit.rbs +26 -0
- data/sig/metronome_sdk/models/contract.rbs +151 -0
- data/sig/metronome_sdk/models/contract_v2.rbs +448 -5
- data/sig/metronome_sdk/models/contract_without_amendments.rbs +320 -2
- data/sig/metronome_sdk/models/credit.rbs +7 -0
- data/sig/metronome_sdk/models/override.rbs +7 -0
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +116 -6
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +116 -6
- data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +31 -3
- data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +31 -3
- data/sig/metronome_sdk/models/subscription.rbs +88 -3
- data/sig/metronome_sdk/models/v1/alert_create_params.rbs +144 -0
- data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +26 -0
- data/sig/metronome_sdk/models/v1/contract_create_params.rbs +412 -5
- data/sig/metronome_sdk/models/v1/contract_create_response.rbs +1210 -4
- data/sig/metronome_sdk/models/v1/contract_get_subscription_seats_history_params.rbs +63 -0
- data/sig/metronome_sdk/models/v1/contract_get_subscription_seats_history_response.rbs +59 -0
- data/sig/metronome_sdk/models/v1/contract_list_seat_balances_params.rbs +7 -0
- data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +141 -0
- data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +150 -0
- data/sig/metronome_sdk/models/v1/customers/invoice_list_params.rbs +8 -1
- data/sig/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbs +4 -0
- data/sig/metronome_sdk/models/v1/package_create_params.rbs +386 -5
- data/sig/metronome_sdk/models/v1/package_list_response.rbs +380 -5
- data/sig/metronome_sdk/models/v1/package_retrieve_response.rbs +378 -5
- data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +751 -14
- data/sig/metronome_sdk/models/v2/contract_edit_response.rbs +4215 -4
- data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +569 -14
- data/sig/metronome_sdk/resources/v1/alerts.rbs +1 -0
- data/sig/metronome_sdk/resources/v1/contracts.rbs +14 -0
- data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +1 -0
- data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +1 -0
- data/sig/metronome_sdk/resources/v1/packages.rbs +1 -0
- data/sig/metronome_sdk/resources/v1.rbs +0 -2
- data/sig/metronome_sdk/resources/v2/contracts.rbs +2 -0
- metadata +8 -26
- data/lib/metronome_sdk/models/v1/payment.rb +0 -196
- data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +0 -28
- data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +0 -18
- data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +0 -28
- data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +0 -18
- data/lib/metronome_sdk/models/v1/payment_list_params.rb +0 -53
- data/lib/metronome_sdk/models/v1/payment_status.rb +0 -19
- data/lib/metronome_sdk/resources/v1/payments.rb +0 -102
- data/rbi/metronome_sdk/models/v1/payment.rbi +0 -403
- data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +0 -48
- data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +0 -35
- data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +0 -48
- data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +0 -35
- data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +0 -91
- data/rbi/metronome_sdk/models/v1/payment_status.rbi +0 -33
- data/rbi/metronome_sdk/resources/v1/payments.rbi +0 -72
- data/sig/metronome_sdk/models/v1/payment.rbs +0 -243
- data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +0 -30
- data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +0 -15
- data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +0 -30
- data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +0 -15
- data/sig/metronome_sdk/models/v1/payment_list_params.rbs +0 -56
- data/sig/metronome_sdk/models/v1/payment_status.rbs +0 -19
- data/sig/metronome_sdk/resources/v1/payments.rbs +0 -30
|
@@ -58,7 +58,7 @@ module MetronomeSDK
|
|
|
58
58
|
# threshold notification evaluations in real-time as usage events stream in,
|
|
59
59
|
# unlike competitors who rely on periodic polling or batch evaluation cycles
|
|
60
60
|
#
|
|
61
|
-
# @overload create(alert_type:, name:, threshold:, billable_metric_id: nil, credit_grant_type_filters: nil, credit_type_id: nil, custom_field_filters: nil, customer_id: nil, evaluate_on_create: nil, group_values: nil, invoice_types_filter: nil, plan_id: nil, seat_filter: nil, uniqueness_key: nil, request_options: {})
|
|
61
|
+
# @overload create(alert_type:, name:, threshold:, alert_specifiers: nil, billable_metric_id: nil, credit_grant_type_filters: nil, credit_type_id: nil, custom_field_filters: nil, customer_id: nil, evaluate_on_create: nil, group_values: nil, invoice_types_filter: nil, plan_id: nil, seat_filter: nil, uniqueness_key: nil, request_options: {})
|
|
62
62
|
#
|
|
63
63
|
# @param alert_type [Symbol, MetronomeSDK::Models::V1::AlertCreateParams::AlertType] Type of the threshold notification
|
|
64
64
|
#
|
|
@@ -66,6 +66,8 @@ module MetronomeSDK
|
|
|
66
66
|
#
|
|
67
67
|
# @param threshold [Float] Threshold value of the notification policy. Depending upon the notification typ
|
|
68
68
|
#
|
|
69
|
+
# @param alert_specifiers [Array<MetronomeSDK::Models::V1::AlertCreateParams::AlertSpecifier>] Can be used with only `low_remaining_contract_credit_and_commit_balance_reached`
|
|
70
|
+
#
|
|
69
71
|
# @param billable_metric_id [String] For threshold notifications of type `usage_threshold_reached`, specifies which b
|
|
70
72
|
#
|
|
71
73
|
# @param credit_grant_type_filters [Array<String>] An array of strings, representing a way to filter the credit grant this threshol
|
|
@@ -59,6 +59,10 @@ module MetronomeSDK
|
|
|
59
59
|
#
|
|
60
60
|
# Add a new rate
|
|
61
61
|
#
|
|
62
|
+
# This endpoint is heavily rate limited. For adding multiple rates, using the
|
|
63
|
+
# [addRates](https://docs.metronome.com/api-reference/rate-cards/add-rates)
|
|
64
|
+
# endpoint is strongly encouraged.
|
|
65
|
+
#
|
|
62
66
|
# @overload add(entitled:, product_id:, rate_card_id:, rate_type:, starting_at:, billing_frequency: nil, commit_rate: nil, credit_type_id: nil, custom_rate: nil, ending_before: nil, is_prorated: nil, price: nil, pricing_group_values: nil, quantity: nil, tiers: nil, request_options: {})
|
|
63
67
|
#
|
|
64
68
|
# @param entitled [Boolean]
|
|
@@ -144,7 +144,7 @@ module MetronomeSDK
|
|
|
144
144
|
# `usage_filters` to route the correct usage to each contract.
|
|
145
145
|
# [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).
|
|
146
146
|
#
|
|
147
|
-
# @overload create(customer_id:, starting_at:, billing_provider_configuration: nil, commits: nil, credits: nil, custom_fields: nil, discounts: nil, ending_before: nil, hierarchy_configuration: nil, multiplier_override_prioritization: nil, name: nil, net_payment_terms_days: nil, netsuite_sales_order_id: nil, overrides: nil, package_alias: nil, package_id: nil, prepaid_balance_threshold_configuration: nil, professional_services: nil, rate_card_alias: nil, rate_card_id: nil, recurring_commits: nil, recurring_credits: nil, reseller_royalties: nil, revenue_system_configuration: nil, salesforce_opportunity_id: nil, scheduled_charges: nil, scheduled_charges_on_usage_invoices: nil, spend_threshold_configuration: nil, subscriptions: nil, total_contract_value: nil, transition: nil, uniqueness_key: nil, usage_filter: nil, usage_statement_schedule: nil, request_options: {})
|
|
147
|
+
# @overload create(customer_id:, starting_at:, billing_provider_configuration: nil, commits: nil, credits: nil, custom_fields: nil, discounts: nil, ending_before: nil, hierarchy_configuration: nil, multiplier_override_prioritization: nil, name: nil, net_payment_terms_days: nil, netsuite_sales_order_id: nil, overrides: nil, package_alias: nil, package_id: nil, prepaid_balance_threshold_configuration: nil, professional_services: nil, rate_card_alias: nil, rate_card_id: nil, recurring_commits: nil, recurring_credits: nil, reseller_royalties: nil, revenue_system_configuration: nil, salesforce_opportunity_id: nil, scheduled_charges: nil, scheduled_charges_on_usage_invoices: nil, spend_threshold_configuration: nil, spend_trackers: nil, subscriptions: nil, total_contract_value: nil, transition: nil, uniqueness_key: nil, usage_filter: nil, usage_statement_schedule: nil, request_options: {})
|
|
148
148
|
#
|
|
149
149
|
# @param customer_id [String]
|
|
150
150
|
#
|
|
@@ -202,6 +202,8 @@ module MetronomeSDK
|
|
|
202
202
|
#
|
|
203
203
|
# @param spend_threshold_configuration [MetronomeSDK::Models::SpendThresholdConfiguration]
|
|
204
204
|
#
|
|
205
|
+
# @param spend_trackers [Array<MetronomeSDK::Models::V1::ContractCreateParams::SpendTracker>] Spend trackers to attach to this contract. Aliases must be unique within a contr
|
|
206
|
+
#
|
|
205
207
|
# @param subscriptions [Array<MetronomeSDK::Models::V1::ContractCreateParams::Subscription>] Optional list of [subscriptions](https://docs.metronome.com/manage-product-acces
|
|
206
208
|
#
|
|
207
209
|
# @param total_contract_value [Float] This field's availability is dependent on your client's configuration.
|
|
@@ -566,6 +568,71 @@ module MetronomeSDK
|
|
|
566
568
|
)
|
|
567
569
|
end
|
|
568
570
|
|
|
571
|
+
# Some parameter documentations has been truncated, see
|
|
572
|
+
# {MetronomeSDK::Models::V1::ContractGetSubscriptionSeatsHistoryParams} for more
|
|
573
|
+
# details.
|
|
574
|
+
#
|
|
575
|
+
# Get the history of subscription seats schedule over time for a given
|
|
576
|
+
# `subscription_id`. This endpoint provides information about seat assignments and
|
|
577
|
+
# total quantities for different time periods, allowing you to track how seat
|
|
578
|
+
# assignments have changed over time.
|
|
579
|
+
#
|
|
580
|
+
# ### Use this endpoint to:
|
|
581
|
+
#
|
|
582
|
+
# - Track changes to seat assignments over time
|
|
583
|
+
# - Get seat schedule for a specific date using the `covering_date` parameter
|
|
584
|
+
# - Get seat schedule history with optional date range filtering using
|
|
585
|
+
# `starting_at` and `ending_before`
|
|
586
|
+
#
|
|
587
|
+
# ### Key response fields:
|
|
588
|
+
#
|
|
589
|
+
# - data: array of seat schedule entries with time periods, quantity, and
|
|
590
|
+
# assignments
|
|
591
|
+
# - next_page: cursor for pagination to retrieve additional results
|
|
592
|
+
#
|
|
593
|
+
# ### Usage guidelines:
|
|
594
|
+
#
|
|
595
|
+
# - Use `covering_date` to get the active seats for a specific point in time.
|
|
596
|
+
# `covering_date` cannot be used with `starting_at` or `ending_before`.
|
|
597
|
+
# - Use `starting_at` and `ending_before` to filter results by time range.
|
|
598
|
+
# `starting_at` and `ending_before` cannot be used with `covering_date`.
|
|
599
|
+
# - Maximum limit is 10 seat schedule entries per request
|
|
600
|
+
# - Results are ordered by `starting_at` timestamp
|
|
601
|
+
#
|
|
602
|
+
# @overload get_subscription_seats_history(contract_id:, customer_id:, subscription_id:, covering_date: nil, cursor: nil, ending_before: nil, limit: nil, starting_at: nil, request_options: {})
|
|
603
|
+
#
|
|
604
|
+
# @param contract_id [String]
|
|
605
|
+
#
|
|
606
|
+
# @param customer_id [String]
|
|
607
|
+
#
|
|
608
|
+
# @param subscription_id [String]
|
|
609
|
+
#
|
|
610
|
+
# @param covering_date [Time, nil] Get the seats history segment for the covering date. Cannot be used with `starti
|
|
611
|
+
#
|
|
612
|
+
# @param cursor [String, nil] Cursor for pagination. Use the value from the `next_page` field of the previous
|
|
613
|
+
#
|
|
614
|
+
# @param ending_before [Time, nil] Include seats history segments that are active at or before this timestamp. Use
|
|
615
|
+
#
|
|
616
|
+
# @param limit [Integer, nil] Maximum number of seat schedule entries to return. Defaults to 10. Required rang
|
|
617
|
+
#
|
|
618
|
+
# @param starting_at [Time, nil] Include seats history segments that are active at or after this timestamp. Use w
|
|
619
|
+
#
|
|
620
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
621
|
+
#
|
|
622
|
+
# @return [MetronomeSDK::Models::V1::ContractGetSubscriptionSeatsHistoryResponse]
|
|
623
|
+
#
|
|
624
|
+
# @see MetronomeSDK::Models::V1::ContractGetSubscriptionSeatsHistoryParams
|
|
625
|
+
def get_subscription_seats_history(params)
|
|
626
|
+
parsed, options = MetronomeSDK::V1::ContractGetSubscriptionSeatsHistoryParams.dump_request(params)
|
|
627
|
+
@client.request(
|
|
628
|
+
method: :post,
|
|
629
|
+
path: "v1/contracts/getSubscriptionSeatsHistory",
|
|
630
|
+
body: parsed,
|
|
631
|
+
model: MetronomeSDK::Models::V1::ContractGetSubscriptionSeatsHistoryResponse,
|
|
632
|
+
options: options
|
|
633
|
+
)
|
|
634
|
+
end
|
|
635
|
+
|
|
569
636
|
# Some parameter documentations has been truncated, see
|
|
570
637
|
# {MetronomeSDK::Models::V1::ContractListBalancesParams} for more details.
|
|
571
638
|
#
|
|
@@ -677,7 +744,7 @@ module MetronomeSDK
|
|
|
677
744
|
# - Set `include_ledgers=true` for detailed transaction history per commit/credit
|
|
678
745
|
# per seat
|
|
679
746
|
#
|
|
680
|
-
# @overload list_seat_balances(contract_id:, customer_id:, covering_date: nil, cursor: nil, effective_before: nil, include_credits_and_commits: nil, include_ledgers: nil, limit: nil, seat_ids: nil, starting_at: nil, subscription_ids: nil, request_options: {})
|
|
747
|
+
# @overload list_seat_balances(contract_id:, customer_id:, covering_date: nil, cursor: nil, effective_before: nil, include_credits_and_commits: nil, include_ledgers: nil, limit: nil, seat_ids: nil, skip_missing_seat_ids: nil, starting_at: nil, subscription_ids: nil, request_options: {})
|
|
681
748
|
#
|
|
682
749
|
# @param contract_id [String] The contract ID to retrieve seat balances for
|
|
683
750
|
#
|
|
@@ -697,6 +764,8 @@ module MetronomeSDK
|
|
|
697
764
|
#
|
|
698
765
|
# @param seat_ids [Array<String>] Optional filter to only include specific seats.
|
|
699
766
|
#
|
|
767
|
+
# @param skip_missing_seat_ids [Boolean] When true, any seat_ids not found in contract subscriptions will be silently omi
|
|
768
|
+
#
|
|
700
769
|
# @param starting_at [Time] Include only commits or credits with access effective on or after this date (can
|
|
701
770
|
#
|
|
702
771
|
# @param subscription_ids [Array<String>] Optional filter to only include seats from specific subscriptions. If subscripti
|
|
@@ -47,11 +47,11 @@ module MetronomeSDK
|
|
|
47
47
|
# - `null` - Notification has been archived
|
|
48
48
|
# - `triggered_by`: Additional context about what caused the notification to
|
|
49
49
|
# trigger (when applicable)
|
|
50
|
+
# - `updated_at`: Timestamp of when the `customer_status` was last updated
|
|
50
51
|
# - alert: Complete threshold notification configuration including:
|
|
51
52
|
# - Notification ID, name, and type
|
|
52
53
|
# - Current threshold values and credit type information
|
|
53
54
|
# - Notification status (enabled, disabled, or archived)
|
|
54
|
-
# - Last update timestamp
|
|
55
55
|
# - Any applied filters (credit grant types, custom fields, group values)
|
|
56
56
|
#
|
|
57
57
|
# ### Usage guidelines:
|
|
@@ -69,12 +69,14 @@ module MetronomeSDK
|
|
|
69
69
|
# - Error handling: Returns 404 if either the customer or alert_id doesn't exist
|
|
70
70
|
# or isn't accessible to your organization
|
|
71
71
|
#
|
|
72
|
-
# @overload retrieve(alert_id:, customer_id:, group_values: nil, plans_or_contracts: nil, seat_filter: nil, request_options: {})
|
|
72
|
+
# @overload retrieve(alert_id:, customer_id:, alert_specifiers: nil, group_values: nil, plans_or_contracts: nil, seat_filter: nil, request_options: {})
|
|
73
73
|
#
|
|
74
74
|
# @param alert_id [String] The Metronome ID of the threshold notification
|
|
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 only `low_remaining_contract_credit_and_commit_balance_reached`
|
|
79
|
+
#
|
|
78
80
|
# @param group_values [Array<MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::GroupValue>] Only present for `spend_threshold_reached` notifications. Retrieve the notificat
|
|
79
81
|
#
|
|
80
82
|
# @param plans_or_contracts [Symbol, MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::PlansOrContracts] When parallel threshold notifications are enabled during migration, this flag de
|
|
@@ -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, request_options: {})
|
|
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: {})
|
|
140
140
|
#
|
|
141
141
|
# @param customer_id [String] Path param
|
|
142
142
|
#
|
|
@@ -160,6 +160,8 @@ module MetronomeSDK
|
|
|
160
160
|
#
|
|
161
161
|
# @param type [Symbol, MetronomeSDK::Models::V1::Customers::InvoiceListParams::Type] Query param: Filter invoices by type. Defaults to returning all invoice types.
|
|
162
162
|
#
|
|
163
|
+
# @param webhook_notification_id [String] Query param: Indicates that this API request was triggered by a webhook notifica
|
|
164
|
+
#
|
|
163
165
|
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
164
166
|
#
|
|
165
167
|
# @return [MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::Customers::Invoice>]
|
|
@@ -30,8 +30,13 @@ module MetronomeSDK
|
|
|
30
30
|
#
|
|
31
31
|
# - Dashboard types: Choose from `invoices`, `usage`, or `commits_and_credits`
|
|
32
32
|
# - Customization options:
|
|
33
|
-
# - `dashboard_options`: Configure
|
|
34
|
-
#
|
|
33
|
+
# - `dashboard_options`: Configure dashboard behavior. For the invoices
|
|
34
|
+
# dashboard, supported keys include: `show_zero_usage_line_items`
|
|
35
|
+
# ("true"/"false"), `hide_voided_invoices` ("true"/"false"), `contract_id`
|
|
36
|
+
# (UUID, filters invoices by contract), `invoice_type` ("USAGE" or
|
|
37
|
+
# "SCHEDULED", filters by invoice type), `invoice_status_filter` ("VOID",
|
|
38
|
+
# "FINALIZED", "DRAFT", "FINALIZED_AND_DRAFT", or "ALL"), and
|
|
39
|
+
# `billable_status_filter` ("BILLABLE", "UNBILLABLE", or "ALL")
|
|
35
40
|
# - `color_overrides`: Match your brand's color palette
|
|
36
41
|
# - `bm_group_key_overrides`: Customize how dimensions are displayed (for the
|
|
37
42
|
# usage embeddable dashboard)
|
|
@@ -58,7 +58,7 @@ module MetronomeSDK
|
|
|
58
58
|
# provisioning with a package. Edited contracts will still be associated with
|
|
59
59
|
# the package used during provisioning.
|
|
60
60
|
#
|
|
61
|
-
# @overload create(name:, aliases: nil, billing_provider: nil, commits: nil, contract_name: nil, credits: nil, delivery_method: nil, duration: nil, multiplier_override_prioritization: nil, net_payment_terms_days: nil, overrides: nil, prepaid_balance_threshold_configuration: nil, rate_card_alias: nil, rate_card_id: nil, recurring_commits: nil, recurring_credits: nil, scheduled_charges: nil, scheduled_charges_on_usage_invoices: nil, spend_threshold_configuration: nil, subscriptions: nil, uniqueness_key: nil, usage_statement_schedule: nil, request_options: {})
|
|
61
|
+
# @overload create(name:, aliases: nil, billing_provider: nil, commits: nil, contract_name: nil, credits: nil, delivery_method: nil, duration: nil, multiplier_override_prioritization: nil, net_payment_terms_days: nil, overrides: nil, prepaid_balance_threshold_configuration: nil, rate_card_alias: nil, rate_card_id: nil, recurring_commits: nil, recurring_credits: nil, scheduled_charges: nil, scheduled_charges_on_usage_invoices: nil, spend_threshold_configuration: nil, spend_trackers: nil, subscriptions: nil, uniqueness_key: nil, usage_statement_schedule: nil, request_options: {})
|
|
62
62
|
#
|
|
63
63
|
# @param name [String]
|
|
64
64
|
#
|
|
@@ -98,6 +98,8 @@ module MetronomeSDK
|
|
|
98
98
|
#
|
|
99
99
|
# @param spend_threshold_configuration [MetronomeSDK::Models::SpendThresholdConfiguration]
|
|
100
100
|
#
|
|
101
|
+
# @param spend_trackers [Array<MetronomeSDK::Models::V1::PackageCreateParams::SpendTracker>]
|
|
102
|
+
#
|
|
101
103
|
# @param subscriptions [Array<MetronomeSDK::Models::V1::PackageCreateParams::Subscription>]
|
|
102
104
|
#
|
|
103
105
|
# @param uniqueness_key [String] Prevents the creation of duplicates. If a request to create a record is made wit
|
|
@@ -216,10 +218,9 @@ module MetronomeSDK
|
|
|
216
218
|
#
|
|
217
219
|
# ### **Usage guidelines:**
|
|
218
220
|
#
|
|
219
|
-
# Use the
|
|
220
|
-
#
|
|
221
|
-
#
|
|
222
|
-
# pass **`covering_date`** equal to the current time.
|
|
221
|
+
# Use the **`starting_at`**, **`covering_date`**, and **`include_archived`**
|
|
222
|
+
# parameters to filter the list of returned contracts. For example, to list only
|
|
223
|
+
# currently active contracts, pass **`covering_date`** equal to the current time.
|
|
223
224
|
#
|
|
224
225
|
# @overload list_contracts_on_package(package_id:, limit: nil, next_page: nil, covering_date: nil, include_archived: nil, starting_at: nil, request_options: {})
|
|
225
226
|
#
|
|
@@ -80,9 +80,6 @@ module MetronomeSDK
|
|
|
80
80
|
# @return [MetronomeSDK::Resources::V1::Packages]
|
|
81
81
|
attr_reader :packages
|
|
82
82
|
|
|
83
|
-
# @return [MetronomeSDK::Resources::V1::Payments]
|
|
84
|
-
attr_reader :payments
|
|
85
|
-
|
|
86
83
|
# Use these endpoints to configure a billing API key, a webhook secret, or invoice
|
|
87
84
|
# finalization behavior.
|
|
88
85
|
# @return [MetronomeSDK::Resources::V1::Settings]
|
|
@@ -107,7 +104,6 @@ module MetronomeSDK
|
|
|
107
104
|
@invoices = MetronomeSDK::Resources::V1::Invoices.new(client: client)
|
|
108
105
|
@contracts = MetronomeSDK::Resources::V1::Contracts.new(client: client)
|
|
109
106
|
@packages = MetronomeSDK::Resources::V1::Packages.new(client: client)
|
|
110
|
-
@payments = MetronomeSDK::Resources::V1::Payments.new(client: client)
|
|
111
107
|
@settings = MetronomeSDK::Resources::V1::Settings.new(client: client)
|
|
112
108
|
end
|
|
113
109
|
end
|
|
@@ -128,7 +128,7 @@ module MetronomeSDK
|
|
|
128
128
|
# - Contract editing must be enabled to use this endpoint. Reach out to your
|
|
129
129
|
# Metronome representative to learn more.
|
|
130
130
|
#
|
|
131
|
-
# @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_subscriptions: nil, allow_contract_ending_before_finalized_invoice: nil, archive_commits: nil, archive_credits: nil, archive_scheduled_charges: 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: {})
|
|
131
|
+
# @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
132
|
#
|
|
133
133
|
# @param contract_id [String] ID of the contract being edited
|
|
134
134
|
#
|
|
@@ -160,6 +160,8 @@ module MetronomeSDK
|
|
|
160
160
|
#
|
|
161
161
|
# @param add_spend_threshold_configuration [MetronomeSDK::Models::SpendThresholdConfigurationV2]
|
|
162
162
|
#
|
|
163
|
+
# @param add_spend_trackers [Array<MetronomeSDK::Models::V2::ContractEditParams::AddSpendTracker>] Spend trackers to add to this contract. Aliases must be unique within a contract
|
|
164
|
+
#
|
|
163
165
|
# @param add_subscriptions [Array<MetronomeSDK::Models::V2::ContractEditParams::AddSubscription>] Optional list of [subscriptions](https://docs.metronome.com/manage-product-acces
|
|
164
166
|
#
|
|
165
167
|
# @param allow_contract_ending_before_finalized_invoice [Boolean] If true, allows setting the contract end date earlier than the end_timestamp of
|
|
@@ -170,6 +172,8 @@ module MetronomeSDK
|
|
|
170
172
|
#
|
|
171
173
|
# @param archive_scheduled_charges [Array<MetronomeSDK::Models::V2::ContractEditParams::ArchiveScheduledCharge>] IDs of scheduled charges to archive
|
|
172
174
|
#
|
|
175
|
+
# @param archive_spend_trackers [Array<String>] Aliases of spend trackers to archive.
|
|
176
|
+
#
|
|
173
177
|
# @param remove_overrides [Array<MetronomeSDK::Models::V2::ContractEditParams::RemoveOverride>] IDs of overrides to remove
|
|
174
178
|
#
|
|
175
179
|
# @param uniqueness_key [String] Optional uniqueness key to prevent duplicate contract edits.
|
data/lib/metronome_sdk.rb
CHANGED
|
@@ -117,6 +117,8 @@ require_relative "metronome_sdk/models/v1/contract_create_params"
|
|
|
117
117
|
require_relative "metronome_sdk/models/v1/contract_create_response"
|
|
118
118
|
require_relative "metronome_sdk/models/v1/contract_get_net_balance_params"
|
|
119
119
|
require_relative "metronome_sdk/models/v1/contract_get_net_balance_response"
|
|
120
|
+
require_relative "metronome_sdk/models/v1/contract_get_subscription_seats_history_params"
|
|
121
|
+
require_relative "metronome_sdk/models/v1/contract_get_subscription_seats_history_response"
|
|
120
122
|
require_relative "metronome_sdk/models/v1/contract_list_balances_params"
|
|
121
123
|
require_relative "metronome_sdk/models/v1/contract_list_balances_response"
|
|
122
124
|
require_relative "metronome_sdk/models/v1/contract_list_params"
|
|
@@ -271,13 +273,6 @@ require_relative "metronome_sdk/models/v1/package_list_params"
|
|
|
271
273
|
require_relative "metronome_sdk/models/v1/package_list_response"
|
|
272
274
|
require_relative "metronome_sdk/models/v1/package_retrieve_params"
|
|
273
275
|
require_relative "metronome_sdk/models/v1/package_retrieve_response"
|
|
274
|
-
require_relative "metronome_sdk/models/v1/payment"
|
|
275
|
-
require_relative "metronome_sdk/models/v1/payment_attempt_params"
|
|
276
|
-
require_relative "metronome_sdk/models/v1/payment_attempt_response"
|
|
277
|
-
require_relative "metronome_sdk/models/v1/payment_cancel_params"
|
|
278
|
-
require_relative "metronome_sdk/models/v1/payment_cancel_response"
|
|
279
|
-
require_relative "metronome_sdk/models/v1/payment_list_params"
|
|
280
|
-
require_relative "metronome_sdk/models/v1/payment_status"
|
|
281
276
|
require_relative "metronome_sdk/models/v1/plan_detail"
|
|
282
277
|
require_relative "metronome_sdk/models/v1/plan_get_details_params"
|
|
283
278
|
require_relative "metronome_sdk/models/v1/plan_get_details_response"
|
|
@@ -343,7 +338,6 @@ require_relative "metronome_sdk/resources/v1/custom_fields"
|
|
|
343
338
|
require_relative "metronome_sdk/resources/v1/dashboards"
|
|
344
339
|
require_relative "metronome_sdk/resources/v1/invoices"
|
|
345
340
|
require_relative "metronome_sdk/resources/v1/packages"
|
|
346
|
-
require_relative "metronome_sdk/resources/v1/payments"
|
|
347
341
|
require_relative "metronome_sdk/resources/v1/plans"
|
|
348
342
|
require_relative "metronome_sdk/resources/v1/pricing_units"
|
|
349
343
|
require_relative "metronome_sdk/resources/v1/services"
|
|
@@ -91,6 +91,14 @@ module MetronomeSDK
|
|
|
91
91
|
sig { params(contract: MetronomeSDK::Commit::Contract::OrHash).void }
|
|
92
92
|
attr_writer :contract
|
|
93
93
|
|
|
94
|
+
# The actor who created this commit. Omitted for system-generated commits such as
|
|
95
|
+
# recurring commits, rollover commits, and threshold commits.
|
|
96
|
+
sig { returns(T.nilable(String)) }
|
|
97
|
+
attr_reader :created_by
|
|
98
|
+
|
|
99
|
+
sig { params(created_by: String).void }
|
|
100
|
+
attr_writer :created_by
|
|
101
|
+
|
|
94
102
|
# Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
95
103
|
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
96
104
|
attr_reader :custom_fields
|
|
@@ -237,6 +245,18 @@ module MetronomeSDK
|
|
|
237
245
|
end
|
|
238
246
|
attr_writer :specifiers
|
|
239
247
|
|
|
248
|
+
# Optional attributes controlling how this commit interacts with spend trackers.
|
|
249
|
+
sig { returns(T.nilable(MetronomeSDK::Commit::SpendTrackerAttributes)) }
|
|
250
|
+
attr_reader :spend_tracker_attributes
|
|
251
|
+
|
|
252
|
+
sig do
|
|
253
|
+
params(
|
|
254
|
+
spend_tracker_attributes:
|
|
255
|
+
MetronomeSDK::Commit::SpendTrackerAttributes::OrHash
|
|
256
|
+
).void
|
|
257
|
+
end
|
|
258
|
+
attr_writer :spend_tracker_attributes
|
|
259
|
+
|
|
240
260
|
# The subscription configuration for this commit, if it was generated from a
|
|
241
261
|
# recurring commit with a subscription attached.
|
|
242
262
|
sig { returns(T.nilable(MetronomeSDK::Commit::SubscriptionConfig)) }
|
|
@@ -273,6 +293,7 @@ module MetronomeSDK
|
|
|
273
293
|
archived_at: Time,
|
|
274
294
|
balance: Float,
|
|
275
295
|
contract: MetronomeSDK::Commit::Contract::OrHash,
|
|
296
|
+
created_by: String,
|
|
276
297
|
custom_fields: T::Hash[Symbol, String],
|
|
277
298
|
description: String,
|
|
278
299
|
hierarchy_configuration:
|
|
@@ -307,6 +328,8 @@ module MetronomeSDK
|
|
|
307
328
|
rollover_fraction: Float,
|
|
308
329
|
salesforce_opportunity_id: String,
|
|
309
330
|
specifiers: T::Array[MetronomeSDK::CommitSpecifier::OrHash],
|
|
331
|
+
spend_tracker_attributes:
|
|
332
|
+
MetronomeSDK::Commit::SpendTrackerAttributes::OrHash,
|
|
310
333
|
subscription_config: MetronomeSDK::Commit::SubscriptionConfig::OrHash,
|
|
311
334
|
uniqueness_key: String
|
|
312
335
|
).returns(T.attached_class)
|
|
@@ -342,6 +365,9 @@ module MetronomeSDK
|
|
|
342
365
|
# included in the balance, including future-dated manual ledger entries.
|
|
343
366
|
balance: nil,
|
|
344
367
|
contract: nil,
|
|
368
|
+
# The actor who created this commit. Omitted for system-generated commits such as
|
|
369
|
+
# recurring commits, rollover commits, and threshold commits.
|
|
370
|
+
created_by: nil,
|
|
345
371
|
# Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
346
372
|
custom_fields: nil,
|
|
347
373
|
description: nil,
|
|
@@ -372,6 +398,8 @@ module MetronomeSDK
|
|
|
372
398
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
373
399
|
# specifiers to contribute to a commit's or credit's drawdown.
|
|
374
400
|
specifiers: nil,
|
|
401
|
+
# Optional attributes controlling how this commit interacts with spend trackers.
|
|
402
|
+
spend_tracker_attributes: nil,
|
|
375
403
|
# The subscription configuration for this commit, if it was generated from a
|
|
376
404
|
# recurring commit with a subscription attached.
|
|
377
405
|
subscription_config: nil,
|
|
@@ -398,6 +426,7 @@ module MetronomeSDK
|
|
|
398
426
|
archived_at: Time,
|
|
399
427
|
balance: Float,
|
|
400
428
|
contract: MetronomeSDK::Commit::Contract,
|
|
429
|
+
created_by: String,
|
|
401
430
|
custom_fields: T::Hash[Symbol, String],
|
|
402
431
|
description: String,
|
|
403
432
|
hierarchy_configuration: MetronomeSDK::CommitHierarchyConfiguration,
|
|
@@ -413,6 +442,8 @@ module MetronomeSDK
|
|
|
413
442
|
rollover_fraction: Float,
|
|
414
443
|
salesforce_opportunity_id: String,
|
|
415
444
|
specifiers: T::Array[MetronomeSDK::CommitSpecifier],
|
|
445
|
+
spend_tracker_attributes:
|
|
446
|
+
MetronomeSDK::Commit::SpendTrackerAttributes,
|
|
416
447
|
subscription_config: MetronomeSDK::Commit::SubscriptionConfig,
|
|
417
448
|
uniqueness_key: String
|
|
418
449
|
}
|
|
@@ -1824,6 +1855,36 @@ module MetronomeSDK
|
|
|
1824
1855
|
end
|
|
1825
1856
|
end
|
|
1826
1857
|
|
|
1858
|
+
class SpendTrackerAttributes < MetronomeSDK::Internal::Type::BaseModel
|
|
1859
|
+
OrHash =
|
|
1860
|
+
T.type_alias do
|
|
1861
|
+
T.any(
|
|
1862
|
+
MetronomeSDK::Commit::SpendTrackerAttributes,
|
|
1863
|
+
MetronomeSDK::Internal::AnyHash
|
|
1864
|
+
)
|
|
1865
|
+
end
|
|
1866
|
+
|
|
1867
|
+
# If true, this commit is included in spend trackers with discounted set to
|
|
1868
|
+
# DISCOUNTED_ONLY
|
|
1869
|
+
sig { returns(T::Boolean) }
|
|
1870
|
+
attr_accessor :counts_as_discounted
|
|
1871
|
+
|
|
1872
|
+
# Optional attributes controlling how this commit interacts with spend trackers.
|
|
1873
|
+
sig do
|
|
1874
|
+
params(counts_as_discounted: T::Boolean).returns(T.attached_class)
|
|
1875
|
+
end
|
|
1876
|
+
def self.new(
|
|
1877
|
+
# If true, this commit is included in spend trackers with discounted set to
|
|
1878
|
+
# DISCOUNTED_ONLY
|
|
1879
|
+
counts_as_discounted:
|
|
1880
|
+
)
|
|
1881
|
+
end
|
|
1882
|
+
|
|
1883
|
+
sig { override.returns({ counts_as_discounted: T::Boolean }) }
|
|
1884
|
+
def to_hash
|
|
1885
|
+
end
|
|
1886
|
+
end
|
|
1887
|
+
|
|
1827
1888
|
class SubscriptionConfig < MetronomeSDK::Internal::Type::BaseModel
|
|
1828
1889
|
OrHash =
|
|
1829
1890
|
T.type_alias do
|