Class: MetronomeSDK::Resources::V1::Contracts::RateCards::Rates
- Inherits:
-
Object
- Object
- MetronomeSDK::Resources::V1::Contracts::RateCards::Rates
- Defined in:
- lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb
Instance Method Summary collapse
-
#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, use_list_prices: nil, request_options: {}) ⇒ MetronomeSDK::Models::V1::Contracts::RateCards::RateAddResponse
Some parameter documentations has been truncated, see Models::V1::Contracts::RateCards::RateAddParams for more details.
-
#add_many(rate_card_id: , rates: , request_options: {}) ⇒ MetronomeSDK::Models::V1::Contracts::RateCards::RateAddManyResponse
Add new rates.
-
#initialize(client:) ⇒ Rates
constructor
private
A new instance of Rates.
-
#list(at: , rate_card_id: , limit: nil, next_page: nil, selectors: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::Contracts::RateCards::RateListResponse>
Some parameter documentations has been truncated, see Models::V1::Contracts::RateCards::RateListParams for more details.
Constructor Details
#initialize(client:) ⇒ Rates
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Rates.
135 136 137 |
# File 'lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb', line 135 def initialize(client:) @client = client end |
Instance Method Details
#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, use_list_prices: nil, request_options: {}) ⇒ MetronomeSDK::Models::V1::Contracts::RateCards::RateAddResponse
Some parameter documentations has been truncated, see Models::V1::Contracts::RateCards::RateAddParams for more details.
Add a new rate
99 100 101 102 103 104 105 106 107 108 |
# File 'lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb', line 99 def add(params) parsed, = MetronomeSDK::V1::Contracts::RateCards::RateAddParams.dump_request(params) @client.request( method: :post, path: "v1/contract-pricing/rate-cards/addRate", body: parsed, model: MetronomeSDK::Models::V1::Contracts::RateCards::RateAddResponse, options: ) end |
#add_many(rate_card_id: , rates: , request_options: {}) ⇒ MetronomeSDK::Models::V1::Contracts::RateCards::RateAddManyResponse
Add new rates
121 122 123 124 125 126 127 128 129 130 |
# File 'lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb', line 121 def add_many(params) parsed, = MetronomeSDK::V1::Contracts::RateCards::RateAddManyParams.dump_request(params) @client.request( method: :post, path: "v1/contract-pricing/rate-cards/addRates", body: parsed, model: MetronomeSDK::Models::V1::Contracts::RateCards::RateAddManyResponse, options: ) end |
#list(at: , rate_card_id: , limit: nil, next_page: nil, selectors: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::Contracts::RateCards::RateListResponse>
Some parameter documentations has been truncated, see Models::V1::Contracts::RateCards::RateListParams for more details.
Understand the rate schedule at a given timestamp, optionally filtering the list of rates returned based on properties such as ‘product_id` and `pricing_group_values`. For example, you may want to display the current price for a given product in your product experience - use this endpoint to fetch that information from its source of truth in Metronome.
If you want to understand the rates for a specific customer’s contract, inclusive of contract-level overrides, use the ‘getContractRateSchedule` endpoint.
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb', line 40 def list(params) parsed, = MetronomeSDK::V1::Contracts::RateCards::RateListParams.dump_request(params) query_params = [:limit, :next_page] @client.request( method: :post, path: "v1/contract-pricing/rate-cards/getRates", query: parsed.slice(*query_params), body: parsed.except(*query_params), page: MetronomeSDK::Internal::CursorPage, model: MetronomeSDK::Models::V1::Contracts::RateCards::RateListResponse, options: ) end |