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.



4479
4480
4481
# File 'generated/google/apis/content_v2_1/classes.rb', line 4479

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



4413
4414
4415
# File 'generated/google/apis/content_v2_1/classes.rb', line 4413

def applicable_items
  @applicable_items
end

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

Items which this promotion have been applied to. Do not provide for orders. createtestorder. Corresponds to the JSON property appliedItems



4419
4420
4421
# File 'generated/google/apis/content_v2_1/classes.rb', line 4419

def applied_items
  @applied_items
end

#end_timeString

Promotion end time in ISO 8601 format. Date, time, and offset required, e.g., " 2020-01-02T09:00:00+01:00" or "2020-01-02T09:00:00Z". Corresponds to the JSON property endTime

Returns:

  • (String)


4425
4426
4427
# File 'generated/google/apis/content_v2_1/classes.rb', line 4425

def end_time
  @end_time
end

#funderString

The party funding the promotion. Only merchant is supported for orders. createtestorder. Corresponds to the JSON property funder

Returns:

  • (String)


4431
4432
4433
# File 'generated/google/apis/content_v2_1/classes.rb', line 4431

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)


4436
4437
4438
# File 'generated/google/apis/content_v2_1/classes.rb', line 4436

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



4442
4443
4444
# File 'generated/google/apis/content_v2_1/classes.rb', line 4442

def price_value
  @price_value
end

#short_titleString

A short title of the promotion to be shown on the checkout page. Do not provide for orders.createtestorder. Corresponds to the JSON property shortTitle

Returns:

  • (String)


4448
4449
4450
# File 'generated/google/apis/content_v2_1/classes.rb', line 4448

def short_title
  @short_title
end

#start_timeString

Promotion start time in ISO 8601 format. Date, time, and offset required, e.g., "2020-01-02T09:00:00+01:00" or "2020-01-02T09:00:00Z". Corresponds to the JSON property startTime

Returns:

  • (String)


4454
4455
4456
# File 'generated/google/apis/content_v2_1/classes.rb', line 4454

def start_time
  @start_time
end

#subtypeString

The category of the promotion. Only moneyOff is supported for orders. createtestorder. Corresponds to the JSON property subtype

Returns:

  • (String)


4460
4461
4462
# File 'generated/google/apis/content_v2_1/classes.rb', line 4460

def subtype
  @subtype
end

#tax_valueGoogle::Apis::ContentV2_1::Price

Estimated discount applied to tax (if allowed by law). Do not provide for orders.createtestorder. Corresponds to the JSON property taxValue



4466
4467
4468
# File 'generated/google/apis/content_v2_1/classes.rb', line 4466

def tax_value
  @tax_value
end

#titleString

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

Returns:

  • (String)


4471
4472
4473
# File 'generated/google/apis/content_v2_1/classes.rb', line 4471

def title
  @title
end

#typeString

The scope of the promotion. Only product is supported for orders. createtestorder. Corresponds to the JSON property type

Returns:

  • (String)


4477
4478
4479
# File 'generated/google/apis/content_v2_1/classes.rb', line 4477

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
# File 'generated/google/apis/content_v2_1/classes.rb', line 4484

def update!(**args)
  @applicable_items = args[:applicable_items] if args.key?(:applicable_items)
  @applied_items = args[:applied_items] if args.key?(:applied_items)
  @end_time = args[:end_time] if args.key?(:end_time)
  @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)
  @start_time = args[:start_time] if args.key?(:start_time)
  @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