Class: Google::Apis::ContentV2::AccountShippingShippingServiceCostRule

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
generated/google/apis/content_v2/classes.rb,
generated/google/apis/content_v2/representations.rb,
generated/google/apis/content_v2/representations.rb

Overview

Building block of the cost calculation decision tree.

  • The tree root should have no condition and no calculation method.
  • All the children must have a condition on the same dimension. The first child matching a condition is entered, therefore, price and weight conditions form contiguous intervals.
  • The last child of an element must have no condition and matches all elements not previously matched.
  • Children and calculation method are mutually exclusive, and exactly one of them must be defined; the root must only have children.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ AccountShippingShippingServiceCostRule

Returns a new instance of AccountShippingShippingServiceCostRule.



609
610
611
# File 'generated/google/apis/content_v2/classes.rb', line 609

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#calculation_methodGoogle::Apis::ContentV2::AccountShippingShippingServiceCalculationMethod

Shipping cost calculation method. Exactly one of the field is set. Corresponds to the JSON property calculationMethod



595
596
597
# File 'generated/google/apis/content_v2/classes.rb', line 595

def calculation_method
  @calculation_method
end

#childrenArray<Google::Apis::ContentV2::AccountShippingShippingServiceCostRule>

Subsequent rules to be applied, only for inner nodes. The last child must not specify a condition and acts as a catch-all. Corresponds to the JSON property children



601
602
603
# File 'generated/google/apis/content_v2/classes.rb', line 601

def children
  @children
end

#conditionGoogle::Apis::ContentV2::AccountShippingCondition

Condition for this rule to be applicable. If no condition is specified, the rule acts as a catch-all. Corresponds to the JSON property condition



607
608
609
# File 'generated/google/apis/content_v2/classes.rb', line 607

def condition
  @condition
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



614
615
616
617
618
# File 'generated/google/apis/content_v2/classes.rb', line 614

def update!(**args)
  @calculation_method = args[:calculation_method] if args.key?(:calculation_method)
  @children = args[:children] if args.key?(:children)
  @condition = args[:condition] if args.key?(:condition)
end