Class: Google::Apis::MerchantapiPromotionsV1beta::Attributes

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/merchantapi_promotions_v1beta/classes.rb,
lib/google/apis/merchantapi_promotions_v1beta/representations.rb,
lib/google/apis/merchantapi_promotions_v1beta/representations.rb

Overview

Attributes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Attributes

Returns a new instance of Attributes.



337
338
339
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 337

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

Instance Attribute Details

#audienceString

Optional. This field defines the audience a promotion will be visible to. Corresponds to the JSON property audience

Returns:

  • (String)


32
33
34
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 32

def audience
  @audience
end

#brand_exclusionArray<String>

Optional. Product filter by brand exclusion for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products. Corresponds to the JSON property brandExclusion

Returns:

  • (Array<String>)


42
43
44
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 42

def brand_exclusion
  @brand_exclusion
end

#brand_inclusionArray<String>

Optional. Product filter by brand for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products. Corresponds to the JSON property brandInclusion

Returns:

  • (Array<String>)


50
51
52
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 50

def brand_inclusion
  @brand_inclusion
end

#coupon_value_typeString

Required. The coupon value type attribute to signal the type of promotion that you are running. Depending on type of the selected coupon value some attributes are required. Corresponds to the JSON property couponValueType

Returns:

  • (String)


59
60
61
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 59

def coupon_value_type
  @coupon_value_type
end

#custom_redemption_restrictionString

Optional. 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

Returns:

  • (String)


65
66
67
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 65

def custom_redemption_restriction
  @custom_redemption_restriction
end

#event_applicabilityString

Optional. Event applicability for this promotion. When present, this field indicates you are creating a sales event and not a product promotion. Exactly one of product_applicability or event_applicability must be set. Corresponds to the JSON property eventApplicability

Returns:

  • (String)


73
74
75
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 73

def event_applicability
  @event_applicability
end

#free_gift_descriptionString

Optional. Free gift description for the promotion. Corresponds to the JSON property freeGiftDescription

Returns:

  • (String)


79
80
81
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 79

def free_gift_description
  @free_gift_description
end

#free_gift_item_idString

Optional. Free gift item ID for the promotion. Corresponds to the JSON property freeGiftItemId

Returns:

  • (String)


85
86
87
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 85

def free_gift_item_id
  @free_gift_item_id
end

#free_gift_valueGoogle::Apis::MerchantapiPromotionsV1beta::Price

The price represented as a number and currency. Corresponds to the JSON property freeGiftValue



90
91
92
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 90

def free_gift_value
  @free_gift_value
end

#generic_redemption_codeString

Optional. Generic redemption code for the promotion. To be used with the offerType field and must meet the minimum requirements. Corresponds to the JSON property genericRedemptionCode

Returns:

  • (String)


97
98
99
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 97

def generic_redemption_code
  @generic_redemption_code
end

#get_this_quantity_discountedFixnum

Optional. The number of items discounted in the promotion. The attribute is set when couponValueType is equal to buy_m_get_n_money_off or buy_m_get_n_percent_off. Corresponds to the JSON property getThisQuantityDiscounted

Returns:

  • (Fixnum)


104
105
106
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 104

def get_this_quantity_discounted
  @get_this_quantity_discounted
end

#google_product_categoriesArray<String>

Optional. A list of Google product categories for this promotion. Set if EventApplicability is SPECIFIC_CATEGORIES. Up to 5 product categories can be specified. For more details on eligible values for product categories, checkout the google_product_category attribute in the Promotion data specification. Corresponds to the JSON property googleProductCategories

Returns:

  • (Array<String>)


113
114
115
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 113

def google_product_categories
  @google_product_categories
end

#item_group_id_exclusionArray<String>

Optional. Product filter by item group ID. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products. exclusion for the promotion. Corresponds to the JSON property itemGroupIdExclusion

Returns:

  • (Array<String>)


123
124
125
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 123

def item_group_id_exclusion
  @item_group_id_exclusion
end

#item_group_id_inclusionArray<String>

Optional. Product filter by item group ID for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability [product_applicability] attribute is set to specific_products. Corresponds to the JSON property itemGroupIdInclusion

Returns:

  • (Array<String>)


132
133
134
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 132

def item_group_id_inclusion
  @item_group_id_inclusion
end

#item_id_exclusionArray<String>

Optional. Product filter by item ID exclusion for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products. Corresponds to the JSON property itemIdExclusion

Returns:

  • (Array<String>)


142
143
144
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 142

def item_id_exclusion
  @item_id_exclusion
end

#item_id_inclusionArray<String>

Optional. Product filter by item ID for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products. Corresponds to the JSON property itemIdInclusion

Returns:

  • (Array<String>)


151
152
153
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 151

def item_id_inclusion
  @item_id_inclusion
end

#limit_quantityFixnum

Optional. Maximum purchase quantity for the promotion. Corresponds to the JSON property limitQuantity

Returns:

  • (Fixnum)


157
158
159
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 157

def limit_quantity
  @limit_quantity
end

#limit_valueGoogle::Apis::MerchantapiPromotionsV1beta::Price

The price represented as a number and currency. Corresponds to the JSON property limitValue



162
163
164
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 162

def limit_value
  @limit_value
end

#long_titleString

Required. Long title for the promotion. Corresponds to the JSON property longTitle

Returns:

  • (String)


168
169
170
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 168

def long_title
  @long_title
end

#max_discount_amountGoogle::Apis::MerchantapiPromotionsV1beta::Price

The price represented as a number and currency. Corresponds to the JSON property maxDiscountAmount



173
174
175
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 173

def max_discount_amount
  @max_discount_amount
end

#max_money_off_amountGoogle::Apis::MerchantapiPromotionsV1beta::Price

The price represented as a number and currency. Corresponds to the JSON property maxMoneyOffAmount



178
179
180
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 178

def max_money_off_amount
  @max_money_off_amount
end

#max_percent_offFixnum

Optional. Maximum percent off for a promotion with PERCENT_OFF_RANGE coupon value type. At least one of min_percent_off or max_percent_off must be present when the coupon value type is PERCENT_OFF_RANGE. If neither is provided an INVALID_PROMOTION_MISSING_BENEFIT_OR_RESTRICTION error is returned. Corresponds to the JSON property maxPercentOff

Returns:

  • (Fixnum)


187
188
189
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 187

def max_percent_off
  @max_percent_off
end

#min_money_off_amountGoogle::Apis::MerchantapiPromotionsV1beta::Price

The price represented as a number and currency. Corresponds to the JSON property minMoneyOffAmount



192
193
194
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 192

def min_money_off_amount
  @min_money_off_amount
end

#min_percent_offFixnum

Optional. Minimum percent off for a promotion with PERCENT_OFF_RANGE coupon value type. At least one of min_percent_off or max_percent_off must be present when the coupon value type is PERCENT_OFF_RANGE. If neither is provided an INVALID_PROMOTION_MISSING_BENEFIT_OR_RESTRICTION error is returned. Corresponds to the JSON property minPercentOff

Returns:

  • (Fixnum)


201
202
203
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 201

def min_percent_off
  @min_percent_off
end

#minimum_purchase_amountGoogle::Apis::MerchantapiPromotionsV1beta::Price

The price represented as a number and currency. Corresponds to the JSON property minimumPurchaseAmount



206
207
208
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 206

def minimum_purchase_amount
  @minimum_purchase_amount
end

#minimum_purchase_quantityFixnum

Corresponds to the JSON property minimumPurchaseQuantity

Returns:

  • (Fixnum)


211
212
213
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 211

def minimum_purchase_quantity
  @minimum_purchase_quantity
end

#money_off_amountGoogle::Apis::MerchantapiPromotionsV1beta::Price

The price represented as a number and currency. Corresponds to the JSON property moneyOffAmount



216
217
218
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 216

def money_off_amount
  @money_off_amount
end

#offer_typeString

Required. Type of the promotion. Use this attribute to indicate whether or not customers need a coupon code to redeem your promotion. Corresponds to the JSON property offerType

Returns:

  • (String)


223
224
225
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 223

def offer_type
  @offer_type
end

#percent_offFixnum

Optional. The percentage discount offered in the promotion. Corresponds to the JSON property percentOff

Returns:

  • (Fixnum)


229
230
231
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 229

def percent_off
  @percent_off
end

#product_applicabilityString

Optional. Applicability of the promotion to either all products or only specific products. Exactly one of product_applicability or event_applicability must be set. Corresponds to the JSON property productApplicability

Returns:

  • (String)


236
237
238
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 236

def product_applicability
  @product_applicability
end

#product_type_exclusionArray<String>

Optional. Product filter by product type exclusion for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products. Corresponds to the JSON property productTypeExclusion

Returns:

  • (Array<String>)


246
247
248
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 246

def product_type_exclusion
  @product_type_exclusion
end

#product_type_inclusionArray<String>

Optional. Product filter by product type for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability product_applicability attribute is set to specific_products. Corresponds to the JSON property productTypeInclusion

Returns:

  • (Array<String>)


254
255
256
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 254

def product_type_inclusion
  @product_type_inclusion
end

#promotion_destinationsArray<String>

Required. The list of destinations (also known as Marketing methods) where the promotion applies to. If you don't specify a destination by including a supported value in your data source, your promotion will display in Shopping ads and free listings by default. You may have previously submitted the following values as destinations for your products: Shopping Actions, Surfaces across Google, Local surfaces across Google. To represent these values use FREE_LISTINGS, FREE_LOCAL_LISTINGS, LOCAL_INVENTORY_ADS. For more details see Promotion destination Corresponds to the JSON property promotionDestinations

Returns:

  • (Array<String>)


267
268
269
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 267

def promotion_destinations
  @promotion_destinations
end

#promotion_display_time_periodGoogle::Apis::MerchantapiPromotionsV1beta::Interval

Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time. Corresponds to the JSON property promotionDisplayTimePeriod



275
276
277
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 275

def promotion_display_time_period
  @promotion_display_time_period
end

#promotion_effective_time_periodGoogle::Apis::MerchantapiPromotionsV1beta::Interval

Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time. Corresponds to the JSON property promotionEffectiveTimePeriod



283
284
285
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 283

def promotion_effective_time_period
  @promotion_effective_time_period
end

#promotion_urlString

Optional. URL to the page on the merchant's site where the promotion shows. Local Inventory ads promotions throw an error if no promotion_url is included. URL is used to confirm that the promotion is valid and can be redeemed. Corresponds to the JSON property promotionUrl

Returns:

  • (String)


291
292
293
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 291

def promotion_url
  @promotion_url
end

#redemption_restrictionString

Optional. A restriction customers must meet before they can redeem the promotion. Corresponds to the JSON property redemptionRestriction

Returns:

  • (String)


297
298
299
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 297

def redemption_restriction
  @redemption_restriction
end

#region_id_inclusionArray<String>

Optional. A list of regions where the promotion is applicable. Must be set if audience is set to LOCATION. Corresponds to the JSON property regionIdInclusion

Returns:

  • (Array<String>)


304
305
306
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 304

def region_id_inclusion
  @region_id_inclusion
end

#store_applicabilityString

Optional. 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_codes_inclusion or score_code_exclusion is set to a value. Corresponds to the JSON property storeApplicability

Returns:

  • (String)


314
315
316
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 314

def store_applicability
  @store_applicability
end

#store_codes_exclusionArray<String>

Optional. Store codes to exclude for the promotion. The store filter attributes only applies when the store_applicability attribute is set to specific_stores. Corresponds to the JSON property storeCodesExclusion

Returns:

  • (Array<String>)


323
324
325
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 323

def store_codes_exclusion
  @store_codes_exclusion
end

#store_codes_inclusionArray<String>

Optional. Store codes to include for the promotion. The store filter attributes only applies when the store_applicability attribute is set to specific_stores. Store code (the store ID from your Business Profile) of the physical store the product is sold in. See the Local product inventory data specification for more information. Corresponds to the JSON property storeCodesInclusion

Returns:

  • (Array<String>)


335
336
337
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 335

def store_codes_inclusion
  @store_codes_inclusion
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 342

def update!(**args)
  @audience = args[:audience] if args.key?(:audience)
  @brand_exclusion = args[:brand_exclusion] if args.key?(:brand_exclusion)
  @brand_inclusion = args[:brand_inclusion] if args.key?(:brand_inclusion)
  @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)
  @event_applicability = args[:event_applicability] if args.key?(:event_applicability)
  @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)
  @google_product_categories = args[:google_product_categories] if args.key?(:google_product_categories)
  @item_group_id_exclusion = args[:item_group_id_exclusion] if args.key?(:item_group_id_exclusion)
  @item_group_id_inclusion = args[:item_group_id_inclusion] if args.key?(:item_group_id_inclusion)
  @item_id_exclusion = args[:item_id_exclusion] if args.key?(:item_id_exclusion)
  @item_id_inclusion = args[:item_id_inclusion] if args.key?(:item_id_inclusion)
  @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)
  @max_money_off_amount = args[:max_money_off_amount] if args.key?(:max_money_off_amount)
  @max_percent_off = args[:max_percent_off] if args.key?(:max_percent_off)
  @min_money_off_amount = args[:min_money_off_amount] if args.key?(:min_money_off_amount)
  @min_percent_off = args[:min_percent_off] if args.key?(:min_percent_off)
  @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_off_amount = args[:money_off_amount] if args.key?(:money_off_amount)
  @offer_type = args[:offer_type] if args.key?(:offer_type)
  @percent_off = args[:percent_off] if args.key?(:percent_off)
  @product_applicability = args[:product_applicability] if args.key?(:product_applicability)
  @product_type_exclusion = args[:product_type_exclusion] if args.key?(:product_type_exclusion)
  @product_type_inclusion = args[:product_type_inclusion] if args.key?(:product_type_inclusion)
  @promotion_destinations = args[:promotion_destinations] if args.key?(:promotion_destinations)
  @promotion_display_time_period = args[:promotion_display_time_period] if args.key?(:promotion_display_time_period)
  @promotion_effective_time_period = args[:promotion_effective_time_period] if args.key?(:promotion_effective_time_period)
  @promotion_url = args[:promotion_url] if args.key?(:promotion_url)
  @redemption_restriction = args[:redemption_restriction] if args.key?(:redemption_restriction)
  @region_id_inclusion = args[:region_id_inclusion] if args.key?(:region_id_inclusion)
  @store_applicability = args[:store_applicability] if args.key?(:store_applicability)
  @store_codes_exclusion = args[:store_codes_exclusion] if args.key?(:store_codes_exclusion)
  @store_codes_inclusion = args[:store_codes_inclusion] if args.key?(:store_codes_inclusion)
end