Class Promotion.Builder (0.9.0)

public static final class Promotion.Builder extends GeneratedMessageV3.Builder<Promotion.Builder> 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 Methods

getDescriptor()

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

Methods

addAllCustomAttributes(Iterable<? extends CustomAttribute> values)

public Promotion.Builder addAllCustomAttributes(Iterable<? extends CustomAttribute> values)

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
values Iterable<? extends com.google.shopping.type.CustomAttribute>
Returns
Type Description
Promotion.Builder

addAllRedemptionChannel(Iterable<? extends RedemptionChannel> values)

public Promotion.Builder addAllRedemptionChannel(Iterable<? extends RedemptionChannel> values)

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
values Iterable<? extends com.google.shopping.merchant.promotions.v1beta.RedemptionChannel>

The redemptionChannel to add.

Returns
Type Description
Promotion.Builder

This builder for chaining.

addAllRedemptionChannelValue(Iterable<Integer> values)

public Promotion.Builder addAllRedemptionChannelValue(Iterable<Integer> values)

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
values Iterable<Integer>

The enum numeric values on the wire for redemptionChannel to add.

Returns
Type Description
Promotion.Builder

This builder for chaining.

addCustomAttributes(CustomAttribute value)

public Promotion.Builder addCustomAttributes(CustomAttribute value)

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
value com.google.shopping.type.CustomAttribute
Returns
Type Description
Promotion.Builder

addCustomAttributes(CustomAttribute.Builder builderForValue)

public Promotion.Builder addCustomAttributes(CustomAttribute.Builder builderForValue)

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
builderForValue com.google.shopping.type.CustomAttribute.Builder
Returns
Type Description
Promotion.Builder

addCustomAttributes(int index, CustomAttribute value)

public Promotion.Builder addCustomAttributes(int index, CustomAttribute value)

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];

Parameters
Name Description
index int
value com.google.shopping.type.CustomAttribute
Returns
Type Description
Promotion.Builder

addCustomAttributes(int index, CustomAttribute.Builder builderForValue)

public Promotion.Builder addCustomAttributes(int index, CustomAttribute.Builder builderForValue)

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];

Parameters
Name Description
index int
builderForValue com.google.shopping.type.CustomAttribute.Builder
Returns
Type Description
Promotion.Builder

addCustomAttributesBuilder()

public CustomAttribute.Builder addCustomAttributesBuilder()

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
com.google.shopping.type.CustomAttribute.Builder

addCustomAttributesBuilder(int index)

public CustomAttribute.Builder addCustomAttributesBuilder(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.Builder

addRedemptionChannel(RedemptionChannel value)

public Promotion.Builder addRedemptionChannel(RedemptionChannel value)

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
value RedemptionChannel

The redemptionChannel to add.

Returns
Type Description
Promotion.Builder

This builder for chaining.

addRedemptionChannelValue(int value)

public Promotion.Builder addRedemptionChannelValue(int value)

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
value int

The enum numeric value on the wire for redemptionChannel to add.

Returns
Type Description
Promotion.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Promotion.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Promotion.Builder
Overrides

build()

public Promotion build()
Returns
Type Description
Promotion

buildPartial()

public Promotion buildPartial()
Returns
Type Description
Promotion

clear()

public Promotion.Builder clear()
Returns
Type Description
Promotion.Builder
Overrides

clearAttributes()

public Promotion.Builder clearAttributes()

Optional. A list of promotion attributes.

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

Returns
Type Description
Promotion.Builder

clearContentLanguage()

public Promotion.Builder clearContentLanguage()

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
Promotion.Builder

This builder for chaining.

clearCustomAttributes()

public Promotion.Builder clearCustomAttributes()

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
Promotion.Builder

clearDataSource()

public Promotion.Builder clearDataSource()

Output only. The primary data source of the promotion.

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

Returns
Type Description
Promotion.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Promotion.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Promotion.Builder
Overrides

clearName()

public Promotion.Builder clearName()

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

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

Returns
Type Description
Promotion.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Promotion.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Promotion.Builder
Overrides

clearPromotionId()

public Promotion.Builder clearPromotionId()

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
Promotion.Builder

This builder for chaining.

clearPromotionStatus()

public Promotion.Builder clearPromotionStatus()

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
Promotion.Builder

clearRedemptionChannel()

public Promotion.Builder clearRedemptionChannel()

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
Promotion.Builder

This builder for chaining.

clearTargetCountry()

public Promotion.Builder clearTargetCountry()

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
Promotion.Builder

This builder for chaining.

clearVersionNumber()

public Promotion.Builder clearVersionNumber()

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
Promotion.Builder

This builder for chaining.

clone()

public Promotion.Builder clone()
Returns
Type Description
Promotion.Builder
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.

getAttributesBuilder()

public Attributes.Builder getAttributesBuilder()

Optional. A list of promotion attributes.

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

Returns
Type Description
Attributes.Builder

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

getCustomAttributesBuilder(int index)

public CustomAttribute.Builder getCustomAttributesBuilder(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.Builder

getCustomAttributesBuilderList()

public List<CustomAttribute.Builder> getCustomAttributesBuilderList()

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.Builder>

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

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

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.

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.

getPromotionStatusBuilder()

public PromotionStatus.Builder getPromotionStatusBuilder()

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.Builder

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.

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.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeAttributes(Attributes value)

public Promotion.Builder mergeAttributes(Attributes value)

Optional. A list of promotion attributes.

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

Parameter
Name Description
value Attributes
Returns
Type Description
Promotion.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Promotion.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Promotion.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Promotion.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Promotion.Builder
Overrides

mergeFrom(Promotion other)

public Promotion.Builder mergeFrom(Promotion other)
Parameter
Name Description
other Promotion
Returns
Type Description
Promotion.Builder

mergePromotionStatus(PromotionStatus value)

public Promotion.Builder mergePromotionStatus(PromotionStatus value)

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];

Parameter
Name Description
value PromotionStatus
Returns
Type Description
Promotion.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Promotion.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Promotion.Builder
Overrides

removeCustomAttributes(int index)

public Promotion.Builder removeCustomAttributes(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
Promotion.Builder

setAttributes(Attributes value)

public Promotion.Builder setAttributes(Attributes value)

Optional. A list of promotion attributes.

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

Parameter
Name Description
value Attributes
Returns
Type Description
Promotion.Builder

setAttributes(Attributes.Builder builderForValue)

public Promotion.Builder setAttributes(Attributes.Builder builderForValue)

Optional. A list of promotion attributes.

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

Parameter
Name Description
builderForValue Attributes.Builder
Returns
Type Description
Promotion.Builder

setContentLanguage(String value)

public Promotion.Builder setContentLanguage(String value)

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];

Parameter
Name Description
value String

The contentLanguage to set.

Returns
Type Description
Promotion.Builder

This builder for chaining.

setContentLanguageBytes(ByteString value)

public Promotion.Builder setContentLanguageBytes(ByteString value)

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];

Parameter
Name Description
value ByteString

The bytes for contentLanguage to set.

Returns
Type Description
Promotion.Builder

This builder for chaining.

setCustomAttributes(int index, CustomAttribute value)

public Promotion.Builder setCustomAttributes(int index, CustomAttribute value)

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];

Parameters
Name Description
index int
value com.google.shopping.type.CustomAttribute
Returns
Type Description
Promotion.Builder

setCustomAttributes(int index, CustomAttribute.Builder builderForValue)

public Promotion.Builder setCustomAttributes(int index, CustomAttribute.Builder builderForValue)

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];

Parameters
Name Description
index int
builderForValue com.google.shopping.type.CustomAttribute.Builder
Returns
Type Description
Promotion.Builder

setDataSource(String value)

public Promotion.Builder setDataSource(String value)

Output only. The primary data source of the promotion.

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

Parameter
Name Description
value String

The dataSource to set.

Returns
Type Description
Promotion.Builder

This builder for chaining.

setDataSourceBytes(ByteString value)

public Promotion.Builder setDataSourceBytes(ByteString value)

Output only. The primary data source of the promotion.

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

Parameter
Name Description
value ByteString

The bytes for dataSource to set.

Returns
Type Description
Promotion.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Promotion.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Promotion.Builder
Overrides

setName(String value)

public Promotion.Builder setName(String value)

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

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

Parameter
Name Description
value String

The name to set.

Returns
Type Description
Promotion.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Promotion.Builder setNameBytes(ByteString value)

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

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

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
Promotion.Builder

This builder for chaining.

setPromotionId(String value)

public Promotion.Builder setPromotionId(String value)

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];

Parameter
Name Description
value String

The promotionId to set.

Returns
Type Description
Promotion.Builder

This builder for chaining.

setPromotionIdBytes(ByteString value)

public Promotion.Builder setPromotionIdBytes(ByteString value)

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];

Parameter
Name Description
value ByteString

The bytes for promotionId to set.

Returns
Type Description
Promotion.Builder

This builder for chaining.

setPromotionStatus(PromotionStatus value)

public Promotion.Builder setPromotionStatus(PromotionStatus value)

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];

Parameter
Name Description
value PromotionStatus
Returns
Type Description
Promotion.Builder

setPromotionStatus(PromotionStatus.Builder builderForValue)

public Promotion.Builder setPromotionStatus(PromotionStatus.Builder builderForValue)

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];

Parameter
Name Description
builderForValue PromotionStatus.Builder
Returns
Type Description
Promotion.Builder

setRedemptionChannel(int index, RedemptionChannel value)

public Promotion.Builder setRedemptionChannel(int index, RedemptionChannel value)

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];

Parameters
Name Description
index int

The index to set the value at.

value RedemptionChannel

The redemptionChannel to set.

Returns
Type Description
Promotion.Builder

This builder for chaining.

setRedemptionChannelValue(int index, int value)

public Promotion.Builder setRedemptionChannelValue(int index, int value)

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];

Parameters
Name Description
index int

The index to set the value at.

value int

The enum numeric value on the wire for redemptionChannel to set.

Returns
Type Description
Promotion.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Promotion.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Promotion.Builder
Overrides

setTargetCountry(String value)

public Promotion.Builder setTargetCountry(String value)

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];

Parameter
Name Description
value String

The targetCountry to set.

Returns
Type Description
Promotion.Builder

This builder for chaining.

setTargetCountryBytes(ByteString value)

public Promotion.Builder setTargetCountryBytes(ByteString value)

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];

Parameter
Name Description
value ByteString

The bytes for targetCountry to set.

Returns
Type Description
Promotion.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Promotion.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Promotion.Builder
Overrides

setVersionNumber(long value)

public Promotion.Builder setVersionNumber(long value)

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];

Parameter
Name Description
value long

The versionNumber to set.

Returns
Type Description
Promotion.Builder

This builder for chaining.