Class: Google::Apis::ContentV2_1::OrderPromotion
- Inherits:
-
Object
- Object
- Google::Apis::ContentV2_1::OrderPromotion
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/content_v2_1/classes.rb,
lib/google/apis/content_v2_1/representations.rb,
lib/google/apis/content_v2_1/representations.rb
Instance Attribute Summary collapse
-
#applicable_items ⇒ Array<Google::Apis::ContentV2_1::OrderPromotionItem>
Items that this promotion may be applied to.
-
#applied_items ⇒ Array<Google::Apis::ContentV2_1::OrderPromotionItem>
Items that this promotion have been applied to.
-
#end_time ⇒ String
Promotion end time in ISO 8601 format.
-
#funder ⇒ String
Required.
-
#merchant_promotion_id ⇒ String
Required.
-
#price_value ⇒ Google::Apis::ContentV2_1::Price
Estimated discount applied to price.
-
#short_title ⇒ String
A short title of the promotion to be shown on the checkout page.
-
#start_time ⇒ String
Promotion start time in ISO 8601 format.
-
#subtype ⇒ String
Required.
-
#tax_value ⇒ Google::Apis::ContentV2_1::Price
Estimated discount applied to tax (if allowed by law).
-
#title ⇒ String
Required.
-
#type ⇒ String
Required.
Instance Method Summary collapse
-
#initialize(**args) ⇒ OrderPromotion
constructor
A new instance of OrderPromotion.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ OrderPromotion
Returns a new instance of OrderPromotion.
6249 6250 6251 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6249 def initialize(**args) update!(**args) end |
Instance Attribute Details
#applicable_items ⇒ Array<Google::Apis::ContentV2_1::OrderPromotionItem>
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
6177 6178 6179 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6177 def applicable_items @applicable_items end |
#applied_items ⇒ Array<Google::Apis::ContentV2_1::OrderPromotionItem>
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
6184 6185 6186 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6184 def applied_items @applied_items end |
#end_time ⇒ String
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
6190 6191 6192 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6190 def end_time @end_time end |
#funder ⇒ String
Required. The party funding the promotion. Only merchant is supported for
orders.createtestorder. Acceptable values are: - "google" - "merchant"
Corresponds to the JSON property funder
6196 6197 6198 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6196 def funder @funder end |
#merchant_promotion_id ⇒ String
Required. This field is used to identify promotions within merchants' own
systems.
Corresponds to the JSON property merchantPromotionId
6202 6203 6204 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6202 def merchant_promotion_id @merchant_promotion_id end |
#price_value ⇒ Google::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
6208 6209 6210 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6208 def price_value @price_value end |
#short_title ⇒ String
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
6214 6215 6216 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6214 def short_title @short_title end |
#start_time ⇒ String
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
6220 6221 6222 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6220 def start_time @start_time end |
#subtype ⇒ String
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
6230 6231 6232 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6230 def subtype @subtype end |
#tax_value ⇒ Google::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
6236 6237 6238 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6236 def tax_value @tax_value end |
#title ⇒ String
Required. The title of the promotion.
Corresponds to the JSON property title
6241 6242 6243 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6241 def title @title end |
#type ⇒ String
Required. The scope of the promotion. Only product is supported for orders.
createtestorder. Acceptable values are: - "product" - "shipping"
Corresponds to the JSON property type
6247 6248 6249 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6247 def type @type end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 6254 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 |