Class: Google::Apis::MerchantapiPromotionsV1beta::Promotion
- Inherits:
-
Object
- Object
- Google::Apis::MerchantapiPromotionsV1beta::Promotion
- 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
Represents a promotion. See the following articles for more details. Required promotion input attributes to pass data validation checks are primarily defined below: * Promotions data specification * Local promotions data specification After inserting, updating a promotion input, it may take several minutes before the final promotion can be retrieved.
Instance Attribute Summary collapse
-
#attributes ⇒ Google::Apis::MerchantapiPromotionsV1beta::Attributes
Attributes.
-
#content_language ⇒ String
Required.
-
#custom_attributes ⇒ Array<Google::Apis::MerchantapiPromotionsV1beta::CustomAttribute>
Optional.
-
#data_source ⇒ String
Output only.
-
#name ⇒ String
Identifier.
-
#promotion_id ⇒ String
Required.
-
#promotion_status ⇒ Google::Apis::MerchantapiPromotionsV1beta::PromotionStatus
The status of the promotion.
-
#redemption_channel ⇒ Array<String>
Required.
-
#target_country ⇒ String
Required.
-
#version_number ⇒ Fixnum
Optional.
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.
835 836 837 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 835 def initialize(**args) update!(**args) end |
Instance Attribute Details
#attributes ⇒ Google::Apis::MerchantapiPromotionsV1beta::Attributes
Attributes.
Corresponds to the JSON property attributes
765 766 767 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 765 def attributes @attributes end |
#content_language ⇒ String
Required. The two-letter ISO 639-1
language code for the promotion. Promotions is only for selected languages.
Corresponds to the JSON property contentLanguage
773 774 775 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 773 def content_language @content_language end |
#custom_attributes ⇒ Array<Google::Apis::MerchantapiPromotionsV1beta::CustomAttribute>
Optional. A list of custom (merchant-provided) attributes. It can also be used
for submitting any attribute of the data specification in its generic form (
for example, "name": "size type", "value": "regular"). This is useful
for submitting attributes not explicitly exposed by the API.
Corresponds to the JSON property customAttributes
781 782 783 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 781 def custom_attributes @custom_attributes end |
#data_source ⇒ String
Output only. The primary data source of the promotion.
Corresponds to the JSON property dataSource
786 787 788 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 786 def data_source @data_source end |
#name ⇒ String
Identifier. The name of the promotion. Format: accounts/account/promotions/
promotion`
Corresponds to the JSON propertyname`
792 793 794 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 792 def name @name end |
#promotion_id ⇒ String
Required. The user provided promotion ID to uniquely identify the promotion.
Follow minimum requirements to
prevent promotion disapprovals.
Corresponds to the JSON property promotionId
800 801 802 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 800 def promotion_id @promotion_id end |
#promotion_status ⇒ Google::Apis::MerchantapiPromotionsV1beta::PromotionStatus
The status of the promotion.
Corresponds to the JSON property promotionStatus
805 806 807 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 805 def promotion_status @promotion_status end |
#redemption_channel ⇒ Array<String>
Required. Redemption channel for the promotion.
At least one channel is required.
Corresponds to the JSON property redemptionChannel
812 813 814 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 812 def redemption_channel @redemption_channel end |
#target_country ⇒ String
Required. The target country used as part of the unique identifier.
Represented as a CLDR territory code. Promotions are only available in selected
countries, Free Listings and Shopping ads Local Inventory ads
Corresponds to the JSON property targetCountry
822 823 824 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 822 def target_country @target_country end |
#version_number ⇒ Fixnum
Optional. Represents the existing version (freshness) of the promotion, which
can be used to preserve the right order when multiple updates are done at the
same time. If set, the insertion is prevented when version number is lower
than the current version number of the existing promotion. Re-insertion (for
example, promotion refresh after 30 days) can be performed with the current
version_number. If the operation is prevented, the aborted exception will be
thrown.
Corresponds to the JSON property versionNumber
833 834 835 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 833 def version_number @version_number end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
840 841 842 843 844 845 846 847 848 849 850 851 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 840 def update!(**args) @attributes = args[:attributes] if args.key?(:attributes) @content_language = args[:content_language] if args.key?(:content_language) @custom_attributes = args[:custom_attributes] if args.key?(:custom_attributes) @data_source = args[:data_source] if args.key?(:data_source) @name = args[:name] if args.key?(:name) @promotion_id = args[:promotion_id] if args.key?(:promotion_id) @promotion_status = args[:promotion_status] if args.key?(:promotion_status) @redemption_channel = args[:redemption_channel] if args.key?(:redemption_channel) @target_country = args[:target_country] if args.key?(:target_country) @version_number = args[:version_number] if args.key?(:version_number) end |