Class: Google::Apis::ContentV2_1::OrderPromotion

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
generated/google/apis/content_v2_1/classes.rb,
generated/google/apis/content_v2_1/representations.rb,
generated/google/apis/content_v2_1/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) ⇒ OrderPromotion

Returns a new instance of OrderPromotion



4239
4240
4241
# File 'generated/google/apis/content_v2_1/classes.rb', line 4239

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

Instance Attribute Details

#applicable_itemsArray<Google::Apis::ContentV2_1::OrderPromotionItem>

Items which this promotion may be applied to. If empty, there are no restrictions on applicable items and quantity. Corresponds to the JSON property applicableItems



4191
4192
4193
# File 'generated/google/apis/content_v2_1/classes.rb', line 4191

def applicable_items
  @applicable_items
end

#applied_itemsArray<Google::Apis::ContentV2_1::OrderPromotionItem>

Items which this promotion have been applied to. Corresponds to the JSON property appliedItems



4196
4197
4198
# File 'generated/google/apis/content_v2_1/classes.rb', line 4196

def applied_items
  @applied_items
end

#funderString

The party funding the promotion. Corresponds to the JSON property funder

Returns:

  • (String)


4201
4202
4203
# File 'generated/google/apis/content_v2_1/classes.rb', line 4201

def funder
  @funder
end

#merchant_promotion_idString

This field is used to identify promotions within merchants' own systems. Corresponds to the JSON property merchantPromotionId

Returns:

  • (String)


4206
4207
4208
# File 'generated/google/apis/content_v2_1/classes.rb', line 4206

def merchant_promotion_id
  @merchant_promotion_id
end

#price_valueGoogle::Apis::ContentV2_1::Price

Estimated discount applied to price. Amount is pre-tax or post-tax depending on location of order. Corresponds to the JSON property priceValue



4212
4213
4214
# File 'generated/google/apis/content_v2_1/classes.rb', line 4212

def price_value
  @price_value
end

#short_titleString

A short title of the promotion to be shown on the checkout page. Corresponds to the JSON property shortTitle

Returns:

  • (String)


4217
4218
4219
# File 'generated/google/apis/content_v2_1/classes.rb', line 4217

def short_title
  @short_title
end

#subtypeString

The category of the promotion. Corresponds to the JSON property subtype

Returns:

  • (String)


4222
4223
4224
# File 'generated/google/apis/content_v2_1/classes.rb', line 4222

def subtype
  @subtype
end

#tax_valueGoogle::Apis::ContentV2_1::Price

Estimated discount applied to tax (if allowed by law). Corresponds to the JSON property taxValue



4227
4228
4229
# File 'generated/google/apis/content_v2_1/classes.rb', line 4227

def tax_value
  @tax_value
end

#titleString

The title of the promotion. Corresponds to the JSON property title

Returns:

  • (String)


4232
4233
4234
# File 'generated/google/apis/content_v2_1/classes.rb', line 4232

def title
  @title
end

#typeString

The scope of the promotion. Corresponds to the JSON property type

Returns:

  • (String)


4237
4238
4239
# File 'generated/google/apis/content_v2_1/classes.rb', line 4237

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
# File 'generated/google/apis/content_v2_1/classes.rb', line 4244

def update!(**args)
  @applicable_items = args[:applicable_items] if args.key?(:applicable_items)
  @applied_items = args[:applied_items] if args.key?(:applied_items)
  @funder = args[:funder] if args.key?(:funder)
  @merchant_promotion_id = args[:merchant_promotion_id] if args.key?(:merchant_promotion_id)
  @price_value = args[:price_value] if args.key?(:price_value)
  @short_title = args[:short_title] if args.key?(:short_title)
  @subtype = args[:subtype] if args.key?(:subtype)
  @tax_value = args[:tax_value] if args.key?(:tax_value)
  @title = args[:title] if args.key?(:title)
  @type = args[:type] if args.key?(:type)
end