Class: Google::Apis::ContentV2_1::Promotion
- Inherits:
-
Object
- Object
- Google::Apis::ContentV2_1::Promotion
- 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
Overview
Represents a promotion. See the following articles for more details. * Promotions feed specification * Local promotions feed specification * Promotions on Buy on Google product data specification
Instance Attribute Summary collapse
-
#brand ⇒ Array<String>
Product filter by brand for the promotion.
-
#brand_exclusion ⇒ Array<String>
Product filter by brand exclusion for the promotion.
-
#content_language ⇒ String
Required.
-
#coupon_value_type ⇒ String
Required.
-
#custom_redemption_restriction ⇒ String
The custom redemption restriction for the promotion.
-
#free_gift_description ⇒ String
Free gift description for the promotion.
-
#free_gift_item_id ⇒ String
Free gift item ID for the promotion.
-
#free_gift_value ⇒ Google::Apis::ContentV2_1::PriceAmount
The price represented as a number and currency.
-
#generic_redemption_code ⇒ String
Generic redemption code for the promotion.
-
#get_this_quantity_discounted ⇒ Fixnum
The number of items discounted in the promotion.
-
#id ⇒ String
Output only.
-
#item_group_id ⇒ Array<String>
Product filter by item group ID for the promotion.
-
#item_group_id_exclusion ⇒ Array<String>
Product filter by item group ID exclusion for the promotion.
-
#item_id ⇒ Array<String>
Product filter by item ID for the promotion.
-
#item_id_exclusion ⇒ Array<String>
Product filter by item ID exclusion for the promotion.
-
#limit_quantity ⇒ Fixnum
Maximum purchase quantity for the promotion.
-
#limit_value ⇒ Google::Apis::ContentV2_1::PriceAmount
The price represented as a number and currency.
-
#long_title ⇒ String
Required.
-
#max_discount_amount ⇒ Google::Apis::ContentV2_1::PriceAmount
The price represented as a number and currency.
-
#minimum_purchase_amount ⇒ Google::Apis::ContentV2_1::PriceAmount
The price represented as a number and currency.
-
#minimum_purchase_quantity ⇒ Fixnum
Minimum purchase quantity for the promotion.
-
#money_budget ⇒ Google::Apis::ContentV2_1::PriceAmount
The price represented as a number and currency.
-
#money_off_amount ⇒ Google::Apis::ContentV2_1::PriceAmount
The price represented as a number and currency.
-
#offer_type ⇒ String
Required.
-
#order_limit ⇒ Fixnum
Order limit for the promotion.
-
#percent_off ⇒ Fixnum
The percentage discount offered in the promotion.
-
#product_applicability ⇒ String
Required.
-
#product_type ⇒ Array<String>
Product filter by product type for the promotion.
-
#product_type_exclusion ⇒ Array<String>
Product filter by product type exclusion for the promotion.
-
#promotion_destination_ids ⇒ Array<String>
Destination ID for the promotion.
-
#promotion_display_dates ⇒ String
String representation of the promotion display dates.
-
#promotion_display_time_period ⇒ Google::Apis::ContentV2_1::TimePeriod
A message that represents a time period.
-
#promotion_effective_dates ⇒ String
String representation of the promotion effective dates.
-
#promotion_effective_time_period ⇒ Google::Apis::ContentV2_1::TimePeriod
A message that represents a time period.
-
#promotion_id ⇒ String
Required.
-
#promotion_status ⇒ Google::Apis::ContentV2_1::PromotionPromotionStatus
The status of the promotion.
-
#promotion_url ⇒ String
URL to the page on the merchant's site where the promotion shows.
-
#redemption_channel ⇒ Array<String>
Required.
-
#redemption_restriction ⇒ String
The redemption restriction for the promotion.
-
#shipping_service_names ⇒ Array<String>
Shipping service names for the promotion.
-
#store_applicability ⇒ String
Whether the promotion applies to all stores, or only specified stores.
-
#store_code ⇒ Array<String>
Store codes to include for the promotion.
-
#store_code_exclusion ⇒ Array<String>
Store codes to exclude for the promotion.
-
#target_country ⇒ String
Required.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Promotion
constructor
A new instance of Promotion.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Promotion
Returns a new instance of Promotion.
11352 11353 11354 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11352 def initialize(**args) update!(**args) end |
Instance Attribute Details
#brand ⇒ Array<String>
Product filter by brand for the promotion.
Corresponds to the JSON property brand
11112 11113 11114 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11112 def brand @brand end |
#brand_exclusion ⇒ Array<String>
Product filter by brand exclusion for the promotion.
Corresponds to the JSON property brandExclusion
11117 11118 11119 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11117 def brand_exclusion @brand_exclusion end |
#content_language ⇒ String
Required. The content language used as part of the unique identifier. en
content language is available for all target countries. fr content language
is available for CA and FR target countries. de content language is
available for DE target country. nl content language is available for NL
target country. it content language is available for IT target country.
pt content language is available for BR target country. ja content
language is available for JP target country. ko content language is
available for KR target country.
Corresponds to the JSON property contentLanguage
11129 11130 11131 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11129 def content_language @content_language end |
#coupon_value_type ⇒ String
Required. Coupon value type for the promotion.
Corresponds to the JSON property couponValueType
11134 11135 11136 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11134 def coupon_value_type @coupon_value_type end |
#custom_redemption_restriction ⇒ String
The custom redemption restriction for the promotion. If the
redemption_restriction field is set to CUSTOM, this field must be set.
Corresponds to the JSON property customRedemptionRestriction
11140 11141 11142 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11140 def custom_redemption_restriction @custom_redemption_restriction end |
#free_gift_description ⇒ String
Free gift description for the promotion.
Corresponds to the JSON property freeGiftDescription
11145 11146 11147 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11145 def free_gift_description @free_gift_description end |
#free_gift_item_id ⇒ String
Free gift item ID for the promotion.
Corresponds to the JSON property freeGiftItemId
11150 11151 11152 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11150 def free_gift_item_id @free_gift_item_id end |
#free_gift_value ⇒ Google::Apis::ContentV2_1::PriceAmount
The price represented as a number and currency.
Corresponds to the JSON property freeGiftValue
11155 11156 11157 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11155 def free_gift_value @free_gift_value end |
#generic_redemption_code ⇒ String
Generic redemption code for the promotion. To be used with the offerType
field.
Corresponds to the JSON property genericRedemptionCode
11161 11162 11163 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11161 def generic_redemption_code @generic_redemption_code end |
#get_this_quantity_discounted ⇒ Fixnum
The number of items discounted in the promotion.
Corresponds to the JSON property getThisQuantityDiscounted
11166 11167 11168 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11166 def get_this_quantity_discounted @get_this_quantity_discounted end |
#id ⇒ String
Output only. The REST promotion ID to uniquely identify the promotion. Content
API methods that operate on promotions take this as their promotionId
parameter. The REST ID for a promotion is of the form channel:contentLanguage:
targetCountry:promotionId The channel field has a value of "online", "
in_store", or "online_in_store".
Corresponds to the JSON property id
11175 11176 11177 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11175 def id @id end |
#item_group_id ⇒ Array<String>
Product filter by item group ID for the promotion.
Corresponds to the JSON property itemGroupId
11180 11181 11182 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11180 def item_group_id @item_group_id end |
#item_group_id_exclusion ⇒ Array<String>
Product filter by item group ID exclusion for the promotion.
Corresponds to the JSON property itemGroupIdExclusion
11185 11186 11187 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11185 def item_group_id_exclusion @item_group_id_exclusion end |
#item_id ⇒ Array<String>
Product filter by item ID for the promotion.
Corresponds to the JSON property itemId
11190 11191 11192 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11190 def item_id @item_id end |
#item_id_exclusion ⇒ Array<String>
Product filter by item ID exclusion for the promotion.
Corresponds to the JSON property itemIdExclusion
11195 11196 11197 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11195 def item_id_exclusion @item_id_exclusion end |
#limit_quantity ⇒ Fixnum
Maximum purchase quantity for the promotion.
Corresponds to the JSON property limitQuantity
11200 11201 11202 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11200 def limit_quantity @limit_quantity end |
#limit_value ⇒ Google::Apis::ContentV2_1::PriceAmount
The price represented as a number and currency.
Corresponds to the JSON property limitValue
11205 11206 11207 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11205 def limit_value @limit_value end |
#long_title ⇒ String
Required. Long title for the promotion.
Corresponds to the JSON property longTitle
11210 11211 11212 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11210 def long_title @long_title end |
#max_discount_amount ⇒ Google::Apis::ContentV2_1::PriceAmount
The price represented as a number and currency.
Corresponds to the JSON property maxDiscountAmount
11215 11216 11217 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11215 def max_discount_amount @max_discount_amount end |
#minimum_purchase_amount ⇒ Google::Apis::ContentV2_1::PriceAmount
The price represented as a number and currency.
Corresponds to the JSON property minimumPurchaseAmount
11220 11221 11222 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11220 def minimum_purchase_amount @minimum_purchase_amount end |
#minimum_purchase_quantity ⇒ Fixnum
Minimum purchase quantity for the promotion.
Corresponds to the JSON property minimumPurchaseQuantity
11225 11226 11227 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11225 def minimum_purchase_quantity @minimum_purchase_quantity end |
#money_budget ⇒ Google::Apis::ContentV2_1::PriceAmount
The price represented as a number and currency.
Corresponds to the JSON property moneyBudget
11230 11231 11232 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11230 def money_budget @money_budget end |
#money_off_amount ⇒ Google::Apis::ContentV2_1::PriceAmount
The price represented as a number and currency.
Corresponds to the JSON property moneyOffAmount
11235 11236 11237 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11235 def money_off_amount @money_off_amount end |
#offer_type ⇒ String
Required. Type of the promotion.
Corresponds to the JSON property offerType
11240 11241 11242 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11240 def offer_type @offer_type end |
#order_limit ⇒ Fixnum
Order limit for the promotion.
Corresponds to the JSON property orderLimit
11245 11246 11247 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11245 def order_limit @order_limit end |
#percent_off ⇒ Fixnum
The percentage discount offered in the promotion.
Corresponds to the JSON property percentOff
11250 11251 11252 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11250 def percent_off @percent_off end |
#product_applicability ⇒ String
Required. Applicability of the promotion to either all products or only
specific products.
Corresponds to the JSON property productApplicability
11256 11257 11258 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11256 def product_applicability @product_applicability end |
#product_type ⇒ Array<String>
Product filter by product type for the promotion.
Corresponds to the JSON property productType
11261 11262 11263 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11261 def product_type @product_type end |
#product_type_exclusion ⇒ Array<String>
Product filter by product type exclusion for the promotion.
Corresponds to the JSON property productTypeExclusion
11266 11267 11268 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11266 def product_type_exclusion @product_type_exclusion end |
#promotion_destination_ids ⇒ Array<String>
Destination ID for the promotion.
Corresponds to the JSON property promotionDestinationIds
11271 11272 11273 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11271 def promotion_destination_ids @promotion_destination_ids end |
#promotion_display_dates ⇒ String
String representation of the promotion display dates. Deprecated. Use
promotion_display_time_period instead.
Corresponds to the JSON property promotionDisplayDates
11277 11278 11279 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11277 def promotion_display_dates @promotion_display_dates end |
#promotion_display_time_period ⇒ Google::Apis::ContentV2_1::TimePeriod
A message that represents a time period.
Corresponds to the JSON property promotionDisplayTimePeriod
11282 11283 11284 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11282 def promotion_display_time_period @promotion_display_time_period end |
#promotion_effective_dates ⇒ String
String representation of the promotion effective dates. Deprecated. Use
promotion_effective_time_period instead.
Corresponds to the JSON property promotionEffectiveDates
11288 11289 11290 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11288 def promotion_effective_dates @promotion_effective_dates end |
#promotion_effective_time_period ⇒ Google::Apis::ContentV2_1::TimePeriod
A message that represents a time period.
Corresponds to the JSON property promotionEffectiveTimePeriod
11293 11294 11295 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11293 def promotion_effective_time_period @promotion_effective_time_period end |
#promotion_id ⇒ String
Required. The user provided promotion ID to uniquely identify the promotion.
Corresponds to the JSON property promotionId
11298 11299 11300 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11298 def promotion_id @promotion_id end |
#promotion_status ⇒ Google::Apis::ContentV2_1::PromotionPromotionStatus
The status of the promotion.
Corresponds to the JSON property promotionStatus
11303 11304 11305 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11303 def promotion_status @promotion_status end |
#promotion_url ⇒ String
URL to the page on the merchant's site where the promotion shows. Local
Inventory ads promotions throw an error if no promo url is included. URL is
used to confirm that the promotion is valid and can be redeemed.
Corresponds to the JSON property promotionUrl
11310 11311 11312 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11310 def promotion_url @promotion_url end |
#redemption_channel ⇒ Array<String>
Required. Redemption channel for the promotion. At least one channel is
required.
Corresponds to the JSON property redemptionChannel
11316 11317 11318 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11316 def redemption_channel @redemption_channel end |
#redemption_restriction ⇒ String
The redemption restriction for the promotion.
Corresponds to the JSON property redemptionRestriction
11321 11322 11323 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11321 def redemption_restriction @redemption_restriction end |
#shipping_service_names ⇒ Array<String>
Shipping service names for the promotion.
Corresponds to the JSON property shippingServiceNames
11326 11327 11328 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11326 def shipping_service_names @shipping_service_names end |
#store_applicability ⇒ String
Whether the promotion applies to all stores, or only specified stores. Local
Inventory ads promotions throw an error if no store applicability is included.
An INVALID_ARGUMENT error is thrown if store_applicability is set to
ALL_STORES and store_code or score_code_exclusion is set to a value.
Corresponds to the JSON property storeApplicability
11334 11335 11336 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11334 def store_applicability @store_applicability end |
#store_code ⇒ Array<String>
Store codes to include for the promotion.
Corresponds to the JSON property storeCode
11339 11340 11341 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11339 def store_code @store_code end |
#store_code_exclusion ⇒ Array<String>
Store codes to exclude for the promotion.
Corresponds to the JSON property storeCodeExclusion
11344 11345 11346 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11344 def store_code_exclusion @store_code_exclusion end |
#target_country ⇒ String
Required. The target country used as part of the unique identifier. Can be AU
, CA, DE, FR, GB, IN, US, BR, ES, NL, JP, IT or KR.
Corresponds to the JSON property targetCountry
11350 11351 11352 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11350 def target_country @target_country end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 |
# File 'lib/google/apis/content_v2_1/classes.rb', line 11357 def update!(**args) @brand = args[:brand] if args.key?(:brand) @brand_exclusion = args[:brand_exclusion] if args.key?(:brand_exclusion) @content_language = args[:content_language] if args.key?(:content_language) @coupon_value_type = args[:coupon_value_type] if args.key?(:coupon_value_type) @custom_redemption_restriction = args[:custom_redemption_restriction] if args.key?(:custom_redemption_restriction) @free_gift_description = args[:free_gift_description] if args.key?(:free_gift_description) @free_gift_item_id = args[:free_gift_item_id] if args.key?(:free_gift_item_id) @free_gift_value = args[:free_gift_value] if args.key?(:free_gift_value) @generic_redemption_code = args[:generic_redemption_code] if args.key?(:generic_redemption_code) @get_this_quantity_discounted = args[:get_this_quantity_discounted] if args.key?(:get_this_quantity_discounted) @id = args[:id] if args.key?(:id) @item_group_id = args[:item_group_id] if args.key?(:item_group_id) @item_group_id_exclusion = args[:item_group_id_exclusion] if args.key?(:item_group_id_exclusion) @item_id = args[:item_id] if args.key?(:item_id) @item_id_exclusion = args[:item_id_exclusion] if args.key?(:item_id_exclusion) @limit_quantity = args[:limit_quantity] if args.key?(:limit_quantity) @limit_value = args[:limit_value] if args.key?(:limit_value) @long_title = args[:long_title] if args.key?(:long_title) @max_discount_amount = args[:max_discount_amount] if args.key?(:max_discount_amount) @minimum_purchase_amount = args[:minimum_purchase_amount] if args.key?(:minimum_purchase_amount) @minimum_purchase_quantity = args[:minimum_purchase_quantity] if args.key?(:minimum_purchase_quantity) @money_budget = args[:money_budget] if args.key?(:money_budget) @money_off_amount = args[:money_off_amount] if args.key?(:money_off_amount) @offer_type = args[:offer_type] if args.key?(:offer_type) @order_limit = args[:order_limit] if args.key?(:order_limit) @percent_off = args[:percent_off] if args.key?(:percent_off) @product_applicability = args[:product_applicability] if args.key?(:product_applicability) @product_type = args[:product_type] if args.key?(:product_type) @product_type_exclusion = args[:product_type_exclusion] if args.key?(:product_type_exclusion) @promotion_destination_ids = args[:promotion_destination_ids] if args.key?(:promotion_destination_ids) @promotion_display_dates = args[:promotion_display_dates] if args.key?(:promotion_display_dates) @promotion_display_time_period = args[:promotion_display_time_period] if args.key?(:promotion_display_time_period) @promotion_effective_dates = args[:promotion_effective_dates] if args.key?(:promotion_effective_dates) @promotion_effective_time_period = args[:promotion_effective_time_period] if args.key?(:promotion_effective_time_period) @promotion_id = args[:promotion_id] if args.key?(:promotion_id) @promotion_status = args[:promotion_status] if args.key?(:promotion_status) @promotion_url = args[:promotion_url] if args.key?(:promotion_url) @redemption_channel = args[:redemption_channel] if args.key?(:redemption_channel) @redemption_restriction = args[:redemption_restriction] if args.key?(:redemption_restriction) @shipping_service_names = args[:shipping_service_names] if args.key?(:shipping_service_names) @store_applicability = args[:store_applicability] if args.key?(:store_applicability) @store_code = args[:store_code] if args.key?(:store_code) @store_code_exclusion = args[:store_code_exclusion] if args.key?(:store_code_exclusion) @target_country = args[:target_country] if args.key?(:target_country) end |