Class: Google::Apis::ContentV2::OrderLegacyPromotionBenefit

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ OrderLegacyPromotionBenefit

Returns a new instance of OrderLegacyPromotionBenefit.



4676
4677
4678
# File 'lib/google/apis/content_v2/classes.rb', line 4676

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

Instance Attribute Details

#discountGoogle::Apis::ContentV2::Price

The discount in the order price when the promotion is applied. Corresponds to the JSON property discount



4645
4646
4647
# File 'lib/google/apis/content_v2/classes.rb', line 4645

def discount
  @discount
end

#offer_idsArray<String>

The OfferId(s) that were purchased in this order and map to this specific benefit of the promotion. Corresponds to the JSON property offerIds

Returns:

  • (Array<String>)


4651
4652
4653
# File 'lib/google/apis/content_v2/classes.rb', line 4651

def offer_ids
  @offer_ids
end

#sub_typeString

Further describes the benefit of the promotion. Note that we will expand on this enumeration as we support new promotion sub-types. Acceptable values are:

  • "buyMGetMoneyOff" - "buyMGetNMoneyOff" - "buyMGetNPercentOff" - " buyMGetPercentOff" - "freeGift" - "freeGiftWithItemId" - " freeGiftWithValue" - "freeOvernightShipping" - "freeShipping" - " freeTwoDayShipping" - "moneyOff" - "percentageOff" - "rewardPoints" - " salePrice" Corresponds to the JSON property subType

Returns:

  • (String)


4662
4663
4664
# File 'lib/google/apis/content_v2/classes.rb', line 4662

def sub_type
  @sub_type
end

#tax_impactGoogle::Apis::ContentV2::Price

The impact on tax when the promotion is applied. Corresponds to the JSON property taxImpact



4667
4668
4669
# File 'lib/google/apis/content_v2/classes.rb', line 4667

def tax_impact
  @tax_impact
end

#typeString

Describes whether the promotion applies to products (e.g. 20% off) or to shipping (e.g. Free Shipping). Acceptable values are: - "product" - " shipping" Corresponds to the JSON property type

Returns:

  • (String)


4674
4675
4676
# File 'lib/google/apis/content_v2/classes.rb', line 4674

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4681
4682
4683
4684
4685
4686
4687
# File 'lib/google/apis/content_v2/classes.rb', line 4681

def update!(**args)
  @discount = args[:discount] if args.key?(:discount)
  @offer_ids = args[:offer_ids] if args.key?(:offer_ids)
  @sub_type = args[:sub_type] if args.key?(:sub_type)
  @tax_impact = args[:tax_impact] if args.key?(:tax_impact)
  @type = args[:type] if args.key?(:type)
end