Class Promotion (0.10.0)

public final class Promotion extends GeneratedMessageV3 implements PromotionOrBuilder

Represents a promotion. See the following articles for more details.

Required promotion input attributes to pass data validation checks are primarily defined below:

Protobuf type google.shopping.merchant.promotions.v1beta.Promotion

Implements

PromotionOrBuilder

Static Fields

ATTRIBUTES_FIELD_NUMBER

public static final int ATTRIBUTES_FIELD_NUMBER
Field Value
Type Description
int

CONTENT_LANGUAGE_FIELD_NUMBER

public static final int CONTENT_LANGUAGE_FIELD_NUMBER
Field Value
Type Description
int

CUSTOM_ATTRIBUTES_FIELD_NUMBER

public static final int CUSTOM_ATTRIBUTES_FIELD_NUMBER
Field Value
Type Description
int

DATA_SOURCE_FIELD_NUMBER

public static final int DATA_SOURCE_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

PROMOTION_ID_FIELD_NUMBER

public static final int PROMOTION_ID_FIELD_NUMBER
Field Value
Type Description
int

PROMOTION_STATUS_FIELD_NUMBER

public static final int PROMOTION_STATUS_FIELD_NUMBER
Field Value
Type Description
int

REDEMPTION_CHANNEL_FIELD_NUMBER

public static final int REDEMPTION_CHANNEL_FIELD_NUMBER
Field Value
Type Description
int

TARGET_COUNTRY_FIELD_NUMBER

public static final int TARGET_COUNTRY_FIELD_NUMBER
Field Value
Type Description
int

VERSION_NUMBER_FIELD_NUMBER

public static final int VERSION_NUMBER_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Promotion getDefaultInstance()
Returns
Type Description
Promotion

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Promotion.Builder newBuilder()
Returns
Type Description
Promotion.Builder

newBuilder(Promotion prototype)

public static Promotion.Builder newBuilder(Promotion prototype)
Parameter
Name Description
prototype Promotion
Returns
Type Description
Promotion.Builder

parseDelimitedFrom(InputStream input)

public static Promotion parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Promotion
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Promotion parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Promotion
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Promotion parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Promotion
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Promotion parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Promotion
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Promotion parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Promotion
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Promotion parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Promotion
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Promotion parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Promotion
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Promotion parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Promotion
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Promotion parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Promotion
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Promotion parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Promotion
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Promotion parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Promotion
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Promotion parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Promotion
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Promotion> parser()
Returns
Type Description
Parser<Promotion>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAttributes()

public Attributes getAttributes()

Optional. A list of promotion attributes.

.google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Attributes

The attributes.

getAttributesOrBuilder()

public AttributesOrBuilder getAttributesOrBuilder()

Optional. A list of promotion attributes.

.google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AttributesOrBuilder

getContentLanguage()

public String getContentLanguage()

Required. The two-letter ISO 639-1 language code for the promotion.

Promotions is only for selected languages.

string content_language = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The contentLanguage.

getContentLanguageBytes()

public ByteString getContentLanguageBytes()

Required. The two-letter ISO 639-1 language code for the promotion.

Promotions is only for selected languages.

string content_language = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for contentLanguage.

getCustomAttributes(int index)

public CustomAttribute getCustomAttributes(int index)

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.

repeated .google.shopping.type.CustomAttribute custom_attributes = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
com.google.shopping.type.CustomAttribute

getCustomAttributesCount()

public int getCustomAttributesCount()

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.

repeated .google.shopping.type.CustomAttribute custom_attributes = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getCustomAttributesList()

public List<CustomAttribute> getCustomAttributesList()

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.

repeated .google.shopping.type.CustomAttribute custom_attributes = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<com.google.shopping.type.CustomAttribute>

getCustomAttributesOrBuilder(int index)

public CustomAttributeOrBuilder getCustomAttributesOrBuilder(int index)

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.

repeated .google.shopping.type.CustomAttribute custom_attributes = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
com.google.shopping.type.CustomAttributeOrBuilder

getCustomAttributesOrBuilderList()

public List<? extends CustomAttributeOrBuilder> getCustomAttributesOrBuilderList()

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.

repeated .google.shopping.type.CustomAttribute custom_attributes = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<? extends com.google.shopping.type.CustomAttributeOrBuilder>

getDataSource()

public String getDataSource()

Output only. The primary data source of the promotion.

string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The dataSource.

getDataSourceBytes()

public ByteString getDataSourceBytes()

Output only. The primary data source of the promotion.

string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for dataSource.

getDefaultInstanceForType()

public Promotion getDefaultInstanceForType()
Returns
Type Description
Promotion

getName()

public String getName()

Identifier. The name of the promotion. Format: accounts/{account}/promotions/{promotion}

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Identifier. The name of the promotion. Format: accounts/{account}/promotions/{promotion}

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<Promotion> getParserForType()
Returns
Type Description
Parser<Promotion>
Overrides

getPromotionId()

public String getPromotionId()

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

string promotion_id = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The promotionId.

getPromotionIdBytes()

public ByteString getPromotionIdBytes()

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

string promotion_id = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for promotionId.

getPromotionStatus()

public PromotionStatus getPromotionStatus()

Output only. The status of a promotion, data validation issues, that is, information about a promotion computed asynchronously.

.google.shopping.merchant.promotions.v1beta.PromotionStatus promotion_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
PromotionStatus

The promotionStatus.

getPromotionStatusOrBuilder()

public PromotionStatusOrBuilder getPromotionStatusOrBuilder()

Output only. The status of a promotion, data validation issues, that is, information about a promotion computed asynchronously.

.google.shopping.merchant.promotions.v1beta.PromotionStatus promotion_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
PromotionStatusOrBuilder

getRedemptionChannel(int index)

public RedemptionChannel getRedemptionChannel(int index)

Required. Redemption channel for the promotion. At least one channel is required.

repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
RedemptionChannel

The redemptionChannel at the given index.

getRedemptionChannelCount()

public int getRedemptionChannelCount()

Required. Redemption channel for the promotion. At least one channel is required.

repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The count of redemptionChannel.

getRedemptionChannelList()

public List<RedemptionChannel> getRedemptionChannelList()

Required. Redemption channel for the promotion. At least one channel is required.

repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<RedemptionChannel>

A list containing the redemptionChannel.

getRedemptionChannelValue(int index)

public int getRedemptionChannelValue(int index)

Required. Redemption channel for the promotion. At least one channel is required.

repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
int

The enum numeric value on the wire of redemptionChannel at the given index.

getRedemptionChannelValueList()

public List<Integer> getRedemptionChannelValueList()

Required. Redemption channel for the promotion. At least one channel is required.

repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<Integer>

A list containing the enum numeric values on the wire for redemptionChannel.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getTargetCountry()

public String 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 target_country = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The targetCountry.

getTargetCountryBytes()

public ByteString getTargetCountryBytes()

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 target_country = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for targetCountry.

getVersionNumber()

public long 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.

optional int64 version_number = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
long

The versionNumber.

hasAttributes()

public boolean hasAttributes()

Optional. A list of promotion attributes.

.google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the attributes field is set.

hasPromotionStatus()

public boolean hasPromotionStatus()

Output only. The status of a promotion, data validation issues, that is, information about a promotion computed asynchronously.

.google.shopping.merchant.promotions.v1beta.PromotionStatus promotion_status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the promotionStatus field is set.

hasVersionNumber()

public boolean hasVersionNumber()

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.

optional int64 version_number = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the versionNumber field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Promotion.Builder newBuilderForType()
Returns
Type Description
Promotion.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Promotion.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Promotion.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Promotion.Builder toBuilder()
Returns
Type Description
Promotion.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException