Reference documentation and code samples for the Google Shopping Merchant Promotions V1beta Client class Promotion.
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.
Generated from protobuf message google.shopping.merchant.promotions.v1beta.Promotion
Namespace
Google \ Shopping \ Merchant \ Promotions \ V1betaMethods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ name
string
Identifier. The name of the promotion. Format: accounts/{account}/promotions/{promotion}
↳ promotion_id
string
Required. The user provided promotion ID to uniquely identify the promotion. Follow minimum requirements to prevent promotion disapprovals.
↳ content_language
string
Required. The two-letter ISO 639-1 language code for the promotion. Promotions is only for selected languages .
↳ 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
↳ redemption_channel
↳ data_source
string
Output only. The primary data source of the promotion.
↳ attributes
↳ custom_attributes
array< Google\Shopping\Type\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.
↳ promotion_status
PromotionStatus
Output only. The status of a promotion , data validation issues, that is, information about a promotion computed asynchronously.
↳ version_number
int|string
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.
getName
Identifier. The name of the promotion.
Format: accounts/{account}/promotions/{promotion}
string
setName
Identifier. The name of the promotion.
Format: accounts/{account}/promotions/{promotion}
var
string
$this
getPromotionId
Required. The user provided promotion ID to uniquely identify the promotion. Follow minimum requirements to prevent promotion disapprovals.
string
setPromotionId
Required. The user provided promotion ID to uniquely identify the promotion. Follow minimum requirements to prevent promotion disapprovals.
var
string
$this
getContentLanguage
Required. The two-letter ISO 639-1 language code for the promotion.
Promotions is only for selected languages .
string
setContentLanguage
Required. The two-letter ISO 639-1 language code for the promotion.
Promotions is only for selected languages .
var
string
$this
getTargetCountry
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
string
setTargetCountry
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
var
string
$this
getRedemptionChannel
Required. Redemption channel for the promotion. At least one channel is required.
setRedemptionChannel
Required. Redemption channel for the promotion. At least one channel is required.
var
int[]
$this
getDataSource
Output only. The primary data source of the promotion.
string
setDataSource
Output only. The primary data source of the promotion.
var
string
$this
getAttributes
Optional. A list of promotion attributes.
hasAttributes
clearAttributes
setAttributes
Optional. A list of promotion attributes.
$this
getCustomAttributes
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.
setCustomAttributes
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.
$this
getPromotionStatus
Output only. The status of a promotion , data validation issues, that is, information about a promotion computed asynchronously.
hasPromotionStatus
clearPromotionStatus
setPromotionStatus
Output only. The status of a promotion , data validation issues, that is, information about a promotion computed asynchronously.
$this
getVersionNumber
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.
int|string
hasVersionNumber
clearVersionNumber
setVersionNumber
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.
var
int|string
$this