Class: Google::Apis::ContentV2sandbox::OrderPromotionBenefit

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

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) ⇒ OrderPromotionBenefit

Returns a new instance of OrderPromotionBenefit



1057
1058
1059
# File 'generated/google/apis/content_v2sandbox/classes.rb', line 1057

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

Instance Attribute Details

#discountGoogle::Apis::ContentV2sandbox::Price

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



1032
1033
1034
# File 'generated/google/apis/content_v2sandbox/classes.rb', line 1032

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>)


1038
1039
1040
# File 'generated/google/apis/content_v2sandbox/classes.rb', line 1038

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. Corresponds to the JSON property subType

Returns:

  • (String)


1044
1045
1046
# File 'generated/google/apis/content_v2sandbox/classes.rb', line 1044

def sub_type
  @sub_type
end

#tax_impactGoogle::Apis::ContentV2sandbox::Price

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



1049
1050
1051
# File 'generated/google/apis/content_v2sandbox/classes.rb', line 1049

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). Corresponds to the JSON property type

Returns:

  • (String)


1055
1056
1057
# File 'generated/google/apis/content_v2sandbox/classes.rb', line 1055

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1062
1063
1064
1065
1066
1067
1068
# File 'generated/google/apis/content_v2sandbox/classes.rb', line 1062

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