Class: Google::Apis::ContentV2_1::OrderPromotion

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ OrderPromotion

Returns a new instance of OrderPromotion.



5970
5971
5972
# File 'lib/google/apis/content_v2_1/classes.rb', line 5970

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

Instance Attribute Details

#applicable_itemsArray<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



5898
5899
5900
# File 'lib/google/apis/content_v2_1/classes.rb', line 5898

def applicable_items
  @applicable_items
end

#applied_itemsArray<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



5905
5906
5907
# File 'lib/google/apis/content_v2_1/classes.rb', line 5905

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)


5911
5912
5913
# File 'lib/google/apis/content_v2_1/classes.rb', line 5911

def end_time
  @end_time
end

#funderString

Required. The party funding the promotion. Only merchant is supported for orders.createtestorder. Acceptable values are: - "google" - "merchant" Corresponds to the JSON property funder

Returns:

  • (String)


5917
5918
5919
# File 'lib/google/apis/content_v2_1/classes.rb', line 5917

def funder
  @funder
end

#merchant_promotion_idString

Required. This field is used to identify promotions within merchants' own systems. Corresponds to the JSON property merchantPromotionId

Returns:

  • (String)


5923
5924
5925
# File 'lib/google/apis/content_v2_1/classes.rb', line 5923

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



5929
5930
5931
# File 'lib/google/apis/content_v2_1/classes.rb', line 5929

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)


5935
5936
5937
# File 'lib/google/apis/content_v2_1/classes.rb', line 5935

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)


5941
5942
5943
# File 'lib/google/apis/content_v2_1/classes.rb', line 5941

def start_time
  @start_time
end

#subtypeString

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

Returns:

  • (String)


5951
5952
5953
# File 'lib/google/apis/content_v2_1/classes.rb', line 5951

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



5957
5958
5959
# File 'lib/google/apis/content_v2_1/classes.rb', line 5957

def tax_value
  @tax_value
end

#titleString

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

Returns:

  • (String)


5962
5963
5964
# File 'lib/google/apis/content_v2_1/classes.rb', line 5962

def title
  @title
end

#typeString

Required. The scope of the promotion. Only product is supported for orders. createtestorder. Acceptable values are: - "product" - "shipping" Corresponds to the JSON property type

Returns:

  • (String)


5968
5969
5970
# File 'lib/google/apis/content_v2_1/classes.rb', line 5968

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
# File 'lib/google/apis/content_v2_1/classes.rb', line 5975

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