Class: MetronomeSDK::Resources::V1::PricingUnits

Inherits:
Object
  • Object
show all
Defined in:
lib/metronome_sdk/resources/v1/pricing_units.rb

Overview

Use these endpoints to configure a billing API key, a webhook secret, or invoice finalization behavior.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ PricingUnits

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 PricingUnits.

Parameters:



43
44
45
# File 'lib/metronome_sdk/resources/v1/pricing_units.rb', line 43

def initialize(client:)
  @client = client
end

Instance Method Details

#list(limit: nil, next_page: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::PricingUnitListResponse>

List all pricing units. All fiat currency types (for example, USD or GBP) will be included, as well as any custom pricing units that were configured. Custom pricing units can be used to charge for usage in a non-fiat pricing unit, for example AI credits.

Note: The USD (cents) pricing unit is 2714e483-4ff1-48e4-9e25-ac732e8f24f2.

Parameters:

  • limit (Integer)

    Max number of results that should be returned

  • next_page (String)

    Cursor that indicates where the next page of results should start.

  • request_options (MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/metronome_sdk/resources/v1/pricing_units.rb', line 27

def list(params = {})
  parsed, options = MetronomeSDK::V1::PricingUnitListParams.dump_request(params)
  query = MetronomeSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/credit-types/list",
    query: query,
    page: MetronomeSDK::Internal::CursorPage,
    model: MetronomeSDK::Models::V1::PricingUnitListResponse,
    options: options
  )
end