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.
734 735 736 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 734 def initialize(**args) update!(**args) end |
Instance Attribute Details
#attributes ⇒ Google::Apis::MerchantapiPromotionsV1beta::Attributes
Attributes.
Corresponds to the JSON property attributes
664 665 666 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 664 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
672 673 674 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 672 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
680 681 682 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 680 def custom_attributes @custom_attributes end |
#data_source ⇒ String
Output only. The primary data source of the promotion.
Corresponds to the JSON property dataSource
685 686 687 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 685 def data_source @data_source end |
#name ⇒ String
Identifier. The name of the promotion. Format: accounts/
account/promotions/
promotion`
Corresponds to the JSON property
name`
691 692 693 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 691 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
699 700 701 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 699 def promotion_id @promotion_id end |
#promotion_status ⇒ Google::Apis::MerchantapiPromotionsV1beta::PromotionStatus
The status of the promotion.
Corresponds to the JSON property promotionStatus
704 705 706 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 704 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
711 712 713 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 711 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
721 722 723 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 721 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
732 733 734 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 732 def version_number @version_number end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
739 740 741 742 743 744 745 746 747 748 749 750 |
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 739 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 |