Class: Google::Apis::MerchantapiPromotionsV1beta::Promotion

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

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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Promotion

Returns a new instance of Promotion.



757
758
759
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 757

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

Instance Attribute Details

#attributesGoogle::Apis::MerchantapiPromotionsV1beta::Attributes

Attributes. Corresponds to the JSON property attributes



687
688
689
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 687

def attributes
  @attributes
end

#content_languageString

Required. The two-letter ISO 639-1 language code for the promotion. Promotions is only for selected languages. Corresponds to the JSON property contentLanguage

Returns:

  • (String)


695
696
697
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 695

def content_language
  @content_language
end

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



703
704
705
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 703

def custom_attributes
  @custom_attributes
end

#data_sourceString

Output only. The primary data source of the promotion. Corresponds to the JSON property dataSource

Returns:

  • (String)


708
709
710
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 708

def data_source
  @data_source
end

#nameString

Identifier. The name of the promotion. Format: accounts/account/promotions/ promotion` Corresponds to the JSON propertyname`

Returns:

  • (String)


714
715
716
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 714

def name
  @name
end

#promotion_idString

Required. The user provided promotion ID to uniquely identify the promotion. Follow minimum requirements to prevent promotion disapprovals. Corresponds to the JSON property promotionId

Returns:

  • (String)


722
723
724
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 722

def promotion_id
  @promotion_id
end

#promotion_statusGoogle::Apis::MerchantapiPromotionsV1beta::PromotionStatus

The status of the promotion. Corresponds to the JSON property promotionStatus



727
728
729
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 727

def promotion_status
  @promotion_status
end

#redemption_channelArray<String>

Required. Redemption channel for the promotion. At least one channel is required. Corresponds to the JSON property redemptionChannel

Returns:

  • (Array<String>)


734
735
736
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 734

def redemption_channel
  @redemption_channel
end

#target_countryString

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

Returns:

  • (String)


744
745
746
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 744

def target_country
  @target_country
end

#version_numberFixnum

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

Returns:

  • (Fixnum)


755
756
757
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 755

def version_number
  @version_number
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



762
763
764
765
766
767
768
769
770
771
772
773
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 762

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