Class: Google::Apis::ContentV2::AccountShippingShippingServiceCostRule
- Inherits:
-
Object
- Object
- Google::Apis::ContentV2::AccountShippingShippingServiceCostRule
- 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
-
#calculation_method ⇒ Google::Apis::ContentV2::AccountShippingShippingServiceCalculationMethod
Shipping cost calculation method.
-
#children ⇒ Array<Google::Apis::ContentV2::AccountShippingShippingServiceCostRule>
Subsequent rules to be applied, only for inner nodes.
-
#condition ⇒ Google::Apis::ContentV2::AccountShippingCondition
Condition for this rule to be applicable.
Instance Method Summary collapse
-
#initialize(**args) ⇒ AccountShippingShippingServiceCostRule
constructor
A new instance of AccountShippingShippingServiceCostRule.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Google::Apis::Core::JsonObjectSupport
Methods included from Google::Apis::Core::Hashable
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_method ⇒ Google::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 |
#children ⇒ Array<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 |
#condition ⇒ Google::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 |