com.google.shopping.merchant.promotions.v1beta.Promotion Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-shopping-merchant-promotions-v1beta Show documentation
Show all versions of proto-google-shopping-merchant-promotions-v1beta Show documentation
Proto library for google-shopping-merchant-promotions
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/shopping/merchant/promotions/v1beta/promotions.proto
// Protobuf Java Version: 3.25.5
package com.google.shopping.merchant.promotions.v1beta;
/**
*
*
*
* 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](https://support.google.com/merchants/answer/2906014)
* * [Local promotions data
* specification](https://support.google.com/merchants/answer/10146130)
*
* After inserting, updating a promotion input, it may take several minutes
* before the final promotion can be retrieved.
*
*
* Protobuf type {@code google.shopping.merchant.promotions.v1beta.Promotion}
*/
public final class Promotion extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.shopping.merchant.promotions.v1beta.Promotion)
PromotionOrBuilder {
private static final long serialVersionUID = 0L;
// Use Promotion.newBuilder() to construct.
private Promotion(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Promotion() {
name_ = "";
promotionId_ = "";
contentLanguage_ = "";
targetCountry_ = "";
redemptionChannel_ = java.util.Collections.emptyList();
dataSource_ = "";
customAttributes_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new Promotion();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.shopping.merchant.promotions.v1beta.PromotionsProto
.internal_static_google_shopping_merchant_promotions_v1beta_Promotion_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.shopping.merchant.promotions.v1beta.PromotionsProto
.internal_static_google_shopping_merchant_promotions_v1beta_Promotion_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.shopping.merchant.promotions.v1beta.Promotion.class,
com.google.shopping.merchant.promotions.v1beta.Promotion.Builder.class);
}
private int bitField0_;
public static final int NAME_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object name_ = "";
/**
*
*
*
* Identifier. The name of the promotion.
* Format: `accounts/{account}/promotions/{promotion}`
*
*
* string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
*
*
*
* Identifier. The name of the promotion.
* Format: `accounts/{account}/promotions/{promotion}`
*
*
* string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PROMOTION_ID_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object promotionId_ = "";
/**
*
*
*
* Required. The user provided promotion ID to uniquely identify the
* promotion. Follow [minimum
* requirements](https://support.google.com/merchants/answer/7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements)
* to prevent promotion disapprovals.
*
*
* string promotion_id = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return The promotionId.
*/
@java.lang.Override
public java.lang.String getPromotionId() {
java.lang.Object ref = promotionId_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
promotionId_ = s;
return s;
}
}
/**
*
*
*
* Required. The user provided promotion ID to uniquely identify the
* promotion. Follow [minimum
* requirements](https://support.google.com/merchants/answer/7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements)
* to prevent promotion disapprovals.
*
*
* string promotion_id = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for promotionId.
*/
@java.lang.Override
public com.google.protobuf.ByteString getPromotionIdBytes() {
java.lang.Object ref = promotionId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
promotionId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CONTENT_LANGUAGE_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private volatile java.lang.Object contentLanguage_ = "";
/**
*
*
*
* Required. The two-letter [ISO
* 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
* promotion.
*
* Promotions is only for [selected
* languages](https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=18314938579342094533-NC#option3&zippy=).
*
*
* string content_language = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return The contentLanguage.
*/
@java.lang.Override
public java.lang.String getContentLanguage() {
java.lang.Object ref = contentLanguage_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
contentLanguage_ = s;
return s;
}
}
/**
*
*
*
* Required. The two-letter [ISO
* 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
* promotion.
*
* Promotions is only for [selected
* languages](https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=18314938579342094533-NC#option3&zippy=).
*
*
* string content_language = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for contentLanguage.
*/
@java.lang.Override
public com.google.protobuf.ByteString getContentLanguageBytes() {
java.lang.Object ref = contentLanguage_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
contentLanguage_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TARGET_COUNTRY_FIELD_NUMBER = 4;
@SuppressWarnings("serial")
private volatile java.lang.Object targetCountry_ = "";
/**
*
*
*
* Required. The target country used as part of the unique identifier.
* Represented as a [CLDR territory
* code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
*
* Promotions are only available in selected
* countries, [Free Listings and Shopping
* ads](https://support.google.com/merchants/answer/4588460) [Local Inventory
* ads](https://support.google.com/merchants/answer/10146326)
*
*
* string target_country = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @return The targetCountry.
*/
@java.lang.Override
public java.lang.String getTargetCountry() {
java.lang.Object ref = targetCountry_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
targetCountry_ = s;
return s;
}
}
/**
*
*
*
* Required. The target country used as part of the unique identifier.
* Represented as a [CLDR territory
* code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
*
* Promotions are only available in selected
* countries, [Free Listings and Shopping
* ads](https://support.google.com/merchants/answer/4588460) [Local Inventory
* ads](https://support.google.com/merchants/answer/10146326)
*
*
* string target_country = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for targetCountry.
*/
@java.lang.Override
public com.google.protobuf.ByteString getTargetCountryBytes() {
java.lang.Object ref = targetCountry_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
targetCountry_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int REDEMPTION_CHANNEL_FIELD_NUMBER = 5;
@SuppressWarnings("serial")
private java.util.List redemptionChannel_;
private static final com.google.protobuf.Internal.ListAdapter.Converter<
java.lang.Integer, com.google.shopping.merchant.promotions.v1beta.RedemptionChannel>
redemptionChannel_converter_ =
new com.google.protobuf.Internal.ListAdapter.Converter<
java.lang.Integer,
com.google.shopping.merchant.promotions.v1beta.RedemptionChannel>() {
public com.google.shopping.merchant.promotions.v1beta.RedemptionChannel convert(
java.lang.Integer from) {
com.google.shopping.merchant.promotions.v1beta.RedemptionChannel result =
com.google.shopping.merchant.promotions.v1beta.RedemptionChannel.forNumber(from);
return result == null
? com.google.shopping.merchant.promotions.v1beta.RedemptionChannel.UNRECOGNIZED
: result;
}
};
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return A list containing the redemptionChannel.
*/
@java.lang.Override
public java.util.List
getRedemptionChannelList() {
return new com.google.protobuf.Internal.ListAdapter<
java.lang.Integer, com.google.shopping.merchant.promotions.v1beta.RedemptionChannel>(
redemptionChannel_, redemptionChannel_converter_);
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return The count of redemptionChannel.
*/
@java.lang.Override
public int getRedemptionChannelCount() {
return redemptionChannel_.size();
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param index The index of the element to return.
* @return The redemptionChannel at the given index.
*/
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.RedemptionChannel getRedemptionChannel(
int index) {
return redemptionChannel_converter_.convert(redemptionChannel_.get(index));
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return A list containing the enum numeric values on the wire for redemptionChannel.
*/
@java.lang.Override
public java.util.List getRedemptionChannelValueList() {
return redemptionChannel_;
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param index The index of the value to return.
* @return The enum numeric value on the wire of redemptionChannel at the given index.
*/
@java.lang.Override
public int getRedemptionChannelValue(int index) {
return redemptionChannel_.get(index);
}
private int redemptionChannelMemoizedSerializedSize;
public static final int DATA_SOURCE_FIELD_NUMBER = 6;
@SuppressWarnings("serial")
private volatile java.lang.Object dataSource_ = "";
/**
*
*
*
* Output only. The primary data source of the promotion.
*
*
* string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The dataSource.
*/
@java.lang.Override
public java.lang.String getDataSource() {
java.lang.Object ref = dataSource_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
dataSource_ = s;
return s;
}
}
/**
*
*
*
* Output only. The primary data source of the promotion.
*
*
* string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The bytes for dataSource.
*/
@java.lang.Override
public com.google.protobuf.ByteString getDataSourceBytes() {
java.lang.Object ref = dataSource_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
dataSource_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ATTRIBUTES_FIELD_NUMBER = 7;
private com.google.shopping.merchant.promotions.v1beta.Attributes attributes_;
/**
*
*
*
* Optional. A list of promotion attributes.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return Whether the attributes field is set.
*/
@java.lang.Override
public boolean hasAttributes() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* Optional. A list of promotion attributes.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return The attributes.
*/
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.Attributes getAttributes() {
return attributes_ == null
? com.google.shopping.merchant.promotions.v1beta.Attributes.getDefaultInstance()
: attributes_;
}
/**
*
*
*
* Optional. A list of promotion attributes.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.AttributesOrBuilder
getAttributesOrBuilder() {
return attributes_ == null
? com.google.shopping.merchant.promotions.v1beta.Attributes.getDefaultInstance()
: attributes_;
}
public static final int CUSTOM_ATTRIBUTES_FIELD_NUMBER = 8;
@SuppressWarnings("serial")
private java.util.List customAttributes_;
/**
*
*
*
* 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];
*
*/
@java.lang.Override
public java.util.List getCustomAttributesList() {
return customAttributes_;
}
/**
*
*
*
* 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];
*
*/
@java.lang.Override
public java.util.List extends com.google.shopping.type.CustomAttributeOrBuilder>
getCustomAttributesOrBuilderList() {
return customAttributes_;
}
/**
*
*
*
* 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];
*
*/
@java.lang.Override
public int getCustomAttributesCount() {
return customAttributes_.size();
}
/**
*
*
*
* 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];
*
*/
@java.lang.Override
public com.google.shopping.type.CustomAttribute getCustomAttributes(int index) {
return customAttributes_.get(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];
*
*/
@java.lang.Override
public com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder(int index) {
return customAttributes_.get(index);
}
public static final int PROMOTION_STATUS_FIELD_NUMBER = 9;
private com.google.shopping.merchant.promotions.v1beta.PromotionStatus promotionStatus_;
/**
*
*
*
* Output only. The [status of a
* promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC),
* 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];
*
*
* @return Whether the promotionStatus field is set.
*/
@java.lang.Override
public boolean hasPromotionStatus() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
*
*
* Output only. The [status of a
* promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC),
* 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];
*
*
* @return The promotionStatus.
*/
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.PromotionStatus getPromotionStatus() {
return promotionStatus_ == null
? com.google.shopping.merchant.promotions.v1beta.PromotionStatus.getDefaultInstance()
: promotionStatus_;
}
/**
*
*
*
* Output only. The [status of a
* promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC),
* 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];
*
*/
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.PromotionStatusOrBuilder
getPromotionStatusOrBuilder() {
return promotionStatus_ == null
? com.google.shopping.merchant.promotions.v1beta.PromotionStatus.getDefaultInstance()
: promotionStatus_;
}
public static final int VERSION_NUMBER_FIELD_NUMBER = 10;
private long versionNumber_ = 0L;
/**
*
*
*
* 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];
*
* @return Whether the versionNumber field is set.
*/
@java.lang.Override
public boolean hasVersionNumber() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
*
*
* 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];
*
* @return The versionNumber.
*/
@java.lang.Override
public long getVersionNumber() {
return versionNumber_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
getSerializedSize();
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(promotionId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, promotionId_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, contentLanguage_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetCountry_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, targetCountry_);
}
if (getRedemptionChannelList().size() > 0) {
output.writeUInt32NoTag(42);
output.writeUInt32NoTag(redemptionChannelMemoizedSerializedSize);
}
for (int i = 0; i < redemptionChannel_.size(); i++) {
output.writeEnumNoTag(redemptionChannel_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSource_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, dataSource_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(7, getAttributes());
}
for (int i = 0; i < customAttributes_.size(); i++) {
output.writeMessage(8, customAttributes_.get(i));
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeMessage(9, getPromotionStatus());
}
if (((bitField0_ & 0x00000004) != 0)) {
output.writeInt64(10, versionNumber_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(promotionId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, promotionId_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, contentLanguage_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetCountry_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, targetCountry_);
}
{
int dataSize = 0;
for (int i = 0; i < redemptionChannel_.size(); i++) {
dataSize +=
com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(redemptionChannel_.get(i));
}
size += dataSize;
if (!getRedemptionChannelList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
}
redemptionChannelMemoizedSerializedSize = dataSize;
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSource_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, dataSource_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getAttributes());
}
for (int i = 0; i < customAttributes_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, customAttributes_.get(i));
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getPromotionStatus());
}
if (((bitField0_ & 0x00000004) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeInt64Size(10, versionNumber_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.shopping.merchant.promotions.v1beta.Promotion)) {
return super.equals(obj);
}
com.google.shopping.merchant.promotions.v1beta.Promotion other =
(com.google.shopping.merchant.promotions.v1beta.Promotion) obj;
if (!getName().equals(other.getName())) return false;
if (!getPromotionId().equals(other.getPromotionId())) return false;
if (!getContentLanguage().equals(other.getContentLanguage())) return false;
if (!getTargetCountry().equals(other.getTargetCountry())) return false;
if (!redemptionChannel_.equals(other.redemptionChannel_)) return false;
if (!getDataSource().equals(other.getDataSource())) return false;
if (hasAttributes() != other.hasAttributes()) return false;
if (hasAttributes()) {
if (!getAttributes().equals(other.getAttributes())) return false;
}
if (!getCustomAttributesList().equals(other.getCustomAttributesList())) return false;
if (hasPromotionStatus() != other.hasPromotionStatus()) return false;
if (hasPromotionStatus()) {
if (!getPromotionStatus().equals(other.getPromotionStatus())) return false;
}
if (hasVersionNumber() != other.hasVersionNumber()) return false;
if (hasVersionNumber()) {
if (getVersionNumber() != other.getVersionNumber()) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (37 * hash) + PROMOTION_ID_FIELD_NUMBER;
hash = (53 * hash) + getPromotionId().hashCode();
hash = (37 * hash) + CONTENT_LANGUAGE_FIELD_NUMBER;
hash = (53 * hash) + getContentLanguage().hashCode();
hash = (37 * hash) + TARGET_COUNTRY_FIELD_NUMBER;
hash = (53 * hash) + getTargetCountry().hashCode();
if (getRedemptionChannelCount() > 0) {
hash = (37 * hash) + REDEMPTION_CHANNEL_FIELD_NUMBER;
hash = (53 * hash) + redemptionChannel_.hashCode();
}
hash = (37 * hash) + DATA_SOURCE_FIELD_NUMBER;
hash = (53 * hash) + getDataSource().hashCode();
if (hasAttributes()) {
hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER;
hash = (53 * hash) + getAttributes().hashCode();
}
if (getCustomAttributesCount() > 0) {
hash = (37 * hash) + CUSTOM_ATTRIBUTES_FIELD_NUMBER;
hash = (53 * hash) + getCustomAttributesList().hashCode();
}
if (hasPromotionStatus()) {
hash = (37 * hash) + PROMOTION_STATUS_FIELD_NUMBER;
hash = (53 * hash) + getPromotionStatus().hashCode();
}
if (hasVersionNumber()) {
hash = (37 * hash) + VERSION_NUMBER_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getVersionNumber());
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.shopping.merchant.promotions.v1beta.Promotion parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.shopping.merchant.promotions.v1beta.Promotion parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.shopping.merchant.promotions.v1beta.Promotion parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.shopping.merchant.promotions.v1beta.Promotion parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.shopping.merchant.promotions.v1beta.Promotion parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.shopping.merchant.promotions.v1beta.Promotion parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.shopping.merchant.promotions.v1beta.Promotion parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.shopping.merchant.promotions.v1beta.Promotion parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.shopping.merchant.promotions.v1beta.Promotion parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.shopping.merchant.promotions.v1beta.Promotion parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.shopping.merchant.promotions.v1beta.Promotion parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.shopping.merchant.promotions.v1beta.Promotion parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(
com.google.shopping.merchant.promotions.v1beta.Promotion prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* 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](https://support.google.com/merchants/answer/2906014)
* * [Local promotions data
* specification](https://support.google.com/merchants/answer/10146130)
*
* After inserting, updating a promotion input, it may take several minutes
* before the final promotion can be retrieved.
*
*
* Protobuf type {@code google.shopping.merchant.promotions.v1beta.Promotion}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.shopping.merchant.promotions.v1beta.Promotion)
com.google.shopping.merchant.promotions.v1beta.PromotionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.shopping.merchant.promotions.v1beta.PromotionsProto
.internal_static_google_shopping_merchant_promotions_v1beta_Promotion_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.shopping.merchant.promotions.v1beta.PromotionsProto
.internal_static_google_shopping_merchant_promotions_v1beta_Promotion_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.shopping.merchant.promotions.v1beta.Promotion.class,
com.google.shopping.merchant.promotions.v1beta.Promotion.Builder.class);
}
// Construct using com.google.shopping.merchant.promotions.v1beta.Promotion.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getAttributesFieldBuilder();
getCustomAttributesFieldBuilder();
getPromotionStatusFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
name_ = "";
promotionId_ = "";
contentLanguage_ = "";
targetCountry_ = "";
redemptionChannel_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);
dataSource_ = "";
attributes_ = null;
if (attributesBuilder_ != null) {
attributesBuilder_.dispose();
attributesBuilder_ = null;
}
if (customAttributesBuilder_ == null) {
customAttributes_ = java.util.Collections.emptyList();
} else {
customAttributes_ = null;
customAttributesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000080);
promotionStatus_ = null;
if (promotionStatusBuilder_ != null) {
promotionStatusBuilder_.dispose();
promotionStatusBuilder_ = null;
}
versionNumber_ = 0L;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.shopping.merchant.promotions.v1beta.PromotionsProto
.internal_static_google_shopping_merchant_promotions_v1beta_Promotion_descriptor;
}
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.Promotion getDefaultInstanceForType() {
return com.google.shopping.merchant.promotions.v1beta.Promotion.getDefaultInstance();
}
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.Promotion build() {
com.google.shopping.merchant.promotions.v1beta.Promotion result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.Promotion buildPartial() {
com.google.shopping.merchant.promotions.v1beta.Promotion result =
new com.google.shopping.merchant.promotions.v1beta.Promotion(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(
com.google.shopping.merchant.promotions.v1beta.Promotion result) {
if (((bitField0_ & 0x00000010) != 0)) {
redemptionChannel_ = java.util.Collections.unmodifiableList(redemptionChannel_);
bitField0_ = (bitField0_ & ~0x00000010);
}
result.redemptionChannel_ = redemptionChannel_;
if (customAttributesBuilder_ == null) {
if (((bitField0_ & 0x00000080) != 0)) {
customAttributes_ = java.util.Collections.unmodifiableList(customAttributes_);
bitField0_ = (bitField0_ & ~0x00000080);
}
result.customAttributes_ = customAttributes_;
} else {
result.customAttributes_ = customAttributesBuilder_.build();
}
}
private void buildPartial0(com.google.shopping.merchant.promotions.v1beta.Promotion result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.name_ = name_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.promotionId_ = promotionId_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.contentLanguage_ = contentLanguage_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.targetCountry_ = targetCountry_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.dataSource_ = dataSource_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000040) != 0)) {
result.attributes_ = attributesBuilder_ == null ? attributes_ : attributesBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000100) != 0)) {
result.promotionStatus_ =
promotionStatusBuilder_ == null ? promotionStatus_ : promotionStatusBuilder_.build();
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000200) != 0)) {
result.versionNumber_ = versionNumber_;
to_bitField0_ |= 0x00000004;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.shopping.merchant.promotions.v1beta.Promotion) {
return mergeFrom((com.google.shopping.merchant.promotions.v1beta.Promotion) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.shopping.merchant.promotions.v1beta.Promotion other) {
if (other == com.google.shopping.merchant.promotions.v1beta.Promotion.getDefaultInstance())
return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getPromotionId().isEmpty()) {
promotionId_ = other.promotionId_;
bitField0_ |= 0x00000002;
onChanged();
}
if (!other.getContentLanguage().isEmpty()) {
contentLanguage_ = other.contentLanguage_;
bitField0_ |= 0x00000004;
onChanged();
}
if (!other.getTargetCountry().isEmpty()) {
targetCountry_ = other.targetCountry_;
bitField0_ |= 0x00000008;
onChanged();
}
if (!other.redemptionChannel_.isEmpty()) {
if (redemptionChannel_.isEmpty()) {
redemptionChannel_ = other.redemptionChannel_;
bitField0_ = (bitField0_ & ~0x00000010);
} else {
ensureRedemptionChannelIsMutable();
redemptionChannel_.addAll(other.redemptionChannel_);
}
onChanged();
}
if (!other.getDataSource().isEmpty()) {
dataSource_ = other.dataSource_;
bitField0_ |= 0x00000020;
onChanged();
}
if (other.hasAttributes()) {
mergeAttributes(other.getAttributes());
}
if (customAttributesBuilder_ == null) {
if (!other.customAttributes_.isEmpty()) {
if (customAttributes_.isEmpty()) {
customAttributes_ = other.customAttributes_;
bitField0_ = (bitField0_ & ~0x00000080);
} else {
ensureCustomAttributesIsMutable();
customAttributes_.addAll(other.customAttributes_);
}
onChanged();
}
} else {
if (!other.customAttributes_.isEmpty()) {
if (customAttributesBuilder_.isEmpty()) {
customAttributesBuilder_.dispose();
customAttributesBuilder_ = null;
customAttributes_ = other.customAttributes_;
bitField0_ = (bitField0_ & ~0x00000080);
customAttributesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getCustomAttributesFieldBuilder()
: null;
} else {
customAttributesBuilder_.addAllMessages(other.customAttributes_);
}
}
}
if (other.hasPromotionStatus()) {
mergePromotionStatus(other.getPromotionStatus());
}
if (other.hasVersionNumber()) {
setVersionNumber(other.getVersionNumber());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
name_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
promotionId_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 26:
{
contentLanguage_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000004;
break;
} // case 26
case 34:
{
targetCountry_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000008;
break;
} // case 34
case 40:
{
int tmpRaw = input.readEnum();
ensureRedemptionChannelIsMutable();
redemptionChannel_.add(tmpRaw);
break;
} // case 40
case 42:
{
int length = input.readRawVarint32();
int oldLimit = input.pushLimit(length);
while (input.getBytesUntilLimit() > 0) {
int tmpRaw = input.readEnum();
ensureRedemptionChannelIsMutable();
redemptionChannel_.add(tmpRaw);
}
input.popLimit(oldLimit);
break;
} // case 42
case 50:
{
dataSource_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000020;
break;
} // case 50
case 58:
{
input.readMessage(getAttributesFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000040;
break;
} // case 58
case 66:
{
com.google.shopping.type.CustomAttribute m =
input.readMessage(
com.google.shopping.type.CustomAttribute.parser(), extensionRegistry);
if (customAttributesBuilder_ == null) {
ensureCustomAttributesIsMutable();
customAttributes_.add(m);
} else {
customAttributesBuilder_.addMessage(m);
}
break;
} // case 66
case 74:
{
input.readMessage(getPromotionStatusFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000100;
break;
} // case 74
case 80:
{
versionNumber_ = input.readInt64();
bitField0_ |= 0x00000200;
break;
} // case 80
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object name_ = "";
/**
*
*
*
* Identifier. The name of the promotion.
* Format: `accounts/{account}/promotions/{promotion}`
*
*
* string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Identifier. The name of the promotion.
* Format: `accounts/{account}/promotions/{promotion}`
*
*
* string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @return The bytes for name.
*/
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Identifier. The name of the promotion.
* Format: `accounts/{account}/promotions/{promotion}`
*
*
* string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* Identifier. The name of the promotion.
* Format: `accounts/{account}/promotions/{promotion}`
*
*
* string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* Identifier. The name of the promotion.
* Format: `accounts/{account}/promotions/{promotion}`
*
*
* string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object promotionId_ = "";
/**
*
*
*
* Required. The user provided promotion ID to uniquely identify the
* promotion. Follow [minimum
* requirements](https://support.google.com/merchants/answer/7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements)
* to prevent promotion disapprovals.
*
*
* string promotion_id = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return The promotionId.
*/
public java.lang.String getPromotionId() {
java.lang.Object ref = promotionId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
promotionId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Required. The user provided promotion ID to uniquely identify the
* promotion. Follow [minimum
* requirements](https://support.google.com/merchants/answer/7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements)
* to prevent promotion disapprovals.
*
*
* string promotion_id = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for promotionId.
*/
public com.google.protobuf.ByteString getPromotionIdBytes() {
java.lang.Object ref = promotionId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
promotionId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. The user provided promotion ID to uniquely identify the
* promotion. Follow [minimum
* requirements](https://support.google.com/merchants/answer/7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements)
* to prevent promotion disapprovals.
*
*
* string promotion_id = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The promotionId to set.
* @return This builder for chaining.
*/
public Builder setPromotionId(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
promotionId_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* Required. The user provided promotion ID to uniquely identify the
* promotion. Follow [minimum
* requirements](https://support.google.com/merchants/answer/7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements)
* to prevent promotion disapprovals.
*
*
* string promotion_id = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return This builder for chaining.
*/
public Builder clearPromotionId() {
promotionId_ = getDefaultInstance().getPromotionId();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
*
*
* Required. The user provided promotion ID to uniquely identify the
* promotion. Follow [minimum
* requirements](https://support.google.com/merchants/answer/7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements)
* to prevent promotion disapprovals.
*
*
* string promotion_id = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The bytes for promotionId to set.
* @return This builder for chaining.
*/
public Builder setPromotionIdBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
promotionId_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private java.lang.Object contentLanguage_ = "";
/**
*
*
*
* Required. The two-letter [ISO
* 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
* promotion.
*
* Promotions is only for [selected
* languages](https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=18314938579342094533-NC#option3&zippy=).
*
*
* string content_language = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return The contentLanguage.
*/
public java.lang.String getContentLanguage() {
java.lang.Object ref = contentLanguage_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
contentLanguage_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Required. The two-letter [ISO
* 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
* promotion.
*
* Promotions is only for [selected
* languages](https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=18314938579342094533-NC#option3&zippy=).
*
*
* string content_language = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for contentLanguage.
*/
public com.google.protobuf.ByteString getContentLanguageBytes() {
java.lang.Object ref = contentLanguage_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
contentLanguage_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. The two-letter [ISO
* 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
* promotion.
*
* Promotions is only for [selected
* languages](https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=18314938579342094533-NC#option3&zippy=).
*
*
* string content_language = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The contentLanguage to set.
* @return This builder for chaining.
*/
public Builder setContentLanguage(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
contentLanguage_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* Required. The two-letter [ISO
* 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
* promotion.
*
* Promotions is only for [selected
* languages](https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=18314938579342094533-NC#option3&zippy=).
*
*
* string content_language = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return This builder for chaining.
*/
public Builder clearContentLanguage() {
contentLanguage_ = getDefaultInstance().getContentLanguage();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
return this;
}
/**
*
*
*
* Required. The two-letter [ISO
* 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
* promotion.
*
* Promotions is only for [selected
* languages](https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=18314938579342094533-NC#option3&zippy=).
*
*
* string content_language = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The bytes for contentLanguage to set.
* @return This builder for chaining.
*/
public Builder setContentLanguageBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
contentLanguage_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
private java.lang.Object targetCountry_ = "";
/**
*
*
*
* Required. The target country used as part of the unique identifier.
* Represented as a [CLDR territory
* code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
*
* Promotions are only available in selected
* countries, [Free Listings and Shopping
* ads](https://support.google.com/merchants/answer/4588460) [Local Inventory
* ads](https://support.google.com/merchants/answer/10146326)
*
*
* string target_country = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @return The targetCountry.
*/
public java.lang.String getTargetCountry() {
java.lang.Object ref = targetCountry_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
targetCountry_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Required. The target country used as part of the unique identifier.
* Represented as a [CLDR territory
* code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
*
* Promotions are only available in selected
* countries, [Free Listings and Shopping
* ads](https://support.google.com/merchants/answer/4588460) [Local Inventory
* ads](https://support.google.com/merchants/answer/10146326)
*
*
* string target_country = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for targetCountry.
*/
public com.google.protobuf.ByteString getTargetCountryBytes() {
java.lang.Object ref = targetCountry_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
targetCountry_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. The target country used as part of the unique identifier.
* Represented as a [CLDR territory
* code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
*
* Promotions are only available in selected
* countries, [Free Listings and Shopping
* ads](https://support.google.com/merchants/answer/4588460) [Local Inventory
* ads](https://support.google.com/merchants/answer/10146326)
*
*
* string target_country = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The targetCountry to set.
* @return This builder for chaining.
*/
public Builder setTargetCountry(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
targetCountry_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
*
* Required. The target country used as part of the unique identifier.
* Represented as a [CLDR territory
* code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
*
* Promotions are only available in selected
* countries, [Free Listings and Shopping
* ads](https://support.google.com/merchants/answer/4588460) [Local Inventory
* ads](https://support.google.com/merchants/answer/10146326)
*
*
* string target_country = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @return This builder for chaining.
*/
public Builder clearTargetCountry() {
targetCountry_ = getDefaultInstance().getTargetCountry();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
/**
*
*
*
* Required. The target country used as part of the unique identifier.
* Represented as a [CLDR territory
* code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
*
* Promotions are only available in selected
* countries, [Free Listings and Shopping
* ads](https://support.google.com/merchants/answer/4588460) [Local Inventory
* ads](https://support.google.com/merchants/answer/10146326)
*
*
* string target_country = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The bytes for targetCountry to set.
* @return This builder for chaining.
*/
public Builder setTargetCountryBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
targetCountry_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
private java.util.List redemptionChannel_ =
java.util.Collections.emptyList();
private void ensureRedemptionChannelIsMutable() {
if (!((bitField0_ & 0x00000010) != 0)) {
redemptionChannel_ = new java.util.ArrayList(redemptionChannel_);
bitField0_ |= 0x00000010;
}
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return A list containing the redemptionChannel.
*/
public java.util.List
getRedemptionChannelList() {
return new com.google.protobuf.Internal.ListAdapter<
java.lang.Integer, com.google.shopping.merchant.promotions.v1beta.RedemptionChannel>(
redemptionChannel_, redemptionChannel_converter_);
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return The count of redemptionChannel.
*/
public int getRedemptionChannelCount() {
return redemptionChannel_.size();
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param index The index of the element to return.
* @return The redemptionChannel at the given index.
*/
public com.google.shopping.merchant.promotions.v1beta.RedemptionChannel getRedemptionChannel(
int index) {
return redemptionChannel_converter_.convert(redemptionChannel_.get(index));
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param index The index to set the value at.
* @param value The redemptionChannel to set.
* @return This builder for chaining.
*/
public Builder setRedemptionChannel(
int index, com.google.shopping.merchant.promotions.v1beta.RedemptionChannel value) {
if (value == null) {
throw new NullPointerException();
}
ensureRedemptionChannelIsMutable();
redemptionChannel_.set(index, value.getNumber());
onChanged();
return this;
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param value The redemptionChannel to add.
* @return This builder for chaining.
*/
public Builder addRedemptionChannel(
com.google.shopping.merchant.promotions.v1beta.RedemptionChannel value) {
if (value == null) {
throw new NullPointerException();
}
ensureRedemptionChannelIsMutable();
redemptionChannel_.add(value.getNumber());
onChanged();
return this;
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param values The redemptionChannel to add.
* @return This builder for chaining.
*/
public Builder addAllRedemptionChannel(
java.lang.Iterable<
? extends com.google.shopping.merchant.promotions.v1beta.RedemptionChannel>
values) {
ensureRedemptionChannelIsMutable();
for (com.google.shopping.merchant.promotions.v1beta.RedemptionChannel value : values) {
redemptionChannel_.add(value.getNumber());
}
onChanged();
return this;
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return This builder for chaining.
*/
public Builder clearRedemptionChannel() {
redemptionChannel_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);
onChanged();
return this;
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return A list containing the enum numeric values on the wire for redemptionChannel.
*/
public java.util.List getRedemptionChannelValueList() {
return java.util.Collections.unmodifiableList(redemptionChannel_);
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param index The index of the value to return.
* @return The enum numeric value on the wire of redemptionChannel at the given index.
*/
public int getRedemptionChannelValue(int index) {
return redemptionChannel_.get(index);
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param index The index to set the value at.
* @param value The enum numeric value on the wire for redemptionChannel to set.
* @return This builder for chaining.
*/
public Builder setRedemptionChannelValue(int index, int value) {
ensureRedemptionChannelIsMutable();
redemptionChannel_.set(index, value);
onChanged();
return this;
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param value The enum numeric value on the wire for redemptionChannel to add.
* @return This builder for chaining.
*/
public Builder addRedemptionChannelValue(int value) {
ensureRedemptionChannelIsMutable();
redemptionChannel_.add(value);
onChanged();
return this;
}
/**
*
*
*
* Required. [Redemption
* channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC)
* for the promotion. At least one channel is required.
*
*
*
* repeated .google.shopping.merchant.promotions.v1beta.RedemptionChannel redemption_channel = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param values The enum numeric values on the wire for redemptionChannel to add.
* @return This builder for chaining.
*/
public Builder addAllRedemptionChannelValue(java.lang.Iterable values) {
ensureRedemptionChannelIsMutable();
for (int value : values) {
redemptionChannel_.add(value);
}
onChanged();
return this;
}
private java.lang.Object dataSource_ = "";
/**
*
*
*
* Output only. The primary data source of the promotion.
*
*
* string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The dataSource.
*/
public java.lang.String getDataSource() {
java.lang.Object ref = dataSource_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
dataSource_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Output only. The primary data source of the promotion.
*
*
* string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The bytes for dataSource.
*/
public com.google.protobuf.ByteString getDataSourceBytes() {
java.lang.Object ref = dataSource_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
dataSource_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Output only. The primary data source of the promotion.
*
*
* string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @param value The dataSource to set.
* @return This builder for chaining.
*/
public Builder setDataSource(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
dataSource_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
*
* Output only. The primary data source of the promotion.
*
*
* string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return This builder for chaining.
*/
public Builder clearDataSource() {
dataSource_ = getDefaultInstance().getDataSource();
bitField0_ = (bitField0_ & ~0x00000020);
onChanged();
return this;
}
/**
*
*
*
* Output only. The primary data source of the promotion.
*
*
* string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @param value The bytes for dataSource to set.
* @return This builder for chaining.
*/
public Builder setDataSourceBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
dataSource_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
private com.google.shopping.merchant.promotions.v1beta.Attributes attributes_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.shopping.merchant.promotions.v1beta.Attributes,
com.google.shopping.merchant.promotions.v1beta.Attributes.Builder,
com.google.shopping.merchant.promotions.v1beta.AttributesOrBuilder>
attributesBuilder_;
/**
*
*
*
* Optional. A list of promotion attributes.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return Whether the attributes field is set.
*/
public boolean hasAttributes() {
return ((bitField0_ & 0x00000040) != 0);
}
/**
*
*
*
* Optional. A list of promotion attributes.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return The attributes.
*/
public com.google.shopping.merchant.promotions.v1beta.Attributes getAttributes() {
if (attributesBuilder_ == null) {
return attributes_ == null
? com.google.shopping.merchant.promotions.v1beta.Attributes.getDefaultInstance()
: attributes_;
} else {
return attributesBuilder_.getMessage();
}
}
/**
*
*
*
* Optional. A list of promotion attributes.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public Builder setAttributes(com.google.shopping.merchant.promotions.v1beta.Attributes value) {
if (attributesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
attributes_ = value;
} else {
attributesBuilder_.setMessage(value);
}
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
*
* Optional. A list of promotion attributes.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public Builder setAttributes(
com.google.shopping.merchant.promotions.v1beta.Attributes.Builder builderForValue) {
if (attributesBuilder_ == null) {
attributes_ = builderForValue.build();
} else {
attributesBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
*
* Optional. A list of promotion attributes.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public Builder mergeAttributes(
com.google.shopping.merchant.promotions.v1beta.Attributes value) {
if (attributesBuilder_ == null) {
if (((bitField0_ & 0x00000040) != 0)
&& attributes_ != null
&& attributes_
!= com.google.shopping.merchant.promotions.v1beta.Attributes.getDefaultInstance()) {
getAttributesBuilder().mergeFrom(value);
} else {
attributes_ = value;
}
} else {
attributesBuilder_.mergeFrom(value);
}
if (attributes_ != null) {
bitField0_ |= 0x00000040;
onChanged();
}
return this;
}
/**
*
*
*
* Optional. A list of promotion attributes.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public Builder clearAttributes() {
bitField0_ = (bitField0_ & ~0x00000040);
attributes_ = null;
if (attributesBuilder_ != null) {
attributesBuilder_.dispose();
attributesBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* Optional. A list of promotion attributes.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public com.google.shopping.merchant.promotions.v1beta.Attributes.Builder
getAttributesBuilder() {
bitField0_ |= 0x00000040;
onChanged();
return getAttributesFieldBuilder().getBuilder();
}
/**
*
*
*
* Optional. A list of promotion attributes.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public com.google.shopping.merchant.promotions.v1beta.AttributesOrBuilder
getAttributesOrBuilder() {
if (attributesBuilder_ != null) {
return attributesBuilder_.getMessageOrBuilder();
} else {
return attributes_ == null
? com.google.shopping.merchant.promotions.v1beta.Attributes.getDefaultInstance()
: attributes_;
}
}
/**
*
*
*
* Optional. A list of promotion attributes.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Attributes attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.shopping.merchant.promotions.v1beta.Attributes,
com.google.shopping.merchant.promotions.v1beta.Attributes.Builder,
com.google.shopping.merchant.promotions.v1beta.AttributesOrBuilder>
getAttributesFieldBuilder() {
if (attributesBuilder_ == null) {
attributesBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.shopping.merchant.promotions.v1beta.Attributes,
com.google.shopping.merchant.promotions.v1beta.Attributes.Builder,
com.google.shopping.merchant.promotions.v1beta.AttributesOrBuilder>(
getAttributes(), getParentForChildren(), isClean());
attributes_ = null;
}
return attributesBuilder_;
}
private java.util.List customAttributes_ =
java.util.Collections.emptyList();
private void ensureCustomAttributesIsMutable() {
if (!((bitField0_ & 0x00000080) != 0)) {
customAttributes_ =
new java.util.ArrayList(customAttributes_);
bitField0_ |= 0x00000080;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.shopping.type.CustomAttribute,
com.google.shopping.type.CustomAttribute.Builder,
com.google.shopping.type.CustomAttributeOrBuilder>
customAttributesBuilder_;
/**
*
*
*
* 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];
*
*/
public java.util.List getCustomAttributesList() {
if (customAttributesBuilder_ == null) {
return java.util.Collections.unmodifiableList(customAttributes_);
} else {
return customAttributesBuilder_.getMessageList();
}
}
/**
*
*
*
* 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];
*
*/
public int getCustomAttributesCount() {
if (customAttributesBuilder_ == null) {
return customAttributes_.size();
} else {
return customAttributesBuilder_.getCount();
}
}
/**
*
*
*
* 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];
*
*/
public com.google.shopping.type.CustomAttribute getCustomAttributes(int index) {
if (customAttributesBuilder_ == null) {
return customAttributes_.get(index);
} else {
return customAttributesBuilder_.getMessage(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];
*
*/
public Builder setCustomAttributes(int index, com.google.shopping.type.CustomAttribute value) {
if (customAttributesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureCustomAttributesIsMutable();
customAttributes_.set(index, value);
onChanged();
} else {
customAttributesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* 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];
*
*/
public Builder setCustomAttributes(
int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) {
if (customAttributesBuilder_ == null) {
ensureCustomAttributesIsMutable();
customAttributes_.set(index, builderForValue.build());
onChanged();
} else {
customAttributesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* 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];
*
*/
public Builder addCustomAttributes(com.google.shopping.type.CustomAttribute value) {
if (customAttributesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureCustomAttributesIsMutable();
customAttributes_.add(value);
onChanged();
} else {
customAttributesBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* 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];
*
*/
public Builder addCustomAttributes(int index, com.google.shopping.type.CustomAttribute value) {
if (customAttributesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureCustomAttributesIsMutable();
customAttributes_.add(index, value);
onChanged();
} else {
customAttributesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* 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];
*
*/
public Builder addCustomAttributes(
com.google.shopping.type.CustomAttribute.Builder builderForValue) {
if (customAttributesBuilder_ == null) {
ensureCustomAttributesIsMutable();
customAttributes_.add(builderForValue.build());
onChanged();
} else {
customAttributesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* 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];
*
*/
public Builder addCustomAttributes(
int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) {
if (customAttributesBuilder_ == null) {
ensureCustomAttributesIsMutable();
customAttributes_.add(index, builderForValue.build());
onChanged();
} else {
customAttributesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* 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];
*
*/
public Builder addAllCustomAttributes(
java.lang.Iterable extends com.google.shopping.type.CustomAttribute> values) {
if (customAttributesBuilder_ == null) {
ensureCustomAttributesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, customAttributes_);
onChanged();
} else {
customAttributesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* 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];
*
*/
public Builder clearCustomAttributes() {
if (customAttributesBuilder_ == null) {
customAttributes_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000080);
onChanged();
} else {
customAttributesBuilder_.clear();
}
return this;
}
/**
*
*
*
* 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];
*
*/
public Builder removeCustomAttributes(int index) {
if (customAttributesBuilder_ == null) {
ensureCustomAttributesIsMutable();
customAttributes_.remove(index);
onChanged();
} else {
customAttributesBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* 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];
*
*/
public com.google.shopping.type.CustomAttribute.Builder getCustomAttributesBuilder(int index) {
return getCustomAttributesFieldBuilder().getBuilder(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];
*
*/
public com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder(
int index) {
if (customAttributesBuilder_ == null) {
return customAttributes_.get(index);
} else {
return customAttributesBuilder_.getMessageOrBuilder(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];
*
*/
public java.util.List extends com.google.shopping.type.CustomAttributeOrBuilder>
getCustomAttributesOrBuilderList() {
if (customAttributesBuilder_ != null) {
return customAttributesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(customAttributes_);
}
}
/**
*
*
*
* 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];
*
*/
public com.google.shopping.type.CustomAttribute.Builder addCustomAttributesBuilder() {
return getCustomAttributesFieldBuilder()
.addBuilder(com.google.shopping.type.CustomAttribute.getDefaultInstance());
}
/**
*
*
*
* 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];
*
*/
public com.google.shopping.type.CustomAttribute.Builder addCustomAttributesBuilder(int index) {
return getCustomAttributesFieldBuilder()
.addBuilder(index, com.google.shopping.type.CustomAttribute.getDefaultInstance());
}
/**
*
*
*
* 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];
*
*/
public java.util.List
getCustomAttributesBuilderList() {
return getCustomAttributesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.shopping.type.CustomAttribute,
com.google.shopping.type.CustomAttribute.Builder,
com.google.shopping.type.CustomAttributeOrBuilder>
getCustomAttributesFieldBuilder() {
if (customAttributesBuilder_ == null) {
customAttributesBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.shopping.type.CustomAttribute,
com.google.shopping.type.CustomAttribute.Builder,
com.google.shopping.type.CustomAttributeOrBuilder>(
customAttributes_,
((bitField0_ & 0x00000080) != 0),
getParentForChildren(),
isClean());
customAttributes_ = null;
}
return customAttributesBuilder_;
}
private com.google.shopping.merchant.promotions.v1beta.PromotionStatus promotionStatus_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.shopping.merchant.promotions.v1beta.PromotionStatus,
com.google.shopping.merchant.promotions.v1beta.PromotionStatus.Builder,
com.google.shopping.merchant.promotions.v1beta.PromotionStatusOrBuilder>
promotionStatusBuilder_;
/**
*
*
*
* Output only. The [status of a
* promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC),
* 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];
*
*
* @return Whether the promotionStatus field is set.
*/
public boolean hasPromotionStatus() {
return ((bitField0_ & 0x00000100) != 0);
}
/**
*
*
*
* Output only. The [status of a
* promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC),
* 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];
*
*
* @return The promotionStatus.
*/
public com.google.shopping.merchant.promotions.v1beta.PromotionStatus getPromotionStatus() {
if (promotionStatusBuilder_ == null) {
return promotionStatus_ == null
? com.google.shopping.merchant.promotions.v1beta.PromotionStatus.getDefaultInstance()
: promotionStatus_;
} else {
return promotionStatusBuilder_.getMessage();
}
}
/**
*
*
*
* Output only. The [status of a
* promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC),
* 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 Builder setPromotionStatus(
com.google.shopping.merchant.promotions.v1beta.PromotionStatus value) {
if (promotionStatusBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
promotionStatus_ = value;
} else {
promotionStatusBuilder_.setMessage(value);
}
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
*
*
* Output only. The [status of a
* promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC),
* 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 Builder setPromotionStatus(
com.google.shopping.merchant.promotions.v1beta.PromotionStatus.Builder builderForValue) {
if (promotionStatusBuilder_ == null) {
promotionStatus_ = builderForValue.build();
} else {
promotionStatusBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
*
*
* Output only. The [status of a
* promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC),
* 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 Builder mergePromotionStatus(
com.google.shopping.merchant.promotions.v1beta.PromotionStatus value) {
if (promotionStatusBuilder_ == null) {
if (((bitField0_ & 0x00000100) != 0)
&& promotionStatus_ != null
&& promotionStatus_
!= com.google.shopping.merchant.promotions.v1beta.PromotionStatus
.getDefaultInstance()) {
getPromotionStatusBuilder().mergeFrom(value);
} else {
promotionStatus_ = value;
}
} else {
promotionStatusBuilder_.mergeFrom(value);
}
if (promotionStatus_ != null) {
bitField0_ |= 0x00000100;
onChanged();
}
return this;
}
/**
*
*
*
* Output only. The [status of a
* promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC),
* 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 Builder clearPromotionStatus() {
bitField0_ = (bitField0_ & ~0x00000100);
promotionStatus_ = null;
if (promotionStatusBuilder_ != null) {
promotionStatusBuilder_.dispose();
promotionStatusBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* Output only. The [status of a
* promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC),
* 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 com.google.shopping.merchant.promotions.v1beta.PromotionStatus.Builder
getPromotionStatusBuilder() {
bitField0_ |= 0x00000100;
onChanged();
return getPromotionStatusFieldBuilder().getBuilder();
}
/**
*
*
*
* Output only. The [status of a
* promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC),
* 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 com.google.shopping.merchant.promotions.v1beta.PromotionStatusOrBuilder
getPromotionStatusOrBuilder() {
if (promotionStatusBuilder_ != null) {
return promotionStatusBuilder_.getMessageOrBuilder();
} else {
return promotionStatus_ == null
? com.google.shopping.merchant.promotions.v1beta.PromotionStatus.getDefaultInstance()
: promotionStatus_;
}
}
/**
*
*
*
* Output only. The [status of a
* promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC),
* 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];
*
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.shopping.merchant.promotions.v1beta.PromotionStatus,
com.google.shopping.merchant.promotions.v1beta.PromotionStatus.Builder,
com.google.shopping.merchant.promotions.v1beta.PromotionStatusOrBuilder>
getPromotionStatusFieldBuilder() {
if (promotionStatusBuilder_ == null) {
promotionStatusBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.shopping.merchant.promotions.v1beta.PromotionStatus,
com.google.shopping.merchant.promotions.v1beta.PromotionStatus.Builder,
com.google.shopping.merchant.promotions.v1beta.PromotionStatusOrBuilder>(
getPromotionStatus(), getParentForChildren(), isClean());
promotionStatus_ = null;
}
return promotionStatusBuilder_;
}
private long versionNumber_;
/**
*
*
*
* 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];
*
* @return Whether the versionNumber field is set.
*/
@java.lang.Override
public boolean hasVersionNumber() {
return ((bitField0_ & 0x00000200) != 0);
}
/**
*
*
*
* 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];
*
* @return The versionNumber.
*/
@java.lang.Override
public long getVersionNumber() {
return versionNumber_;
}
/**
*
*
*
* 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];
*
* @param value The versionNumber to set.
* @return This builder for chaining.
*/
public Builder setVersionNumber(long value) {
versionNumber_ = value;
bitField0_ |= 0x00000200;
onChanged();
return this;
}
/**
*
*
*
* 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];
*
* @return This builder for chaining.
*/
public Builder clearVersionNumber() {
bitField0_ = (bitField0_ & ~0x00000200);
versionNumber_ = 0L;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.shopping.merchant.promotions.v1beta.Promotion)
}
// @@protoc_insertion_point(class_scope:google.shopping.merchant.promotions.v1beta.Promotion)
private static final com.google.shopping.merchant.promotions.v1beta.Promotion DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.shopping.merchant.promotions.v1beta.Promotion();
}
public static com.google.shopping.merchant.promotions.v1beta.Promotion getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Promotion parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.Promotion getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}