metronome-sdk 3.4.0 → 3.6.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 +84 -0
- data/README.md +1 -1
- data/lib/metronome_sdk/client.rb +15 -1
- data/lib/metronome_sdk/internal/transport/base_client.rb +2 -0
- data/lib/metronome_sdk/internal/util.rb +22 -7
- data/lib/metronome_sdk/models/base_threshold_commit.rb +10 -1
- data/lib/metronome_sdk/models/contract_v2.rb +443 -15
- data/lib/metronome_sdk/models/credit.rb +74 -4
- data/lib/metronome_sdk/models/override.rb +9 -8
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +27 -1
- data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +28 -2
- data/lib/metronome_sdk/models/spend_threshold_configuration.rb +26 -1
- data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +30 -4
- data/lib/metronome_sdk/models/update_base_threshold_commit.rb +11 -1
- data/lib/metronome_sdk/models/v1/alert_create_params.rb +1 -0
- data/lib/metronome_sdk/models/v1/contract_amend_params.rb +2 -189
- data/lib/metronome_sdk/models/v1/contract_create_params.rb +3 -191
- data/lib/metronome_sdk/models/v1/contract_list_seat_balances_params.rb +119 -0
- data/lib/metronome_sdk/models/v1/contract_list_seat_balances_response.rb +315 -0
- data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +31 -1
- data/lib/metronome_sdk/models/v1/contracts/product_update_params.rb +31 -1
- data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +1 -0
- data/lib/metronome_sdk/models/v1/customers/invoice.rb +8 -1
- data/lib/metronome_sdk/models/v1/customers/invoice_list_params.rb +29 -1
- data/lib/metronome_sdk/models/v1/package_create_params.rb +2 -30
- data/lib/metronome_sdk/models/v1/package_list_response.rb +28 -9
- data/lib/metronome_sdk/models/v1/package_retrieve_response.rb +29 -9
- data/lib/metronome_sdk/models/v2/contract_edit_params.rb +67 -20
- data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +496 -15
- data/lib/metronome_sdk/resources/v1/contracts/products.rb +6 -2
- data/lib/metronome_sdk/resources/v1/contracts.rb +76 -2
- data/lib/metronome_sdk/resources/v1/customers/invoices.rb +5 -1
- data/lib/metronome_sdk/resources/v1/packages.rb +1 -3
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +3 -1
- data/rbi/metronome_sdk/internal/util.rbi +8 -0
- data/rbi/metronome_sdk/models/base_threshold_commit.rbi +24 -5
- data/rbi/metronome_sdk/models/contract_v2.rbi +916 -19
- data/rbi/metronome_sdk/models/credit.rbi +139 -3
- data/rbi/metronome_sdk/models/override.rbi +9 -12
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +54 -3
- data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +55 -4
- data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +54 -3
- data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +58 -9
- data/rbi/metronome_sdk/models/update_base_threshold_commit.rbi +22 -4
- data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +3 -416
- data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +5 -418
- data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_params.rbi +179 -0
- data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_response.rbi +714 -0
- data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +74 -0
- data/rbi/metronome_sdk/models/v1/contracts/product_update_params.rbi +74 -0
- data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +9 -0
- data/rbi/metronome_sdk/models/v1/customers/invoice_list_params.rbi +75 -0
- data/rbi/metronome_sdk/models/v1/package_create_params.rbi +3 -76
- data/rbi/metronome_sdk/models/v1/package_list_response.rbi +72 -15
- data/rbi/metronome_sdk/models/v1/package_retrieve_response.rbi +72 -17
- data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +133 -28
- data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1174 -145
- data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +18 -0
- data/rbi/metronome_sdk/resources/v1/contracts.rbi +88 -3
- data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +7 -0
- data/rbi/metronome_sdk/resources/v1/packages.rbi +0 -3
- data/sig/metronome_sdk/internal/util.rbs +4 -0
- data/sig/metronome_sdk/models/base_threshold_commit.rbs +13 -3
- data/sig/metronome_sdk/models/contract_v2.rbs +401 -16
- data/sig/metronome_sdk/models/credit.rbs +69 -0
- data/sig/metronome_sdk/models/override.rbs +8 -10
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +22 -3
- data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +23 -4
- data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +22 -3
- data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +26 -7
- data/sig/metronome_sdk/models/update_base_threshold_commit.rbs +15 -2
- data/sig/metronome_sdk/models/v1/alert_create_params.rbs +3 -1
- data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +3 -147
- data/sig/metronome_sdk/models/v1/contract_create_params.rbs +3 -147
- data/sig/metronome_sdk/models/v1/contract_list_seat_balances_params.rbs +96 -0
- data/sig/metronome_sdk/models/v1/contract_list_seat_balances_response.rbs +299 -0
- data/sig/metronome_sdk/models/v1/contracts/product_create_params.rbs +20 -0
- data/sig/metronome_sdk/models/v1/contracts/product_update_params.rbs +20 -0
- data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +3 -1
- data/sig/metronome_sdk/models/v1/customers/invoice.rbs +7 -0
- data/sig/metronome_sdk/models/v1/customers/invoice_list_params.rbs +29 -1
- data/sig/metronome_sdk/models/v1/package_create_params.rbs +3 -30
- data/sig/metronome_sdk/models/v1/package_list_response.rbs +33 -15
- data/sig/metronome_sdk/models/v1/package_retrieve_response.rbs +33 -15
- data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +33 -10
- data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +409 -19
- data/sig/metronome_sdk/resources/v1/contracts/products.rbs +2 -0
- data/sig/metronome_sdk/resources/v1/contracts.rbs +15 -0
- data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +2 -0
- data/sig/metronome_sdk/resources/v1/packages.rbs +0 -1
- metadata +8 -2
|
@@ -15,7 +15,7 @@ module MetronomeSDK
|
|
|
15
15
|
# an ERP system. Give the product a meaningful name as they will appear on
|
|
16
16
|
# customer invoices.
|
|
17
17
|
#
|
|
18
|
-
# @overload create(name:, type:, billable_metric_id: nil, composite_product_ids: nil, composite_tags: nil, custom_fields: nil, exclude_free_usage: nil, is_refundable: nil, netsuite_internal_item_id: nil, netsuite_overage_item_id: nil, presentation_group_key: nil, pricing_group_key: nil, quantity_conversion: nil, quantity_rounding: nil, tags: nil, request_options: {})
|
|
18
|
+
# @overload create(name:, type:, billable_metric_id: nil, composite_product_ids: nil, composite_tags: nil, custom_fields: nil, exclude_free_usage: nil, is_refundable: nil, netsuite_internal_item_id: nil, netsuite_overage_item_id: nil, presentation_group_key: nil, pricing_group_key: nil, quantity_conversion: nil, quantity_rounding: nil, sql_breakdown_granularity: nil, tags: nil, request_options: {})
|
|
19
19
|
#
|
|
20
20
|
# @param name [String] displayed on invoices
|
|
21
21
|
#
|
|
@@ -45,6 +45,8 @@ module MetronomeSDK
|
|
|
45
45
|
#
|
|
46
46
|
# @param quantity_rounding [MetronomeSDK::Models::V1::Contracts::QuantityRounding, nil] Optional. Only valid for USAGE products. If provided, the quantity will be round
|
|
47
47
|
#
|
|
48
|
+
# @param sql_breakdown_granularity [Symbol, MetronomeSDK::Models::V1::Contracts::ProductCreateParams::SqlBreakdownGranularity] Defines the breakdown behavior when calculating usage from SQL Billable Metrics.
|
|
49
|
+
#
|
|
48
50
|
# @param tags [Array<String>]
|
|
49
51
|
#
|
|
50
52
|
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
@@ -99,7 +101,7 @@ module MetronomeSDK
|
|
|
99
101
|
# - Product type cannot be changed after creation. For incorrect product types,
|
|
100
102
|
# create a new product and archive the original instead.
|
|
101
103
|
#
|
|
102
|
-
# @overload update(product_id:, starting_at:, billable_metric_id: nil, composite_product_ids: nil, composite_tags: nil, exclude_free_usage: nil, is_refundable: nil, name: nil, netsuite_internal_item_id: nil, netsuite_overage_item_id: nil, presentation_group_key: nil, pricing_group_key: nil, quantity_conversion: nil, quantity_rounding: nil, tags: nil, request_options: {})
|
|
104
|
+
# @overload update(product_id:, starting_at:, billable_metric_id: nil, composite_product_ids: nil, composite_tags: nil, exclude_free_usage: nil, is_refundable: nil, name: nil, netsuite_internal_item_id: nil, netsuite_overage_item_id: nil, presentation_group_key: nil, pricing_group_key: nil, quantity_conversion: nil, quantity_rounding: nil, sql_breakdown_granularity: nil, tags: nil, request_options: {})
|
|
103
105
|
#
|
|
104
106
|
# @param product_id [String] ID of the product to update
|
|
105
107
|
#
|
|
@@ -129,6 +131,8 @@ module MetronomeSDK
|
|
|
129
131
|
#
|
|
130
132
|
# @param quantity_rounding [MetronomeSDK::Models::V1::Contracts::QuantityRounding, nil] Optional. Only valid for USAGE products. If provided, the quantity will be round
|
|
131
133
|
#
|
|
134
|
+
# @param sql_breakdown_granularity [Symbol, MetronomeSDK::Models::V1::Contracts::ProductUpdateParams::SqlBreakdownGranularity] Defines the breakdown behavior when calculating usage from SQL Billable Metrics.
|
|
135
|
+
#
|
|
132
136
|
# @param tags [Array<String>] If not provided, defaults to product's current tags
|
|
133
137
|
#
|
|
134
138
|
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
@@ -22,8 +22,8 @@ module MetronomeSDK
|
|
|
22
22
|
#
|
|
23
23
|
# Contracts define a customer's products, pricing, discounts, access duration, and
|
|
24
24
|
# billing configuration. Contracts serve as the central billing agreement for both
|
|
25
|
-
# PLG and Enterprise customers
|
|
26
|
-
# products and services directly from your product or CRM.
|
|
25
|
+
# PLG and Enterprise customers. You can automatically grant customers access to
|
|
26
|
+
# your products and services directly from your product or CRM.
|
|
27
27
|
#
|
|
28
28
|
# ### Use this endpoint to:
|
|
29
29
|
#
|
|
@@ -525,6 +525,10 @@ module MetronomeSDK
|
|
|
525
525
|
#
|
|
526
526
|
# ### Usage guidelines:
|
|
527
527
|
#
|
|
528
|
+
# - **Balance ledger details**: Use the
|
|
529
|
+
# [listBalances](https://docs.metronome.com/api-reference/credits-and-commits/list-balances)
|
|
530
|
+
# endpoint instead to understand detailed ledger drawdowns for each individual
|
|
531
|
+
# balance
|
|
528
532
|
# - **Draft invoice handling**: Use `invoice_inclusion_mode` to control whether
|
|
529
533
|
# pending draft invoice deductions are included (`FINALIZED_AND_DRAFT`, the
|
|
530
534
|
# default) or excluded (`FINALIZED`) from the balance calculation
|
|
@@ -590,6 +594,9 @@ module MetronomeSDK
|
|
|
590
594
|
#
|
|
591
595
|
# ### Usage guidelines:
|
|
592
596
|
#
|
|
597
|
+
# - Use the
|
|
598
|
+
# [getNetBalance](https://docs.metronome.com/api-reference/credits-and-commits/get-the-net-balance-of-a-customer)
|
|
599
|
+
# endpoint to retrieve a single combined current balance
|
|
593
600
|
# - Date filtering: Use `effective_before` to include only balances with access
|
|
594
601
|
# before a specific date (exclusive)
|
|
595
602
|
# - Set `include_balance=true` for calculated balance amounts on each commit or
|
|
@@ -643,6 +650,73 @@ module MetronomeSDK
|
|
|
643
650
|
)
|
|
644
651
|
end
|
|
645
652
|
|
|
653
|
+
# Some parameter documentations has been truncated, see
|
|
654
|
+
# {MetronomeSDK::Models::V1::ContractListSeatBalancesParams} for more details.
|
|
655
|
+
#
|
|
656
|
+
# Retrieve detailed balance for seat-based credits and commits from the contract's
|
|
657
|
+
# subscriptions, broken down by individual seats.
|
|
658
|
+
#
|
|
659
|
+
# ### Use this endpoint to:
|
|
660
|
+
#
|
|
661
|
+
# - Display per-seat balance information in customer dashboards
|
|
662
|
+
# - Filter balance data by subscription or specific seats
|
|
663
|
+
#
|
|
664
|
+
# ### Key response fields:
|
|
665
|
+
#
|
|
666
|
+
# An array of seat balance objects containing:
|
|
667
|
+
#
|
|
668
|
+
# - Seat id
|
|
669
|
+
# - Balance: current total balance across all commits and credits
|
|
670
|
+
#
|
|
671
|
+
# ### Usage guidelines:
|
|
672
|
+
#
|
|
673
|
+
# - Date filtering: use `covering_date` OR `starting_at`/`ending_before` to filter
|
|
674
|
+
# balance data by time range
|
|
675
|
+
# - Set `include_credits_and_commits=true` for detailed commits and credits
|
|
676
|
+
# breakdown per seat
|
|
677
|
+
# - Set `include_ledgers=true` for detailed transaction history per commit/credit
|
|
678
|
+
# per seat
|
|
679
|
+
#
|
|
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: {})
|
|
681
|
+
#
|
|
682
|
+
# @param contract_id [String] The contract ID to retrieve seat balances for
|
|
683
|
+
#
|
|
684
|
+
# @param customer_id [String] The customer ID to retrieve seat balances for
|
|
685
|
+
#
|
|
686
|
+
# @param covering_date [Time] Include only commits or credits with access that cover this specific date (canno
|
|
687
|
+
#
|
|
688
|
+
# @param cursor [String] Page token from a previous response to retrieve the next page
|
|
689
|
+
#
|
|
690
|
+
# @param effective_before [Time] Include only commits or credits with access effective on or before this date (ca
|
|
691
|
+
#
|
|
692
|
+
# @param include_credits_and_commits [Boolean] Include credits and commits in the response
|
|
693
|
+
#
|
|
694
|
+
# @param include_ledgers [Boolean] Include ledger entries for each commit and commit. `include_credits_and_commits`
|
|
695
|
+
#
|
|
696
|
+
# @param limit [Integer] Maximum number of seats to return. Range: 1-100. Default: 25.
|
|
697
|
+
#
|
|
698
|
+
# @param seat_ids [Array<String>] Optional filter to only include specific seats.
|
|
699
|
+
#
|
|
700
|
+
# @param starting_at [Time] Include only commits or credits with access effective on or after this date (can
|
|
701
|
+
#
|
|
702
|
+
# @param subscription_ids [Array<String>] Optional filter to only include seats from specific subscriptions. If subscripti
|
|
703
|
+
#
|
|
704
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
705
|
+
#
|
|
706
|
+
# @return [MetronomeSDK::Models::V1::ContractListSeatBalancesResponse]
|
|
707
|
+
#
|
|
708
|
+
# @see MetronomeSDK::Models::V1::ContractListSeatBalancesParams
|
|
709
|
+
def list_seat_balances(params)
|
|
710
|
+
parsed, options = MetronomeSDK::V1::ContractListSeatBalancesParams.dump_request(params)
|
|
711
|
+
@client.request(
|
|
712
|
+
method: :post,
|
|
713
|
+
path: "v1/contracts/seatBalances/list",
|
|
714
|
+
body: parsed,
|
|
715
|
+
model: MetronomeSDK::Models::V1::ContractListSeatBalancesResponse,
|
|
716
|
+
options: options
|
|
717
|
+
)
|
|
718
|
+
end
|
|
719
|
+
|
|
646
720
|
# Some parameter documentations has been truncated, see
|
|
647
721
|
# {MetronomeSDK::Models::V1::ContractRetrieveRateScheduleParams} for more details.
|
|
648
722
|
#
|
|
@@ -136,10 +136,12 @@ 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:, 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, 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, request_options: {})
|
|
140
140
|
#
|
|
141
141
|
# @param customer_id [String] Path param
|
|
142
142
|
#
|
|
143
|
+
# @param contract_id [String] Query param: Only return invoices for the specified contract
|
|
144
|
+
#
|
|
143
145
|
# @param credit_type_id [String] Query param: Only return invoices for the specified credit type
|
|
144
146
|
#
|
|
145
147
|
# @param ending_before [Time] Query param: RFC 3339 timestamp (exclusive). Invoices will only be returned for
|
|
@@ -156,6 +158,8 @@ module MetronomeSDK
|
|
|
156
158
|
#
|
|
157
159
|
# @param status [String] Query param: Invoice status, e.g. DRAFT, FINALIZED, or VOID
|
|
158
160
|
#
|
|
161
|
+
# @param type [Symbol, MetronomeSDK::Models::V1::Customers::InvoiceListParams::Type] Query param: Filter invoices by type. Defaults to returning all invoice types.
|
|
162
|
+
#
|
|
159
163
|
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
160
164
|
#
|
|
161
165
|
# @return [MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::Customers::Invoice>]
|
|
@@ -58,14 +58,12 @@ 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,
|
|
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: {})
|
|
62
62
|
#
|
|
63
63
|
# @param name [String]
|
|
64
64
|
#
|
|
65
65
|
# @param aliases [Array<MetronomeSDK::Models::V1::PackageCreateParams::Alias>] Reference this alias when creating a contract. If the same alias is assigned to
|
|
66
66
|
#
|
|
67
|
-
# @param billing_anchor_date [Symbol, MetronomeSDK::Models::V1::PackageCreateParams::BillingAnchorDate]
|
|
68
|
-
#
|
|
69
67
|
# @param billing_provider [Symbol, MetronomeSDK::Models::V1::PackageCreateParams::BillingProvider]
|
|
70
68
|
#
|
|
71
69
|
# @param commits [Array<MetronomeSDK::Models::V1::PackageCreateParams::Commit>]
|
data/lib/metronome_sdk.rb
CHANGED
|
@@ -56,9 +56,9 @@ require_relative "metronome_sdk/internal/body_cursor_page"
|
|
|
56
56
|
require_relative "metronome_sdk/internal/cursor_page"
|
|
57
57
|
require_relative "metronome_sdk/internal/cursor_page_without_limit"
|
|
58
58
|
require_relative "metronome_sdk/models/base_threshold_commit"
|
|
59
|
-
require_relative "metronome_sdk/models/update_base_threshold_commit"
|
|
60
59
|
require_relative "metronome_sdk/models/id"
|
|
61
60
|
require_relative "metronome_sdk/models/v1/customers/invoice"
|
|
61
|
+
require_relative "metronome_sdk/models/update_base_threshold_commit"
|
|
62
62
|
require_relative "metronome_sdk/models/balance_filter"
|
|
63
63
|
require_relative "metronome_sdk/models/base_usage_filter"
|
|
64
64
|
require_relative "metronome_sdk/models/commit"
|
|
@@ -121,6 +121,8 @@ require_relative "metronome_sdk/models/v1/contract_list_balances_params"
|
|
|
121
121
|
require_relative "metronome_sdk/models/v1/contract_list_balances_response"
|
|
122
122
|
require_relative "metronome_sdk/models/v1/contract_list_params"
|
|
123
123
|
require_relative "metronome_sdk/models/v1/contract_list_response"
|
|
124
|
+
require_relative "metronome_sdk/models/v1/contract_list_seat_balances_params"
|
|
125
|
+
require_relative "metronome_sdk/models/v1/contract_list_seat_balances_response"
|
|
124
126
|
require_relative "metronome_sdk/models/v1/contract_retrieve_params"
|
|
125
127
|
require_relative "metronome_sdk/models/v1/contract_retrieve_rate_schedule_params"
|
|
126
128
|
require_relative "metronome_sdk/models/v1/contract_retrieve_rate_schedule_response"
|
|
@@ -148,12 +148,20 @@ module MetronomeSDK
|
|
|
148
148
|
end
|
|
149
149
|
end
|
|
150
150
|
|
|
151
|
+
# https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
|
|
152
|
+
RFC_3986_NOT_PCHARS = T.let(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/, Regexp)
|
|
153
|
+
|
|
151
154
|
class << self
|
|
152
155
|
# @api private
|
|
153
156
|
sig { params(uri: URI::Generic).returns(String) }
|
|
154
157
|
def uri_origin(uri)
|
|
155
158
|
end
|
|
156
159
|
|
|
160
|
+
# @api private
|
|
161
|
+
sig { params(path: T.any(String, Integer)).returns(String) }
|
|
162
|
+
def encode_path(path)
|
|
163
|
+
end
|
|
164
|
+
|
|
157
165
|
# @api private
|
|
158
166
|
sig { params(path: T.any(String, T::Array[String])).returns(String) }
|
|
159
167
|
def interpolate_path(path)
|
|
@@ -30,10 +30,21 @@ module MetronomeSDK
|
|
|
30
30
|
sig { params(name: String).void }
|
|
31
31
|
attr_writer :name
|
|
32
32
|
|
|
33
|
+
# The priority of the commit, used to determine drawdown order. Lower priority
|
|
34
|
+
# commits are consumed first. Defaults to 100 if not specified.
|
|
35
|
+
sig { returns(T.nilable(Float)) }
|
|
36
|
+
attr_reader :priority
|
|
37
|
+
|
|
38
|
+
sig { params(priority: Float).void }
|
|
39
|
+
attr_writer :priority
|
|
40
|
+
|
|
33
41
|
sig do
|
|
34
|
-
params(
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
params(
|
|
43
|
+
product_id: String,
|
|
44
|
+
description: String,
|
|
45
|
+
name: String,
|
|
46
|
+
priority: Float
|
|
47
|
+
).returns(T.attached_class)
|
|
37
48
|
end
|
|
38
49
|
def self.new(
|
|
39
50
|
# The commit product that will be used to generate the line item for commit
|
|
@@ -42,13 +53,21 @@ module MetronomeSDK
|
|
|
42
53
|
description: nil,
|
|
43
54
|
# Specify the name of the line item for the threshold charge. If left blank, it
|
|
44
55
|
# will default to the commit product name.
|
|
45
|
-
name: nil
|
|
56
|
+
name: nil,
|
|
57
|
+
# The priority of the commit, used to determine drawdown order. Lower priority
|
|
58
|
+
# commits are consumed first. Defaults to 100 if not specified.
|
|
59
|
+
priority: nil
|
|
46
60
|
)
|
|
47
61
|
end
|
|
48
62
|
|
|
49
63
|
sig do
|
|
50
64
|
override.returns(
|
|
51
|
-
{
|
|
65
|
+
{
|
|
66
|
+
product_id: String,
|
|
67
|
+
description: String,
|
|
68
|
+
name: String,
|
|
69
|
+
priority: Float
|
|
70
|
+
}
|
|
52
71
|
)
|
|
53
72
|
end
|
|
54
73
|
def to_hash
|