class Google::Apis::ContentV2_1::OrderPromotion

Attributes

applicable_items[RW]

Items that this promotion may be applied to. If empty, there are no restrictions on applicable items and quantity. This field will also be empty for shipping promotions because shipping is not tied to any specific item. Corresponds to the JSON property `applicableItems` @return [Array<Google::Apis::ContentV2_1::OrderPromotionItem>]

applied_items[RW]

Items that this promotion have been applied to. Do not provide for `orders. createtestorder`. This field will be empty for shipping promotions because shipping is not tied to any specific item. Corresponds to the JSON property `appliedItems` @return [Array<Google::Apis::ContentV2_1::OrderPromotionItem>]

end_time[RW]

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` @return [String]

funder[RW]

Required. The party funding the promotion. Only `merchant` is supported for ` orders.createtestorder`. Acceptable values are: - “`google`” - “`merchant`” Corresponds to the JSON property `funder` @return [String]

merchant_promotion_id[RW]

Required. This field is used to identify promotions within merchants' own systems. Corresponds to the JSON property `merchantPromotionId` @return [String]

price_value[RW]

Estimated discount applied to price. Amount is pre-tax or post-tax depending on location of order. Corresponds to the JSON property `priceValue` @return [Google::Apis::ContentV2_1::Price]

short_title[RW]

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` @return [String]

start_time[RW]

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` @return [String]

subtype[RW]

Required. The category of the promotion. Only `moneyOff` is supported for ` orders.createtestorder`. Acceptable values are: - “`buyMGetMoneyOff`” - “` buyMGetNMoneyOff`” - “`buyMGetNPercentOff`” - “`buyMGetPercentOff`” - “` freeGift`” - “`freeGiftWithItemId`” - “`freeGiftWithValue`” - “` freeShippingOvernight`” - “`freeShippingStandard`” - “`freeShippingTwoDay`” - “ `moneyOff`” - “`percentOff`” - “`rewardPoints`” - “`salePrice`” Corresponds to the JSON property `subtype` @return [String]

tax_value[RW]

Estimated discount applied to tax (if allowed by law). Do not provide for ` orders.createtestorder`. Corresponds to the JSON property `taxValue` @return [Google::Apis::ContentV2_1::Price]

title[RW]

Required. The title of the promotion. Corresponds to the JSON property `title` @return [String]

type[RW]

Required. The scope of the promotion. Only `product` is supported for `orders. createtestorder`. Acceptable values are: - “`product`” - “`shipping`” Corresponds to the JSON property `type` @return [String]

Public Class Methods

new(**args) click to toggle source
# File lib/google/apis/content_v2_1/classes.rb, line 6284
def initialize(**args)
   update!(**args)
end

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File lib/google/apis/content_v2_1/classes.rb, line 6289
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