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
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
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 |
|
public static final int CUSTOM_ATTRIBUTES_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
public static final int DATA_SOURCE_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
public static final int NAME_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
public static final int PROMOTION_ID_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
public static final int PROMOTION_STATUS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
public static final int REDEMPTION_CHANNEL_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
public static final int TARGET_COUNTRY_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
public static final int VERSION_NUMBER_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
Static Methods
public static Promotion getDefaultInstance()
public static final Descriptors.Descriptor getDescriptor()
public static Promotion.Builder newBuilder()
public static Promotion.Builder newBuilder(Promotion prototype)
Parameter |
Name |
Description |
prototype |
Promotion
|
public static Promotion parseDelimitedFrom(InputStream input)
public static Promotion parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static Promotion parseFrom(byte[] data)
Parameter |
Name |
Description |
data |
byte[]
|
public static Promotion parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Promotion parseFrom(ByteString data)
public static Promotion parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Promotion parseFrom(CodedInputStream input)
public static Promotion parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static Promotion parseFrom(InputStream input)
public static Promotion parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static Promotion parseFrom(ByteBuffer data)
public static Promotion parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Parser<Promotion> parser()
Methods
public boolean equals(Object obj)
Parameter |
Name |
Description |
obj |
Object
|
Overrides
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.
|
public AttributesOrBuilder getAttributesOrBuilder()
Optional. A list of promotion attributes.
.google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
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.
|
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 |
|
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 |
|
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> |
|
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 |
|
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> |
|
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.
|
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.
|
public Promotion getDefaultInstanceForType()
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.
|
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.
|
public Parser<Promotion> getParserForType()
Overrides
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.
|
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.
|
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];
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];
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.
|
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.
|
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];
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.
|
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.
|
public int getSerializedSize()
Returns |
Type |
Description |
int |
|
Overrides
public String getTargetCountry()
Returns |
Type |
Description |
String |
The targetCountry.
|
public ByteString getTargetCountryBytes()
Returns |
Type |
Description |
ByteString |
The bytes for targetCountry.
|
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.
|
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.
|
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.
|
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.
|
Returns |
Type |
Description |
int |
|
Overrides
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
public final boolean isInitialized()
Overrides
public Promotion.Builder newBuilderForType()
protected Promotion.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Returns |
Type |
Description |
Object |
|
Overrides
public Promotion.Builder toBuilder()
public void writeTo(CodedOutputStream output)
Overrides