Class: Orb::Models::PercentageDiscountInterval

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/orb/models/percentage_discount_interval.rb

Defined Under Namespace

Modules: DiscountType

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(applies_to_price_interval_ids: , discount_type: , end_date: , filters: , percentage_discount: , start_date: ) ⇒ Object

Some parameter documentations has been truncated, see Orb::Models::PercentageDiscountInterval for more details.

Parameters:

  • applies_to_price_interval_ids (Array<String>) (defaults to: )

    The price interval ids that this discount interval applies to.

  • discount_type (Symbol, Orb::Models::PercentageDiscountInterval::DiscountType) (defaults to: )
  • end_date (Time, nil) (defaults to: )

    The end date of the discount interval.

  • filters (Array<Orb::Models::TransformPriceFilter>) (defaults to: )

    The filters that determine which prices this discount interval applies to.

  • percentage_discount (Float) (defaults to: )

    Only available if discount_type is ‘percentage`.This is a number between 0 and 1

  • start_date (Time) (defaults to: )

    The start date of the discount interval.



# File 'lib/orb/models/percentage_discount_interval.rb', line 42


Instance Attribute Details

#applies_to_price_interval_idsArray<String>

The price interval ids that this discount interval applies to.

Returns:

  • (Array<String>)


10
# File 'lib/orb/models/percentage_discount_interval.rb', line 10

required :applies_to_price_interval_ids, Orb::Internal::Type::ArrayOf[String]

#discount_typeSymbol, Orb::Models::PercentageDiscountInterval::DiscountType



15
# File 'lib/orb/models/percentage_discount_interval.rb', line 15

required :discount_type, enum: -> { Orb::PercentageDiscountInterval::DiscountType }

#end_dateTime?

The end date of the discount interval.

Returns:

  • (Time, nil)


21
# File 'lib/orb/models/percentage_discount_interval.rb', line 21

required :end_date, Time, nil?: true

#filtersArray<Orb::Models::TransformPriceFilter>

The filters that determine which prices this discount interval applies to.



27
# File 'lib/orb/models/percentage_discount_interval.rb', line 27

required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }

#percentage_discountFloat

Only available if discount_type is ‘percentage`.This is a number between 0 and 1.

Returns:

  • (Float)


34
# File 'lib/orb/models/percentage_discount_interval.rb', line 34

required :percentage_discount, Float

#start_dateTime

The start date of the discount interval.

Returns:

  • (Time)


40
# File 'lib/orb/models/percentage_discount_interval.rb', line 40

required :start_date, Time