Class: MetronomeSDK::Models::Rate

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/metronome_sdk/models/rate.rb

Defined Under Namespace

Modules: RateType

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(rate_type: , credit_type: nil, custom_rate: nil, is_prorated: nil, price: nil, pricing_group_values: nil, quantity: nil, tiers: nil, use_list_prices: nil) ⇒ Object

Some parameter documentations has been truncated, see MetronomeSDK::Models::Rate for more details.

Parameters:

  • rate_type (Symbol, MetronomeSDK::Models::Rate::RateType) (defaults to: )
  • credit_type (MetronomeSDK::Models::CreditTypeData) (defaults to: nil)
  • custom_rate (Hash{Symbol=>Object}) (defaults to: nil)

    Only set for CUSTOM rate_type. This field is interpreted by custom rate processo

  • is_prorated (Boolean) (defaults to: nil)

    Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be

  • price (Float) (defaults to: nil)

    Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, t

  • pricing_group_values (Hash{Symbol=>String}) (defaults to: nil)

    if pricing groups are used, this will contain the values used to calculate the p

  • quantity (Float) (defaults to: nil)

    Default quantity. For SUBSCRIPTION rate_type, this must be >=0.

  • tiers (Array<MetronomeSDK::Models::Tier>) (defaults to: nil)

    Only set for TIERED rate_type.

  • use_list_prices (Boolean) (defaults to: nil)

    Only set for PERCENTAGE rate_type. Defaults to false. If true, rate is computed



# File 'lib/metronome_sdk/models/rate.rb', line 64


Instance Attribute Details

#credit_typeMetronomeSDK::Models::CreditTypeData?



14
# File 'lib/metronome_sdk/models/rate.rb', line 14

optional :credit_type, -> { MetronomeSDK::CreditTypeData }

#custom_rateHash{Symbol=>Object}?

Only set for CUSTOM rate_type. This field is interpreted by custom rate processors.

Returns:

  • (Hash{Symbol=>Object}, nil)


21
# File 'lib/metronome_sdk/models/rate.rb', line 21

optional :custom_rate, MetronomeSDK::Internal::Type::HashOf[MetronomeSDK::Internal::Type::Unknown]

#is_proratedBoolean?

Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true.

Returns:

  • (Boolean, nil)


28
# File 'lib/metronome_sdk/models/rate.rb', line 28

optional :is_prorated, MetronomeSDK::Internal::Type::Boolean

#priceFloat?

Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.

Returns:

  • (Float, nil)


35
# File 'lib/metronome_sdk/models/rate.rb', line 35

optional :price, Float

#pricing_group_valuesHash{Symbol=>String}?

if pricing groups are used, this will contain the values used to calculate the price

Returns:

  • (Hash{Symbol=>String}, nil)


42
# File 'lib/metronome_sdk/models/rate.rb', line 42

optional :pricing_group_values, MetronomeSDK::Internal::Type::HashOf[String]

#quantityFloat?

Default quantity. For SUBSCRIPTION rate_type, this must be >=0.

Returns:

  • (Float, nil)


48
# File 'lib/metronome_sdk/models/rate.rb', line 48

optional :quantity, Float

#rate_typeSymbol, MetronomeSDK::Models::Rate::RateType



9
# File 'lib/metronome_sdk/models/rate.rb', line 9

required :rate_type, enum: -> { MetronomeSDK::Rate::RateType }

#tiersArray<MetronomeSDK::Models::Tier>?

Only set for TIERED rate_type.

Returns:



54
# File 'lib/metronome_sdk/models/rate.rb', line 54

optional :tiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Tier] }

#use_list_pricesBoolean?

Only set for PERCENTAGE rate_type. Defaults to false. If true, rate is computed using list prices rather than the standard rates for this product on the contract.

Returns:

  • (Boolean, nil)


62
# File 'lib/metronome_sdk/models/rate.rb', line 62

optional :use_list_prices, MetronomeSDK::Internal::Type::Boolean