com.google.ads.googleads.v10.common.PromotionFeedItem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of google-ads-stubs-v10 Show documentation
Show all versions of google-ads-stubs-v10 Show documentation
Stubs for GAAPI version google-ads-stubs-v10
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/ads/googleads/v10/common/extensions.proto
package com.google.ads.googleads.v10.common;
/**
*
* Represents a Promotion extension.
*
*
* Protobuf type {@code google.ads.googleads.v10.common.PromotionFeedItem}
*/
public final class PromotionFeedItem extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.ads.googleads.v10.common.PromotionFeedItem)
PromotionFeedItemOrBuilder {
private static final long serialVersionUID = 0L;
// Use PromotionFeedItem.newBuilder() to construct.
private PromotionFeedItem(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private PromotionFeedItem() {
promotionTarget_ = "";
discountModifier_ = 0;
promotionStartDate_ = "";
promotionEndDate_ = "";
occasion_ = 0;
finalUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
finalMobileUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
trackingUrlTemplate_ = "";
urlCustomParameters_ = java.util.Collections.emptyList();
finalUrlSuffix_ = "";
languageCode_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new PromotionFeedItem();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ads.googleads.v10.common.ExtensionsProto.internal_static_google_ads_googleads_v10_common_PromotionFeedItem_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ads.googleads.v10.common.ExtensionsProto.internal_static_google_ads_googleads_v10_common_PromotionFeedItem_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ads.googleads.v10.common.PromotionFeedItem.class, com.google.ads.googleads.v10.common.PromotionFeedItem.Builder.class);
}
private int bitField0_;
private int discountTypeCase_ = 0;
private java.lang.Object discountType_;
public enum DiscountTypeCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
PERCENT_OFF(17),
MONEY_AMOUNT_OFF(4),
DISCOUNTTYPE_NOT_SET(0);
private final int value;
private DiscountTypeCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static DiscountTypeCase valueOf(int value) {
return forNumber(value);
}
public static DiscountTypeCase forNumber(int value) {
switch (value) {
case 17: return PERCENT_OFF;
case 4: return MONEY_AMOUNT_OFF;
case 0: return DISCOUNTTYPE_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public DiscountTypeCase
getDiscountTypeCase() {
return DiscountTypeCase.forNumber(
discountTypeCase_);
}
private int promotionTriggerCase_ = 0;
private java.lang.Object promotionTrigger_;
public enum PromotionTriggerCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
PROMOTION_CODE(18),
ORDERS_OVER_AMOUNT(6),
PROMOTIONTRIGGER_NOT_SET(0);
private final int value;
private PromotionTriggerCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static PromotionTriggerCase valueOf(int value) {
return forNumber(value);
}
public static PromotionTriggerCase forNumber(int value) {
switch (value) {
case 18: return PROMOTION_CODE;
case 6: return ORDERS_OVER_AMOUNT;
case 0: return PROMOTIONTRIGGER_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public PromotionTriggerCase
getPromotionTriggerCase() {
return PromotionTriggerCase.forNumber(
promotionTriggerCase_);
}
public static final int PROMOTION_TARGET_FIELD_NUMBER = 16;
private volatile java.lang.Object promotionTarget_;
/**
*
* A freeform description of what the promotion is targeting.
* This field is required.
*
*
* optional string promotion_target = 16;
* @return Whether the promotionTarget field is set.
*/
@java.lang.Override
public boolean hasPromotionTarget() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* A freeform description of what the promotion is targeting.
* This field is required.
*
*
* optional string promotion_target = 16;
* @return The promotionTarget.
*/
@java.lang.Override
public java.lang.String getPromotionTarget() {
java.lang.Object ref = promotionTarget_;
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();
promotionTarget_ = s;
return s;
}
}
/**
*
* A freeform description of what the promotion is targeting.
* This field is required.
*
*
* optional string promotion_target = 16;
* @return The bytes for promotionTarget.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getPromotionTargetBytes() {
java.lang.Object ref = promotionTarget_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
promotionTarget_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DISCOUNT_MODIFIER_FIELD_NUMBER = 2;
private int discountModifier_;
/**
*
* Enum that modifies the qualification of the discount.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier discount_modifier = 2;
* @return The enum numeric value on the wire for discountModifier.
*/
@java.lang.Override public int getDiscountModifierValue() {
return discountModifier_;
}
/**
*
* Enum that modifies the qualification of the discount.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier discount_modifier = 2;
* @return The discountModifier.
*/
@java.lang.Override public com.google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier getDiscountModifier() {
@SuppressWarnings("deprecation")
com.google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier result = com.google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier.valueOf(discountModifier_);
return result == null ? com.google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier.UNRECOGNIZED : result;
}
public static final int PROMOTION_START_DATE_FIELD_NUMBER = 19;
private volatile java.lang.Object promotionStartDate_;
/**
*
* Start date of when the promotion is eligible to be redeemed.
*
*
* optional string promotion_start_date = 19;
* @return Whether the promotionStartDate field is set.
*/
@java.lang.Override
public boolean hasPromotionStartDate() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* Start date of when the promotion is eligible to be redeemed.
*
*
* optional string promotion_start_date = 19;
* @return The promotionStartDate.
*/
@java.lang.Override
public java.lang.String getPromotionStartDate() {
java.lang.Object ref = promotionStartDate_;
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();
promotionStartDate_ = s;
return s;
}
}
/**
*
* Start date of when the promotion is eligible to be redeemed.
*
*
* optional string promotion_start_date = 19;
* @return The bytes for promotionStartDate.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getPromotionStartDateBytes() {
java.lang.Object ref = promotionStartDate_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
promotionStartDate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PROMOTION_END_DATE_FIELD_NUMBER = 20;
private volatile java.lang.Object promotionEndDate_;
/**
*
* Last date when the promotion is eligible to be redeemed.
*
*
* optional string promotion_end_date = 20;
* @return Whether the promotionEndDate field is set.
*/
@java.lang.Override
public boolean hasPromotionEndDate() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* Last date when the promotion is eligible to be redeemed.
*
*
* optional string promotion_end_date = 20;
* @return The promotionEndDate.
*/
@java.lang.Override
public java.lang.String getPromotionEndDate() {
java.lang.Object ref = promotionEndDate_;
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();
promotionEndDate_ = s;
return s;
}
}
/**
*
* Last date when the promotion is eligible to be redeemed.
*
*
* optional string promotion_end_date = 20;
* @return The bytes for promotionEndDate.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getPromotionEndDateBytes() {
java.lang.Object ref = promotionEndDate_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
promotionEndDate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int OCCASION_FIELD_NUMBER = 9;
private int occasion_;
/**
*
* The occasion the promotion was intended for.
* If an occasion is set, the redemption window will need to fall within
* the date range associated with the occasion.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion occasion = 9;
* @return The enum numeric value on the wire for occasion.
*/
@java.lang.Override public int getOccasionValue() {
return occasion_;
}
/**
*
* The occasion the promotion was intended for.
* If an occasion is set, the redemption window will need to fall within
* the date range associated with the occasion.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion occasion = 9;
* @return The occasion.
*/
@java.lang.Override public com.google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion getOccasion() {
@SuppressWarnings("deprecation")
com.google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion result = com.google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion.valueOf(occasion_);
return result == null ? com.google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion.UNRECOGNIZED : result;
}
public static final int FINAL_URLS_FIELD_NUMBER = 21;
private com.google.protobuf.LazyStringList finalUrls_;
/**
*
* A list of possible final URLs after all cross domain redirects.
* This field is required.
*
*
* repeated string final_urls = 21;
* @return A list containing the finalUrls.
*/
public com.google.protobuf.ProtocolStringList
getFinalUrlsList() {
return finalUrls_;
}
/**
*
* A list of possible final URLs after all cross domain redirects.
* This field is required.
*
*
* repeated string final_urls = 21;
* @return The count of finalUrls.
*/
public int getFinalUrlsCount() {
return finalUrls_.size();
}
/**
*
* A list of possible final URLs after all cross domain redirects.
* This field is required.
*
*
* repeated string final_urls = 21;
* @param index The index of the element to return.
* @return The finalUrls at the given index.
*/
public java.lang.String getFinalUrls(int index) {
return finalUrls_.get(index);
}
/**
*
* A list of possible final URLs after all cross domain redirects.
* This field is required.
*
*
* repeated string final_urls = 21;
* @param index The index of the value to return.
* @return The bytes of the finalUrls at the given index.
*/
public com.google.protobuf.ByteString
getFinalUrlsBytes(int index) {
return finalUrls_.getByteString(index);
}
public static final int FINAL_MOBILE_URLS_FIELD_NUMBER = 22;
private com.google.protobuf.LazyStringList finalMobileUrls_;
/**
*
* A list of possible final mobile URLs after all cross domain redirects.
*
*
* repeated string final_mobile_urls = 22;
* @return A list containing the finalMobileUrls.
*/
public com.google.protobuf.ProtocolStringList
getFinalMobileUrlsList() {
return finalMobileUrls_;
}
/**
*
* A list of possible final mobile URLs after all cross domain redirects.
*
*
* repeated string final_mobile_urls = 22;
* @return The count of finalMobileUrls.
*/
public int getFinalMobileUrlsCount() {
return finalMobileUrls_.size();
}
/**
*
* A list of possible final mobile URLs after all cross domain redirects.
*
*
* repeated string final_mobile_urls = 22;
* @param index The index of the element to return.
* @return The finalMobileUrls at the given index.
*/
public java.lang.String getFinalMobileUrls(int index) {
return finalMobileUrls_.get(index);
}
/**
*
* A list of possible final mobile URLs after all cross domain redirects.
*
*
* repeated string final_mobile_urls = 22;
* @param index The index of the value to return.
* @return The bytes of the finalMobileUrls at the given index.
*/
public com.google.protobuf.ByteString
getFinalMobileUrlsBytes(int index) {
return finalMobileUrls_.getByteString(index);
}
public static final int TRACKING_URL_TEMPLATE_FIELD_NUMBER = 23;
private volatile java.lang.Object trackingUrlTemplate_;
/**
*
* URL template for constructing a tracking URL.
*
*
* optional string tracking_url_template = 23;
* @return Whether the trackingUrlTemplate field is set.
*/
@java.lang.Override
public boolean hasTrackingUrlTemplate() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* URL template for constructing a tracking URL.
*
*
* optional string tracking_url_template = 23;
* @return The trackingUrlTemplate.
*/
@java.lang.Override
public java.lang.String getTrackingUrlTemplate() {
java.lang.Object ref = trackingUrlTemplate_;
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();
trackingUrlTemplate_ = s;
return s;
}
}
/**
*
* URL template for constructing a tracking URL.
*
*
* optional string tracking_url_template = 23;
* @return The bytes for trackingUrlTemplate.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getTrackingUrlTemplateBytes() {
java.lang.Object ref = trackingUrlTemplate_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
trackingUrlTemplate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int URL_CUSTOM_PARAMETERS_FIELD_NUMBER = 13;
private java.util.List urlCustomParameters_;
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
@java.lang.Override
public java.util.List getUrlCustomParametersList() {
return urlCustomParameters_;
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
@java.lang.Override
public java.util.List extends com.google.ads.googleads.v10.common.CustomParameterOrBuilder>
getUrlCustomParametersOrBuilderList() {
return urlCustomParameters_;
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
@java.lang.Override
public int getUrlCustomParametersCount() {
return urlCustomParameters_.size();
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
@java.lang.Override
public com.google.ads.googleads.v10.common.CustomParameter getUrlCustomParameters(int index) {
return urlCustomParameters_.get(index);
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
@java.lang.Override
public com.google.ads.googleads.v10.common.CustomParameterOrBuilder getUrlCustomParametersOrBuilder(
int index) {
return urlCustomParameters_.get(index);
}
public static final int FINAL_URL_SUFFIX_FIELD_NUMBER = 24;
private volatile java.lang.Object finalUrlSuffix_;
/**
*
* URL template for appending params to landing page URLs served with parallel
* tracking.
*
*
* optional string final_url_suffix = 24;
* @return Whether the finalUrlSuffix field is set.
*/
@java.lang.Override
public boolean hasFinalUrlSuffix() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
* URL template for appending params to landing page URLs served with parallel
* tracking.
*
*
* optional string final_url_suffix = 24;
* @return The finalUrlSuffix.
*/
@java.lang.Override
public java.lang.String getFinalUrlSuffix() {
java.lang.Object ref = finalUrlSuffix_;
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();
finalUrlSuffix_ = s;
return s;
}
}
/**
*
* URL template for appending params to landing page URLs served with parallel
* tracking.
*
*
* optional string final_url_suffix = 24;
* @return The bytes for finalUrlSuffix.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getFinalUrlSuffixBytes() {
java.lang.Object ref = finalUrlSuffix_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
finalUrlSuffix_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int LANGUAGE_CODE_FIELD_NUMBER = 25;
private volatile java.lang.Object languageCode_;
/**
*
* The language of the promotion.
* Represented as BCP 47 language tag.
*
*
* optional string language_code = 25;
* @return Whether the languageCode field is set.
*/
@java.lang.Override
public boolean hasLanguageCode() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
*
* The language of the promotion.
* Represented as BCP 47 language tag.
*
*
* optional string language_code = 25;
* @return The languageCode.
*/
@java.lang.Override
public java.lang.String getLanguageCode() {
java.lang.Object ref = languageCode_;
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();
languageCode_ = s;
return s;
}
}
/**
*
* The language of the promotion.
* Represented as BCP 47 language tag.
*
*
* optional string language_code = 25;
* @return The bytes for languageCode.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getLanguageCodeBytes() {
java.lang.Object ref = languageCode_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
languageCode_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PERCENT_OFF_FIELD_NUMBER = 17;
/**
*
* Percentage off discount in the promotion in micros.
* One million is equivalent to one percent.
* Either this or money_off_amount is required.
*
*
* int64 percent_off = 17;
* @return Whether the percentOff field is set.
*/
@java.lang.Override
public boolean hasPercentOff() {
return discountTypeCase_ == 17;
}
/**
*
* Percentage off discount in the promotion in micros.
* One million is equivalent to one percent.
* Either this or money_off_amount is required.
*
*
* int64 percent_off = 17;
* @return The percentOff.
*/
@java.lang.Override
public long getPercentOff() {
if (discountTypeCase_ == 17) {
return (java.lang.Long) discountType_;
}
return 0L;
}
public static final int MONEY_AMOUNT_OFF_FIELD_NUMBER = 4;
/**
*
* Money amount off for discount in the promotion.
* Either this or percent_off is required.
*
*
* .google.ads.googleads.v10.common.Money money_amount_off = 4;
* @return Whether the moneyAmountOff field is set.
*/
@java.lang.Override
public boolean hasMoneyAmountOff() {
return discountTypeCase_ == 4;
}
/**
*
* Money amount off for discount in the promotion.
* Either this or percent_off is required.
*
*
* .google.ads.googleads.v10.common.Money money_amount_off = 4;
* @return The moneyAmountOff.
*/
@java.lang.Override
public com.google.ads.googleads.v10.common.Money getMoneyAmountOff() {
if (discountTypeCase_ == 4) {
return (com.google.ads.googleads.v10.common.Money) discountType_;
}
return com.google.ads.googleads.v10.common.Money.getDefaultInstance();
}
/**
*
* Money amount off for discount in the promotion.
* Either this or percent_off is required.
*
*
* .google.ads.googleads.v10.common.Money money_amount_off = 4;
*/
@java.lang.Override
public com.google.ads.googleads.v10.common.MoneyOrBuilder getMoneyAmountOffOrBuilder() {
if (discountTypeCase_ == 4) {
return (com.google.ads.googleads.v10.common.Money) discountType_;
}
return com.google.ads.googleads.v10.common.Money.getDefaultInstance();
}
public static final int PROMOTION_CODE_FIELD_NUMBER = 18;
/**
*
* A code the user should use in order to be eligible for the promotion.
*
*
* string promotion_code = 18;
* @return Whether the promotionCode field is set.
*/
public boolean hasPromotionCode() {
return promotionTriggerCase_ == 18;
}
/**
*
* A code the user should use in order to be eligible for the promotion.
*
*
* string promotion_code = 18;
* @return The promotionCode.
*/
public java.lang.String getPromotionCode() {
java.lang.Object ref = "";
if (promotionTriggerCase_ == 18) {
ref = promotionTrigger_;
}
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();
if (promotionTriggerCase_ == 18) {
promotionTrigger_ = s;
}
return s;
}
}
/**
*
* A code the user should use in order to be eligible for the promotion.
*
*
* string promotion_code = 18;
* @return The bytes for promotionCode.
*/
public com.google.protobuf.ByteString
getPromotionCodeBytes() {
java.lang.Object ref = "";
if (promotionTriggerCase_ == 18) {
ref = promotionTrigger_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (promotionTriggerCase_ == 18) {
promotionTrigger_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ORDERS_OVER_AMOUNT_FIELD_NUMBER = 6;
/**
*
* The amount the total order needs to be for the user to be eligible for
* the promotion.
*
*
* .google.ads.googleads.v10.common.Money orders_over_amount = 6;
* @return Whether the ordersOverAmount field is set.
*/
@java.lang.Override
public boolean hasOrdersOverAmount() {
return promotionTriggerCase_ == 6;
}
/**
*
* The amount the total order needs to be for the user to be eligible for
* the promotion.
*
*
* .google.ads.googleads.v10.common.Money orders_over_amount = 6;
* @return The ordersOverAmount.
*/
@java.lang.Override
public com.google.ads.googleads.v10.common.Money getOrdersOverAmount() {
if (promotionTriggerCase_ == 6) {
return (com.google.ads.googleads.v10.common.Money) promotionTrigger_;
}
return com.google.ads.googleads.v10.common.Money.getDefaultInstance();
}
/**
*
* The amount the total order needs to be for the user to be eligible for
* the promotion.
*
*
* .google.ads.googleads.v10.common.Money orders_over_amount = 6;
*/
@java.lang.Override
public com.google.ads.googleads.v10.common.MoneyOrBuilder getOrdersOverAmountOrBuilder() {
if (promotionTriggerCase_ == 6) {
return (com.google.ads.googleads.v10.common.Money) promotionTrigger_;
}
return com.google.ads.googleads.v10.common.Money.getDefaultInstance();
}
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 {
if (discountModifier_ != com.google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier.UNSPECIFIED.getNumber()) {
output.writeEnum(2, discountModifier_);
}
if (discountTypeCase_ == 4) {
output.writeMessage(4, (com.google.ads.googleads.v10.common.Money) discountType_);
}
if (promotionTriggerCase_ == 6) {
output.writeMessage(6, (com.google.ads.googleads.v10.common.Money) promotionTrigger_);
}
if (occasion_ != com.google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion.UNSPECIFIED.getNumber()) {
output.writeEnum(9, occasion_);
}
for (int i = 0; i < urlCustomParameters_.size(); i++) {
output.writeMessage(13, urlCustomParameters_.get(i));
}
if (((bitField0_ & 0x00000001) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 16, promotionTarget_);
}
if (discountTypeCase_ == 17) {
output.writeInt64(
17, (long)((java.lang.Long) discountType_));
}
if (promotionTriggerCase_ == 18) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 18, promotionTrigger_);
}
if (((bitField0_ & 0x00000002) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 19, promotionStartDate_);
}
if (((bitField0_ & 0x00000004) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 20, promotionEndDate_);
}
for (int i = 0; i < finalUrls_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 21, finalUrls_.getRaw(i));
}
for (int i = 0; i < finalMobileUrls_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 22, finalMobileUrls_.getRaw(i));
}
if (((bitField0_ & 0x00000008) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 23, trackingUrlTemplate_);
}
if (((bitField0_ & 0x00000010) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 24, finalUrlSuffix_);
}
if (((bitField0_ & 0x00000020) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 25, languageCode_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (discountModifier_ != com.google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier.UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, discountModifier_);
}
if (discountTypeCase_ == 4) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, (com.google.ads.googleads.v10.common.Money) discountType_);
}
if (promotionTriggerCase_ == 6) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, (com.google.ads.googleads.v10.common.Money) promotionTrigger_);
}
if (occasion_ != com.google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion.UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(9, occasion_);
}
for (int i = 0; i < urlCustomParameters_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(13, urlCustomParameters_.get(i));
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, promotionTarget_);
}
if (discountTypeCase_ == 17) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(
17, (long)((java.lang.Long) discountType_));
}
if (promotionTriggerCase_ == 18) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, promotionTrigger_);
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(19, promotionStartDate_);
}
if (((bitField0_ & 0x00000004) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(20, promotionEndDate_);
}
{
int dataSize = 0;
for (int i = 0; i < finalUrls_.size(); i++) {
dataSize += computeStringSizeNoTag(finalUrls_.getRaw(i));
}
size += dataSize;
size += 2 * getFinalUrlsList().size();
}
{
int dataSize = 0;
for (int i = 0; i < finalMobileUrls_.size(); i++) {
dataSize += computeStringSizeNoTag(finalMobileUrls_.getRaw(i));
}
size += dataSize;
size += 2 * getFinalMobileUrlsList().size();
}
if (((bitField0_ & 0x00000008) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(23, trackingUrlTemplate_);
}
if (((bitField0_ & 0x00000010) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(24, finalUrlSuffix_);
}
if (((bitField0_ & 0x00000020) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(25, languageCode_);
}
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.ads.googleads.v10.common.PromotionFeedItem)) {
return super.equals(obj);
}
com.google.ads.googleads.v10.common.PromotionFeedItem other = (com.google.ads.googleads.v10.common.PromotionFeedItem) obj;
if (hasPromotionTarget() != other.hasPromotionTarget()) return false;
if (hasPromotionTarget()) {
if (!getPromotionTarget()
.equals(other.getPromotionTarget())) return false;
}
if (discountModifier_ != other.discountModifier_) return false;
if (hasPromotionStartDate() != other.hasPromotionStartDate()) return false;
if (hasPromotionStartDate()) {
if (!getPromotionStartDate()
.equals(other.getPromotionStartDate())) return false;
}
if (hasPromotionEndDate() != other.hasPromotionEndDate()) return false;
if (hasPromotionEndDate()) {
if (!getPromotionEndDate()
.equals(other.getPromotionEndDate())) return false;
}
if (occasion_ != other.occasion_) return false;
if (!getFinalUrlsList()
.equals(other.getFinalUrlsList())) return false;
if (!getFinalMobileUrlsList()
.equals(other.getFinalMobileUrlsList())) return false;
if (hasTrackingUrlTemplate() != other.hasTrackingUrlTemplate()) return false;
if (hasTrackingUrlTemplate()) {
if (!getTrackingUrlTemplate()
.equals(other.getTrackingUrlTemplate())) return false;
}
if (!getUrlCustomParametersList()
.equals(other.getUrlCustomParametersList())) return false;
if (hasFinalUrlSuffix() != other.hasFinalUrlSuffix()) return false;
if (hasFinalUrlSuffix()) {
if (!getFinalUrlSuffix()
.equals(other.getFinalUrlSuffix())) return false;
}
if (hasLanguageCode() != other.hasLanguageCode()) return false;
if (hasLanguageCode()) {
if (!getLanguageCode()
.equals(other.getLanguageCode())) return false;
}
if (!getDiscountTypeCase().equals(other.getDiscountTypeCase())) return false;
switch (discountTypeCase_) {
case 17:
if (getPercentOff()
!= other.getPercentOff()) return false;
break;
case 4:
if (!getMoneyAmountOff()
.equals(other.getMoneyAmountOff())) return false;
break;
case 0:
default:
}
if (!getPromotionTriggerCase().equals(other.getPromotionTriggerCase())) return false;
switch (promotionTriggerCase_) {
case 18:
if (!getPromotionCode()
.equals(other.getPromotionCode())) return false;
break;
case 6:
if (!getOrdersOverAmount()
.equals(other.getOrdersOverAmount())) return false;
break;
case 0:
default:
}
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();
if (hasPromotionTarget()) {
hash = (37 * hash) + PROMOTION_TARGET_FIELD_NUMBER;
hash = (53 * hash) + getPromotionTarget().hashCode();
}
hash = (37 * hash) + DISCOUNT_MODIFIER_FIELD_NUMBER;
hash = (53 * hash) + discountModifier_;
if (hasPromotionStartDate()) {
hash = (37 * hash) + PROMOTION_START_DATE_FIELD_NUMBER;
hash = (53 * hash) + getPromotionStartDate().hashCode();
}
if (hasPromotionEndDate()) {
hash = (37 * hash) + PROMOTION_END_DATE_FIELD_NUMBER;
hash = (53 * hash) + getPromotionEndDate().hashCode();
}
hash = (37 * hash) + OCCASION_FIELD_NUMBER;
hash = (53 * hash) + occasion_;
if (getFinalUrlsCount() > 0) {
hash = (37 * hash) + FINAL_URLS_FIELD_NUMBER;
hash = (53 * hash) + getFinalUrlsList().hashCode();
}
if (getFinalMobileUrlsCount() > 0) {
hash = (37 * hash) + FINAL_MOBILE_URLS_FIELD_NUMBER;
hash = (53 * hash) + getFinalMobileUrlsList().hashCode();
}
if (hasTrackingUrlTemplate()) {
hash = (37 * hash) + TRACKING_URL_TEMPLATE_FIELD_NUMBER;
hash = (53 * hash) + getTrackingUrlTemplate().hashCode();
}
if (getUrlCustomParametersCount() > 0) {
hash = (37 * hash) + URL_CUSTOM_PARAMETERS_FIELD_NUMBER;
hash = (53 * hash) + getUrlCustomParametersList().hashCode();
}
if (hasFinalUrlSuffix()) {
hash = (37 * hash) + FINAL_URL_SUFFIX_FIELD_NUMBER;
hash = (53 * hash) + getFinalUrlSuffix().hashCode();
}
if (hasLanguageCode()) {
hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER;
hash = (53 * hash) + getLanguageCode().hashCode();
}
switch (discountTypeCase_) {
case 17:
hash = (37 * hash) + PERCENT_OFF_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getPercentOff());
break;
case 4:
hash = (37 * hash) + MONEY_AMOUNT_OFF_FIELD_NUMBER;
hash = (53 * hash) + getMoneyAmountOff().hashCode();
break;
case 0:
default:
}
switch (promotionTriggerCase_) {
case 18:
hash = (37 * hash) + PROMOTION_CODE_FIELD_NUMBER;
hash = (53 * hash) + getPromotionCode().hashCode();
break;
case 6:
hash = (37 * hash) + ORDERS_OVER_AMOUNT_FIELD_NUMBER;
hash = (53 * hash) + getOrdersOverAmount().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.ads.googleads.v10.common.PromotionFeedItem parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ads.googleads.v10.common.PromotionFeedItem parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ads.googleads.v10.common.PromotionFeedItem parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ads.googleads.v10.common.PromotionFeedItem 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.ads.googleads.v10.common.PromotionFeedItem parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ads.googleads.v10.common.PromotionFeedItem parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ads.googleads.v10.common.PromotionFeedItem parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ads.googleads.v10.common.PromotionFeedItem 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.ads.googleads.v10.common.PromotionFeedItem parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.ads.googleads.v10.common.PromotionFeedItem 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.ads.googleads.v10.common.PromotionFeedItem parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ads.googleads.v10.common.PromotionFeedItem 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.ads.googleads.v10.common.PromotionFeedItem 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 extension.
*
*
* Protobuf type {@code google.ads.googleads.v10.common.PromotionFeedItem}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.ads.googleads.v10.common.PromotionFeedItem)
com.google.ads.googleads.v10.common.PromotionFeedItemOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ads.googleads.v10.common.ExtensionsProto.internal_static_google_ads_googleads_v10_common_PromotionFeedItem_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ads.googleads.v10.common.ExtensionsProto.internal_static_google_ads_googleads_v10_common_PromotionFeedItem_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ads.googleads.v10.common.PromotionFeedItem.class, com.google.ads.googleads.v10.common.PromotionFeedItem.Builder.class);
}
// Construct using com.google.ads.googleads.v10.common.PromotionFeedItem.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
promotionTarget_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
discountModifier_ = 0;
promotionStartDate_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
promotionEndDate_ = "";
bitField0_ = (bitField0_ & ~0x00000004);
occasion_ = 0;
finalUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
finalMobileUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000010);
trackingUrlTemplate_ = "";
bitField0_ = (bitField0_ & ~0x00000020);
if (urlCustomParametersBuilder_ == null) {
urlCustomParameters_ = java.util.Collections.emptyList();
} else {
urlCustomParameters_ = null;
urlCustomParametersBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000040);
finalUrlSuffix_ = "";
bitField0_ = (bitField0_ & ~0x00000080);
languageCode_ = "";
bitField0_ = (bitField0_ & ~0x00000100);
if (moneyAmountOffBuilder_ != null) {
moneyAmountOffBuilder_.clear();
}
if (ordersOverAmountBuilder_ != null) {
ordersOverAmountBuilder_.clear();
}
discountTypeCase_ = 0;
discountType_ = null;
promotionTriggerCase_ = 0;
promotionTrigger_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.ads.googleads.v10.common.ExtensionsProto.internal_static_google_ads_googleads_v10_common_PromotionFeedItem_descriptor;
}
@java.lang.Override
public com.google.ads.googleads.v10.common.PromotionFeedItem getDefaultInstanceForType() {
return com.google.ads.googleads.v10.common.PromotionFeedItem.getDefaultInstance();
}
@java.lang.Override
public com.google.ads.googleads.v10.common.PromotionFeedItem build() {
com.google.ads.googleads.v10.common.PromotionFeedItem result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.ads.googleads.v10.common.PromotionFeedItem buildPartial() {
com.google.ads.googleads.v10.common.PromotionFeedItem result = new com.google.ads.googleads.v10.common.PromotionFeedItem(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
to_bitField0_ |= 0x00000001;
}
result.promotionTarget_ = promotionTarget_;
result.discountModifier_ = discountModifier_;
if (((from_bitField0_ & 0x00000002) != 0)) {
to_bitField0_ |= 0x00000002;
}
result.promotionStartDate_ = promotionStartDate_;
if (((from_bitField0_ & 0x00000004) != 0)) {
to_bitField0_ |= 0x00000004;
}
result.promotionEndDate_ = promotionEndDate_;
result.occasion_ = occasion_;
if (((bitField0_ & 0x00000008) != 0)) {
finalUrls_ = finalUrls_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000008);
}
result.finalUrls_ = finalUrls_;
if (((bitField0_ & 0x00000010) != 0)) {
finalMobileUrls_ = finalMobileUrls_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000010);
}
result.finalMobileUrls_ = finalMobileUrls_;
if (((from_bitField0_ & 0x00000020) != 0)) {
to_bitField0_ |= 0x00000008;
}
result.trackingUrlTemplate_ = trackingUrlTemplate_;
if (urlCustomParametersBuilder_ == null) {
if (((bitField0_ & 0x00000040) != 0)) {
urlCustomParameters_ = java.util.Collections.unmodifiableList(urlCustomParameters_);
bitField0_ = (bitField0_ & ~0x00000040);
}
result.urlCustomParameters_ = urlCustomParameters_;
} else {
result.urlCustomParameters_ = urlCustomParametersBuilder_.build();
}
if (((from_bitField0_ & 0x00000080) != 0)) {
to_bitField0_ |= 0x00000010;
}
result.finalUrlSuffix_ = finalUrlSuffix_;
if (((from_bitField0_ & 0x00000100) != 0)) {
to_bitField0_ |= 0x00000020;
}
result.languageCode_ = languageCode_;
if (discountTypeCase_ == 17) {
result.discountType_ = discountType_;
}
if (discountTypeCase_ == 4) {
if (moneyAmountOffBuilder_ == null) {
result.discountType_ = discountType_;
} else {
result.discountType_ = moneyAmountOffBuilder_.build();
}
}
if (promotionTriggerCase_ == 18) {
result.promotionTrigger_ = promotionTrigger_;
}
if (promotionTriggerCase_ == 6) {
if (ordersOverAmountBuilder_ == null) {
result.promotionTrigger_ = promotionTrigger_;
} else {
result.promotionTrigger_ = ordersOverAmountBuilder_.build();
}
}
result.bitField0_ = to_bitField0_;
result.discountTypeCase_ = discountTypeCase_;
result.promotionTriggerCase_ = promotionTriggerCase_;
onBuilt();
return result;
}
@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.ads.googleads.v10.common.PromotionFeedItem) {
return mergeFrom((com.google.ads.googleads.v10.common.PromotionFeedItem)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.ads.googleads.v10.common.PromotionFeedItem other) {
if (other == com.google.ads.googleads.v10.common.PromotionFeedItem.getDefaultInstance()) return this;
if (other.hasPromotionTarget()) {
bitField0_ |= 0x00000001;
promotionTarget_ = other.promotionTarget_;
onChanged();
}
if (other.discountModifier_ != 0) {
setDiscountModifierValue(other.getDiscountModifierValue());
}
if (other.hasPromotionStartDate()) {
bitField0_ |= 0x00000002;
promotionStartDate_ = other.promotionStartDate_;
onChanged();
}
if (other.hasPromotionEndDate()) {
bitField0_ |= 0x00000004;
promotionEndDate_ = other.promotionEndDate_;
onChanged();
}
if (other.occasion_ != 0) {
setOccasionValue(other.getOccasionValue());
}
if (!other.finalUrls_.isEmpty()) {
if (finalUrls_.isEmpty()) {
finalUrls_ = other.finalUrls_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureFinalUrlsIsMutable();
finalUrls_.addAll(other.finalUrls_);
}
onChanged();
}
if (!other.finalMobileUrls_.isEmpty()) {
if (finalMobileUrls_.isEmpty()) {
finalMobileUrls_ = other.finalMobileUrls_;
bitField0_ = (bitField0_ & ~0x00000010);
} else {
ensureFinalMobileUrlsIsMutable();
finalMobileUrls_.addAll(other.finalMobileUrls_);
}
onChanged();
}
if (other.hasTrackingUrlTemplate()) {
bitField0_ |= 0x00000020;
trackingUrlTemplate_ = other.trackingUrlTemplate_;
onChanged();
}
if (urlCustomParametersBuilder_ == null) {
if (!other.urlCustomParameters_.isEmpty()) {
if (urlCustomParameters_.isEmpty()) {
urlCustomParameters_ = other.urlCustomParameters_;
bitField0_ = (bitField0_ & ~0x00000040);
} else {
ensureUrlCustomParametersIsMutable();
urlCustomParameters_.addAll(other.urlCustomParameters_);
}
onChanged();
}
} else {
if (!other.urlCustomParameters_.isEmpty()) {
if (urlCustomParametersBuilder_.isEmpty()) {
urlCustomParametersBuilder_.dispose();
urlCustomParametersBuilder_ = null;
urlCustomParameters_ = other.urlCustomParameters_;
bitField0_ = (bitField0_ & ~0x00000040);
urlCustomParametersBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getUrlCustomParametersFieldBuilder() : null;
} else {
urlCustomParametersBuilder_.addAllMessages(other.urlCustomParameters_);
}
}
}
if (other.hasFinalUrlSuffix()) {
bitField0_ |= 0x00000080;
finalUrlSuffix_ = other.finalUrlSuffix_;
onChanged();
}
if (other.hasLanguageCode()) {
bitField0_ |= 0x00000100;
languageCode_ = other.languageCode_;
onChanged();
}
switch (other.getDiscountTypeCase()) {
case PERCENT_OFF: {
setPercentOff(other.getPercentOff());
break;
}
case MONEY_AMOUNT_OFF: {
mergeMoneyAmountOff(other.getMoneyAmountOff());
break;
}
case DISCOUNTTYPE_NOT_SET: {
break;
}
}
switch (other.getPromotionTriggerCase()) {
case PROMOTION_CODE: {
promotionTriggerCase_ = 18;
promotionTrigger_ = other.promotionTrigger_;
onChanged();
break;
}
case ORDERS_OVER_AMOUNT: {
mergeOrdersOverAmount(other.getOrdersOverAmount());
break;
}
case PROMOTIONTRIGGER_NOT_SET: {
break;
}
}
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 16: {
discountModifier_ = input.readEnum();
break;
} // case 16
case 34: {
input.readMessage(
getMoneyAmountOffFieldBuilder().getBuilder(),
extensionRegistry);
discountTypeCase_ = 4;
break;
} // case 34
case 50: {
input.readMessage(
getOrdersOverAmountFieldBuilder().getBuilder(),
extensionRegistry);
promotionTriggerCase_ = 6;
break;
} // case 50
case 72: {
occasion_ = input.readEnum();
break;
} // case 72
case 106: {
com.google.ads.googleads.v10.common.CustomParameter m =
input.readMessage(
com.google.ads.googleads.v10.common.CustomParameter.parser(),
extensionRegistry);
if (urlCustomParametersBuilder_ == null) {
ensureUrlCustomParametersIsMutable();
urlCustomParameters_.add(m);
} else {
urlCustomParametersBuilder_.addMessage(m);
}
break;
} // case 106
case 130: {
promotionTarget_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 130
case 136: {
discountType_ = input.readInt64();
discountTypeCase_ = 17;
break;
} // case 136
case 146: {
java.lang.String s = input.readStringRequireUtf8();
promotionTriggerCase_ = 18;
promotionTrigger_ = s;
break;
} // case 146
case 154: {
promotionStartDate_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 154
case 162: {
promotionEndDate_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000004;
break;
} // case 162
case 170: {
java.lang.String s = input.readStringRequireUtf8();
ensureFinalUrlsIsMutable();
finalUrls_.add(s);
break;
} // case 170
case 178: {
java.lang.String s = input.readStringRequireUtf8();
ensureFinalMobileUrlsIsMutable();
finalMobileUrls_.add(s);
break;
} // case 178
case 186: {
trackingUrlTemplate_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000020;
break;
} // case 186
case 194: {
finalUrlSuffix_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000080;
break;
} // case 194
case 202: {
languageCode_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000100;
break;
} // case 202
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 discountTypeCase_ = 0;
private java.lang.Object discountType_;
public DiscountTypeCase
getDiscountTypeCase() {
return DiscountTypeCase.forNumber(
discountTypeCase_);
}
public Builder clearDiscountType() {
discountTypeCase_ = 0;
discountType_ = null;
onChanged();
return this;
}
private int promotionTriggerCase_ = 0;
private java.lang.Object promotionTrigger_;
public PromotionTriggerCase
getPromotionTriggerCase() {
return PromotionTriggerCase.forNumber(
promotionTriggerCase_);
}
public Builder clearPromotionTrigger() {
promotionTriggerCase_ = 0;
promotionTrigger_ = null;
onChanged();
return this;
}
private int bitField0_;
private java.lang.Object promotionTarget_ = "";
/**
*
* A freeform description of what the promotion is targeting.
* This field is required.
*
*
* optional string promotion_target = 16;
* @return Whether the promotionTarget field is set.
*/
public boolean hasPromotionTarget() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* A freeform description of what the promotion is targeting.
* This field is required.
*
*
* optional string promotion_target = 16;
* @return The promotionTarget.
*/
public java.lang.String getPromotionTarget() {
java.lang.Object ref = promotionTarget_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
promotionTarget_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* A freeform description of what the promotion is targeting.
* This field is required.
*
*
* optional string promotion_target = 16;
* @return The bytes for promotionTarget.
*/
public com.google.protobuf.ByteString
getPromotionTargetBytes() {
java.lang.Object ref = promotionTarget_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
promotionTarget_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* A freeform description of what the promotion is targeting.
* This field is required.
*
*
* optional string promotion_target = 16;
* @param value The promotionTarget to set.
* @return This builder for chaining.
*/
public Builder setPromotionTarget(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
promotionTarget_ = value;
onChanged();
return this;
}
/**
*
* A freeform description of what the promotion is targeting.
* This field is required.
*
*
* optional string promotion_target = 16;
* @return This builder for chaining.
*/
public Builder clearPromotionTarget() {
bitField0_ = (bitField0_ & ~0x00000001);
promotionTarget_ = getDefaultInstance().getPromotionTarget();
onChanged();
return this;
}
/**
*
* A freeform description of what the promotion is targeting.
* This field is required.
*
*
* optional string promotion_target = 16;
* @param value The bytes for promotionTarget to set.
* @return This builder for chaining.
*/
public Builder setPromotionTargetBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
bitField0_ |= 0x00000001;
promotionTarget_ = value;
onChanged();
return this;
}
private int discountModifier_ = 0;
/**
*
* Enum that modifies the qualification of the discount.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier discount_modifier = 2;
* @return The enum numeric value on the wire for discountModifier.
*/
@java.lang.Override public int getDiscountModifierValue() {
return discountModifier_;
}
/**
*
* Enum that modifies the qualification of the discount.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier discount_modifier = 2;
* @param value The enum numeric value on the wire for discountModifier to set.
* @return This builder for chaining.
*/
public Builder setDiscountModifierValue(int value) {
discountModifier_ = value;
onChanged();
return this;
}
/**
*
* Enum that modifies the qualification of the discount.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier discount_modifier = 2;
* @return The discountModifier.
*/
@java.lang.Override
public com.google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier getDiscountModifier() {
@SuppressWarnings("deprecation")
com.google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier result = com.google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier.valueOf(discountModifier_);
return result == null ? com.google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier.UNRECOGNIZED : result;
}
/**
*
* Enum that modifies the qualification of the discount.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier discount_modifier = 2;
* @param value The discountModifier to set.
* @return This builder for chaining.
*/
public Builder setDiscountModifier(com.google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier value) {
if (value == null) {
throw new NullPointerException();
}
discountModifier_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Enum that modifies the qualification of the discount.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier discount_modifier = 2;
* @return This builder for chaining.
*/
public Builder clearDiscountModifier() {
discountModifier_ = 0;
onChanged();
return this;
}
private java.lang.Object promotionStartDate_ = "";
/**
*
* Start date of when the promotion is eligible to be redeemed.
*
*
* optional string promotion_start_date = 19;
* @return Whether the promotionStartDate field is set.
*/
public boolean hasPromotionStartDate() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* Start date of when the promotion is eligible to be redeemed.
*
*
* optional string promotion_start_date = 19;
* @return The promotionStartDate.
*/
public java.lang.String getPromotionStartDate() {
java.lang.Object ref = promotionStartDate_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
promotionStartDate_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Start date of when the promotion is eligible to be redeemed.
*
*
* optional string promotion_start_date = 19;
* @return The bytes for promotionStartDate.
*/
public com.google.protobuf.ByteString
getPromotionStartDateBytes() {
java.lang.Object ref = promotionStartDate_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
promotionStartDate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Start date of when the promotion is eligible to be redeemed.
*
*
* optional string promotion_start_date = 19;
* @param value The promotionStartDate to set.
* @return This builder for chaining.
*/
public Builder setPromotionStartDate(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
promotionStartDate_ = value;
onChanged();
return this;
}
/**
*
* Start date of when the promotion is eligible to be redeemed.
*
*
* optional string promotion_start_date = 19;
* @return This builder for chaining.
*/
public Builder clearPromotionStartDate() {
bitField0_ = (bitField0_ & ~0x00000002);
promotionStartDate_ = getDefaultInstance().getPromotionStartDate();
onChanged();
return this;
}
/**
*
* Start date of when the promotion is eligible to be redeemed.
*
*
* optional string promotion_start_date = 19;
* @param value The bytes for promotionStartDate to set.
* @return This builder for chaining.
*/
public Builder setPromotionStartDateBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
bitField0_ |= 0x00000002;
promotionStartDate_ = value;
onChanged();
return this;
}
private java.lang.Object promotionEndDate_ = "";
/**
*
* Last date when the promotion is eligible to be redeemed.
*
*
* optional string promotion_end_date = 20;
* @return Whether the promotionEndDate field is set.
*/
public boolean hasPromotionEndDate() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* Last date when the promotion is eligible to be redeemed.
*
*
* optional string promotion_end_date = 20;
* @return The promotionEndDate.
*/
public java.lang.String getPromotionEndDate() {
java.lang.Object ref = promotionEndDate_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
promotionEndDate_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Last date when the promotion is eligible to be redeemed.
*
*
* optional string promotion_end_date = 20;
* @return The bytes for promotionEndDate.
*/
public com.google.protobuf.ByteString
getPromotionEndDateBytes() {
java.lang.Object ref = promotionEndDate_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
promotionEndDate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Last date when the promotion is eligible to be redeemed.
*
*
* optional string promotion_end_date = 20;
* @param value The promotionEndDate to set.
* @return This builder for chaining.
*/
public Builder setPromotionEndDate(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
promotionEndDate_ = value;
onChanged();
return this;
}
/**
*
* Last date when the promotion is eligible to be redeemed.
*
*
* optional string promotion_end_date = 20;
* @return This builder for chaining.
*/
public Builder clearPromotionEndDate() {
bitField0_ = (bitField0_ & ~0x00000004);
promotionEndDate_ = getDefaultInstance().getPromotionEndDate();
onChanged();
return this;
}
/**
*
* Last date when the promotion is eligible to be redeemed.
*
*
* optional string promotion_end_date = 20;
* @param value The bytes for promotionEndDate to set.
* @return This builder for chaining.
*/
public Builder setPromotionEndDateBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
bitField0_ |= 0x00000004;
promotionEndDate_ = value;
onChanged();
return this;
}
private int occasion_ = 0;
/**
*
* The occasion the promotion was intended for.
* If an occasion is set, the redemption window will need to fall within
* the date range associated with the occasion.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion occasion = 9;
* @return The enum numeric value on the wire for occasion.
*/
@java.lang.Override public int getOccasionValue() {
return occasion_;
}
/**
*
* The occasion the promotion was intended for.
* If an occasion is set, the redemption window will need to fall within
* the date range associated with the occasion.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion occasion = 9;
* @param value The enum numeric value on the wire for occasion to set.
* @return This builder for chaining.
*/
public Builder setOccasionValue(int value) {
occasion_ = value;
onChanged();
return this;
}
/**
*
* The occasion the promotion was intended for.
* If an occasion is set, the redemption window will need to fall within
* the date range associated with the occasion.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion occasion = 9;
* @return The occasion.
*/
@java.lang.Override
public com.google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion getOccasion() {
@SuppressWarnings("deprecation")
com.google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion result = com.google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion.valueOf(occasion_);
return result == null ? com.google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion.UNRECOGNIZED : result;
}
/**
*
* The occasion the promotion was intended for.
* If an occasion is set, the redemption window will need to fall within
* the date range associated with the occasion.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion occasion = 9;
* @param value The occasion to set.
* @return This builder for chaining.
*/
public Builder setOccasion(com.google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion value) {
if (value == null) {
throw new NullPointerException();
}
occasion_ = value.getNumber();
onChanged();
return this;
}
/**
*
* The occasion the promotion was intended for.
* If an occasion is set, the redemption window will need to fall within
* the date range associated with the occasion.
*
*
* .google.ads.googleads.v10.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion occasion = 9;
* @return This builder for chaining.
*/
public Builder clearOccasion() {
occasion_ = 0;
onChanged();
return this;
}
private com.google.protobuf.LazyStringList finalUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureFinalUrlsIsMutable() {
if (!((bitField0_ & 0x00000008) != 0)) {
finalUrls_ = new com.google.protobuf.LazyStringArrayList(finalUrls_);
bitField0_ |= 0x00000008;
}
}
/**
*
* A list of possible final URLs after all cross domain redirects.
* This field is required.
*
*
* repeated string final_urls = 21;
* @return A list containing the finalUrls.
*/
public com.google.protobuf.ProtocolStringList
getFinalUrlsList() {
return finalUrls_.getUnmodifiableView();
}
/**
*
* A list of possible final URLs after all cross domain redirects.
* This field is required.
*
*
* repeated string final_urls = 21;
* @return The count of finalUrls.
*/
public int getFinalUrlsCount() {
return finalUrls_.size();
}
/**
*
* A list of possible final URLs after all cross domain redirects.
* This field is required.
*
*
* repeated string final_urls = 21;
* @param index The index of the element to return.
* @return The finalUrls at the given index.
*/
public java.lang.String getFinalUrls(int index) {
return finalUrls_.get(index);
}
/**
*
* A list of possible final URLs after all cross domain redirects.
* This field is required.
*
*
* repeated string final_urls = 21;
* @param index The index of the value to return.
* @return The bytes of the finalUrls at the given index.
*/
public com.google.protobuf.ByteString
getFinalUrlsBytes(int index) {
return finalUrls_.getByteString(index);
}
/**
*
* A list of possible final URLs after all cross domain redirects.
* This field is required.
*
*
* repeated string final_urls = 21;
* @param index The index to set the value at.
* @param value The finalUrls to set.
* @return This builder for chaining.
*/
public Builder setFinalUrls(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureFinalUrlsIsMutable();
finalUrls_.set(index, value);
onChanged();
return this;
}
/**
*
* A list of possible final URLs after all cross domain redirects.
* This field is required.
*
*
* repeated string final_urls = 21;
* @param value The finalUrls to add.
* @return This builder for chaining.
*/
public Builder addFinalUrls(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureFinalUrlsIsMutable();
finalUrls_.add(value);
onChanged();
return this;
}
/**
*
* A list of possible final URLs after all cross domain redirects.
* This field is required.
*
*
* repeated string final_urls = 21;
* @param values The finalUrls to add.
* @return This builder for chaining.
*/
public Builder addAllFinalUrls(
java.lang.Iterable values) {
ensureFinalUrlsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, finalUrls_);
onChanged();
return this;
}
/**
*
* A list of possible final URLs after all cross domain redirects.
* This field is required.
*
*
* repeated string final_urls = 21;
* @return This builder for chaining.
*/
public Builder clearFinalUrls() {
finalUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
/**
*
* A list of possible final URLs after all cross domain redirects.
* This field is required.
*
*
* repeated string final_urls = 21;
* @param value The bytes of the finalUrls to add.
* @return This builder for chaining.
*/
public Builder addFinalUrlsBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureFinalUrlsIsMutable();
finalUrls_.add(value);
onChanged();
return this;
}
private com.google.protobuf.LazyStringList finalMobileUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureFinalMobileUrlsIsMutable() {
if (!((bitField0_ & 0x00000010) != 0)) {
finalMobileUrls_ = new com.google.protobuf.LazyStringArrayList(finalMobileUrls_);
bitField0_ |= 0x00000010;
}
}
/**
*
* A list of possible final mobile URLs after all cross domain redirects.
*
*
* repeated string final_mobile_urls = 22;
* @return A list containing the finalMobileUrls.
*/
public com.google.protobuf.ProtocolStringList
getFinalMobileUrlsList() {
return finalMobileUrls_.getUnmodifiableView();
}
/**
*
* A list of possible final mobile URLs after all cross domain redirects.
*
*
* repeated string final_mobile_urls = 22;
* @return The count of finalMobileUrls.
*/
public int getFinalMobileUrlsCount() {
return finalMobileUrls_.size();
}
/**
*
* A list of possible final mobile URLs after all cross domain redirects.
*
*
* repeated string final_mobile_urls = 22;
* @param index The index of the element to return.
* @return The finalMobileUrls at the given index.
*/
public java.lang.String getFinalMobileUrls(int index) {
return finalMobileUrls_.get(index);
}
/**
*
* A list of possible final mobile URLs after all cross domain redirects.
*
*
* repeated string final_mobile_urls = 22;
* @param index The index of the value to return.
* @return The bytes of the finalMobileUrls at the given index.
*/
public com.google.protobuf.ByteString
getFinalMobileUrlsBytes(int index) {
return finalMobileUrls_.getByteString(index);
}
/**
*
* A list of possible final mobile URLs after all cross domain redirects.
*
*
* repeated string final_mobile_urls = 22;
* @param index The index to set the value at.
* @param value The finalMobileUrls to set.
* @return This builder for chaining.
*/
public Builder setFinalMobileUrls(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureFinalMobileUrlsIsMutable();
finalMobileUrls_.set(index, value);
onChanged();
return this;
}
/**
*
* A list of possible final mobile URLs after all cross domain redirects.
*
*
* repeated string final_mobile_urls = 22;
* @param value The finalMobileUrls to add.
* @return This builder for chaining.
*/
public Builder addFinalMobileUrls(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureFinalMobileUrlsIsMutable();
finalMobileUrls_.add(value);
onChanged();
return this;
}
/**
*
* A list of possible final mobile URLs after all cross domain redirects.
*
*
* repeated string final_mobile_urls = 22;
* @param values The finalMobileUrls to add.
* @return This builder for chaining.
*/
public Builder addAllFinalMobileUrls(
java.lang.Iterable values) {
ensureFinalMobileUrlsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, finalMobileUrls_);
onChanged();
return this;
}
/**
*
* A list of possible final mobile URLs after all cross domain redirects.
*
*
* repeated string final_mobile_urls = 22;
* @return This builder for chaining.
*/
public Builder clearFinalMobileUrls() {
finalMobileUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000010);
onChanged();
return this;
}
/**
*
* A list of possible final mobile URLs after all cross domain redirects.
*
*
* repeated string final_mobile_urls = 22;
* @param value The bytes of the finalMobileUrls to add.
* @return This builder for chaining.
*/
public Builder addFinalMobileUrlsBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureFinalMobileUrlsIsMutable();
finalMobileUrls_.add(value);
onChanged();
return this;
}
private java.lang.Object trackingUrlTemplate_ = "";
/**
*
* URL template for constructing a tracking URL.
*
*
* optional string tracking_url_template = 23;
* @return Whether the trackingUrlTemplate field is set.
*/
public boolean hasTrackingUrlTemplate() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
*
* URL template for constructing a tracking URL.
*
*
* optional string tracking_url_template = 23;
* @return The trackingUrlTemplate.
*/
public java.lang.String getTrackingUrlTemplate() {
java.lang.Object ref = trackingUrlTemplate_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
trackingUrlTemplate_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* URL template for constructing a tracking URL.
*
*
* optional string tracking_url_template = 23;
* @return The bytes for trackingUrlTemplate.
*/
public com.google.protobuf.ByteString
getTrackingUrlTemplateBytes() {
java.lang.Object ref = trackingUrlTemplate_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
trackingUrlTemplate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* URL template for constructing a tracking URL.
*
*
* optional string tracking_url_template = 23;
* @param value The trackingUrlTemplate to set.
* @return This builder for chaining.
*/
public Builder setTrackingUrlTemplate(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
trackingUrlTemplate_ = value;
onChanged();
return this;
}
/**
*
* URL template for constructing a tracking URL.
*
*
* optional string tracking_url_template = 23;
* @return This builder for chaining.
*/
public Builder clearTrackingUrlTemplate() {
bitField0_ = (bitField0_ & ~0x00000020);
trackingUrlTemplate_ = getDefaultInstance().getTrackingUrlTemplate();
onChanged();
return this;
}
/**
*
* URL template for constructing a tracking URL.
*
*
* optional string tracking_url_template = 23;
* @param value The bytes for trackingUrlTemplate to set.
* @return This builder for chaining.
*/
public Builder setTrackingUrlTemplateBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
bitField0_ |= 0x00000020;
trackingUrlTemplate_ = value;
onChanged();
return this;
}
private java.util.List urlCustomParameters_ =
java.util.Collections.emptyList();
private void ensureUrlCustomParametersIsMutable() {
if (!((bitField0_ & 0x00000040) != 0)) {
urlCustomParameters_ = new java.util.ArrayList(urlCustomParameters_);
bitField0_ |= 0x00000040;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.ads.googleads.v10.common.CustomParameter, com.google.ads.googleads.v10.common.CustomParameter.Builder, com.google.ads.googleads.v10.common.CustomParameterOrBuilder> urlCustomParametersBuilder_;
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public java.util.List getUrlCustomParametersList() {
if (urlCustomParametersBuilder_ == null) {
return java.util.Collections.unmodifiableList(urlCustomParameters_);
} else {
return urlCustomParametersBuilder_.getMessageList();
}
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public int getUrlCustomParametersCount() {
if (urlCustomParametersBuilder_ == null) {
return urlCustomParameters_.size();
} else {
return urlCustomParametersBuilder_.getCount();
}
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public com.google.ads.googleads.v10.common.CustomParameter getUrlCustomParameters(int index) {
if (urlCustomParametersBuilder_ == null) {
return urlCustomParameters_.get(index);
} else {
return urlCustomParametersBuilder_.getMessage(index);
}
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public Builder setUrlCustomParameters(
int index, com.google.ads.googleads.v10.common.CustomParameter value) {
if (urlCustomParametersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureUrlCustomParametersIsMutable();
urlCustomParameters_.set(index, value);
onChanged();
} else {
urlCustomParametersBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public Builder setUrlCustomParameters(
int index, com.google.ads.googleads.v10.common.CustomParameter.Builder builderForValue) {
if (urlCustomParametersBuilder_ == null) {
ensureUrlCustomParametersIsMutable();
urlCustomParameters_.set(index, builderForValue.build());
onChanged();
} else {
urlCustomParametersBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public Builder addUrlCustomParameters(com.google.ads.googleads.v10.common.CustomParameter value) {
if (urlCustomParametersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureUrlCustomParametersIsMutable();
urlCustomParameters_.add(value);
onChanged();
} else {
urlCustomParametersBuilder_.addMessage(value);
}
return this;
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public Builder addUrlCustomParameters(
int index, com.google.ads.googleads.v10.common.CustomParameter value) {
if (urlCustomParametersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureUrlCustomParametersIsMutable();
urlCustomParameters_.add(index, value);
onChanged();
} else {
urlCustomParametersBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public Builder addUrlCustomParameters(
com.google.ads.googleads.v10.common.CustomParameter.Builder builderForValue) {
if (urlCustomParametersBuilder_ == null) {
ensureUrlCustomParametersIsMutable();
urlCustomParameters_.add(builderForValue.build());
onChanged();
} else {
urlCustomParametersBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public Builder addUrlCustomParameters(
int index, com.google.ads.googleads.v10.common.CustomParameter.Builder builderForValue) {
if (urlCustomParametersBuilder_ == null) {
ensureUrlCustomParametersIsMutable();
urlCustomParameters_.add(index, builderForValue.build());
onChanged();
} else {
urlCustomParametersBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public Builder addAllUrlCustomParameters(
java.lang.Iterable extends com.google.ads.googleads.v10.common.CustomParameter> values) {
if (urlCustomParametersBuilder_ == null) {
ensureUrlCustomParametersIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, urlCustomParameters_);
onChanged();
} else {
urlCustomParametersBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public Builder clearUrlCustomParameters() {
if (urlCustomParametersBuilder_ == null) {
urlCustomParameters_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000040);
onChanged();
} else {
urlCustomParametersBuilder_.clear();
}
return this;
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public Builder removeUrlCustomParameters(int index) {
if (urlCustomParametersBuilder_ == null) {
ensureUrlCustomParametersIsMutable();
urlCustomParameters_.remove(index);
onChanged();
} else {
urlCustomParametersBuilder_.remove(index);
}
return this;
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public com.google.ads.googleads.v10.common.CustomParameter.Builder getUrlCustomParametersBuilder(
int index) {
return getUrlCustomParametersFieldBuilder().getBuilder(index);
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public com.google.ads.googleads.v10.common.CustomParameterOrBuilder getUrlCustomParametersOrBuilder(
int index) {
if (urlCustomParametersBuilder_ == null) {
return urlCustomParameters_.get(index); } else {
return urlCustomParametersBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public java.util.List extends com.google.ads.googleads.v10.common.CustomParameterOrBuilder>
getUrlCustomParametersOrBuilderList() {
if (urlCustomParametersBuilder_ != null) {
return urlCustomParametersBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(urlCustomParameters_);
}
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public com.google.ads.googleads.v10.common.CustomParameter.Builder addUrlCustomParametersBuilder() {
return getUrlCustomParametersFieldBuilder().addBuilder(
com.google.ads.googleads.v10.common.CustomParameter.getDefaultInstance());
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public com.google.ads.googleads.v10.common.CustomParameter.Builder addUrlCustomParametersBuilder(
int index) {
return getUrlCustomParametersFieldBuilder().addBuilder(
index, com.google.ads.googleads.v10.common.CustomParameter.getDefaultInstance());
}
/**
*
* A list of mappings to be used for substituting URL custom parameter tags in
* the tracking_url_template, final_urls, and/or final_mobile_urls.
*
*
* repeated .google.ads.googleads.v10.common.CustomParameter url_custom_parameters = 13;
*/
public java.util.List
getUrlCustomParametersBuilderList() {
return getUrlCustomParametersFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.ads.googleads.v10.common.CustomParameter, com.google.ads.googleads.v10.common.CustomParameter.Builder, com.google.ads.googleads.v10.common.CustomParameterOrBuilder>
getUrlCustomParametersFieldBuilder() {
if (urlCustomParametersBuilder_ == null) {
urlCustomParametersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.ads.googleads.v10.common.CustomParameter, com.google.ads.googleads.v10.common.CustomParameter.Builder, com.google.ads.googleads.v10.common.CustomParameterOrBuilder>(
urlCustomParameters_,
((bitField0_ & 0x00000040) != 0),
getParentForChildren(),
isClean());
urlCustomParameters_ = null;
}
return urlCustomParametersBuilder_;
}
private java.lang.Object finalUrlSuffix_ = "";
/**
*
* URL template for appending params to landing page URLs served with parallel
* tracking.
*
*
* optional string final_url_suffix = 24;
* @return Whether the finalUrlSuffix field is set.
*/
public boolean hasFinalUrlSuffix() {
return ((bitField0_ & 0x00000080) != 0);
}
/**
*
* URL template for appending params to landing page URLs served with parallel
* tracking.
*
*
* optional string final_url_suffix = 24;
* @return The finalUrlSuffix.
*/
public java.lang.String getFinalUrlSuffix() {
java.lang.Object ref = finalUrlSuffix_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
finalUrlSuffix_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* URL template for appending params to landing page URLs served with parallel
* tracking.
*
*
* optional string final_url_suffix = 24;
* @return The bytes for finalUrlSuffix.
*/
public com.google.protobuf.ByteString
getFinalUrlSuffixBytes() {
java.lang.Object ref = finalUrlSuffix_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
finalUrlSuffix_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* URL template for appending params to landing page URLs served with parallel
* tracking.
*
*
* optional string final_url_suffix = 24;
* @param value The finalUrlSuffix to set.
* @return This builder for chaining.
*/
public Builder setFinalUrlSuffix(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000080;
finalUrlSuffix_ = value;
onChanged();
return this;
}
/**
*
* URL template for appending params to landing page URLs served with parallel
* tracking.
*
*
* optional string final_url_suffix = 24;
* @return This builder for chaining.
*/
public Builder clearFinalUrlSuffix() {
bitField0_ = (bitField0_ & ~0x00000080);
finalUrlSuffix_ = getDefaultInstance().getFinalUrlSuffix();
onChanged();
return this;
}
/**
*
* URL template for appending params to landing page URLs served with parallel
* tracking.
*
*
* optional string final_url_suffix = 24;
* @param value The bytes for finalUrlSuffix to set.
* @return This builder for chaining.
*/
public Builder setFinalUrlSuffixBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
bitField0_ |= 0x00000080;
finalUrlSuffix_ = value;
onChanged();
return this;
}
private java.lang.Object languageCode_ = "";
/**
*
* The language of the promotion.
* Represented as BCP 47 language tag.
*
*
* optional string language_code = 25;
* @return Whether the languageCode field is set.
*/
public boolean hasLanguageCode() {
return ((bitField0_ & 0x00000100) != 0);
}
/**
*
* The language of the promotion.
* Represented as BCP 47 language tag.
*
*
* optional string language_code = 25;
* @return The languageCode.
*/
public java.lang.String getLanguageCode() {
java.lang.Object ref = languageCode_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
languageCode_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The language of the promotion.
* Represented as BCP 47 language tag.
*
*
* optional string language_code = 25;
* @return The bytes for languageCode.
*/
public com.google.protobuf.ByteString
getLanguageCodeBytes() {
java.lang.Object ref = languageCode_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
languageCode_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The language of the promotion.
* Represented as BCP 47 language tag.
*
*
* optional string language_code = 25;
* @param value The languageCode to set.
* @return This builder for chaining.
*/
public Builder setLanguageCode(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000100;
languageCode_ = value;
onChanged();
return this;
}
/**
*
* The language of the promotion.
* Represented as BCP 47 language tag.
*
*
* optional string language_code = 25;
* @return This builder for chaining.
*/
public Builder clearLanguageCode() {
bitField0_ = (bitField0_ & ~0x00000100);
languageCode_ = getDefaultInstance().getLanguageCode();
onChanged();
return this;
}
/**
*
* The language of the promotion.
* Represented as BCP 47 language tag.
*
*
* optional string language_code = 25;
* @param value The bytes for languageCode to set.
* @return This builder for chaining.
*/
public Builder setLanguageCodeBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
bitField0_ |= 0x00000100;
languageCode_ = value;
onChanged();
return this;
}
/**
*
* Percentage off discount in the promotion in micros.
* One million is equivalent to one percent.
* Either this or money_off_amount is required.
*
*
* int64 percent_off = 17;
* @return Whether the percentOff field is set.
*/
public boolean hasPercentOff() {
return discountTypeCase_ == 17;
}
/**
*
* Percentage off discount in the promotion in micros.
* One million is equivalent to one percent.
* Either this or money_off_amount is required.
*
*
* int64 percent_off = 17;
* @return The percentOff.
*/
public long getPercentOff() {
if (discountTypeCase_ == 17) {
return (java.lang.Long) discountType_;
}
return 0L;
}
/**
*
* Percentage off discount in the promotion in micros.
* One million is equivalent to one percent.
* Either this or money_off_amount is required.
*
*
* int64 percent_off = 17;
* @param value The percentOff to set.
* @return This builder for chaining.
*/
public Builder setPercentOff(long value) {
discountTypeCase_ = 17;
discountType_ = value;
onChanged();
return this;
}
/**
*
* Percentage off discount in the promotion in micros.
* One million is equivalent to one percent.
* Either this or money_off_amount is required.
*
*
* int64 percent_off = 17;
* @return This builder for chaining.
*/
public Builder clearPercentOff() {
if (discountTypeCase_ == 17) {
discountTypeCase_ = 0;
discountType_ = null;
onChanged();
}
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.ads.googleads.v10.common.Money, com.google.ads.googleads.v10.common.Money.Builder, com.google.ads.googleads.v10.common.MoneyOrBuilder> moneyAmountOffBuilder_;
/**
*
* Money amount off for discount in the promotion.
* Either this or percent_off is required.
*
*
* .google.ads.googleads.v10.common.Money money_amount_off = 4;
* @return Whether the moneyAmountOff field is set.
*/
@java.lang.Override
public boolean hasMoneyAmountOff() {
return discountTypeCase_ == 4;
}
/**
*
* Money amount off for discount in the promotion.
* Either this or percent_off is required.
*
*
* .google.ads.googleads.v10.common.Money money_amount_off = 4;
* @return The moneyAmountOff.
*/
@java.lang.Override
public com.google.ads.googleads.v10.common.Money getMoneyAmountOff() {
if (moneyAmountOffBuilder_ == null) {
if (discountTypeCase_ == 4) {
return (com.google.ads.googleads.v10.common.Money) discountType_;
}
return com.google.ads.googleads.v10.common.Money.getDefaultInstance();
} else {
if (discountTypeCase_ == 4) {
return moneyAmountOffBuilder_.getMessage();
}
return com.google.ads.googleads.v10.common.Money.getDefaultInstance();
}
}
/**
*
* Money amount off for discount in the promotion.
* Either this or percent_off is required.
*
*
* .google.ads.googleads.v10.common.Money money_amount_off = 4;
*/
public Builder setMoneyAmountOff(com.google.ads.googleads.v10.common.Money value) {
if (moneyAmountOffBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
discountType_ = value;
onChanged();
} else {
moneyAmountOffBuilder_.setMessage(value);
}
discountTypeCase_ = 4;
return this;
}
/**
*
* Money amount off for discount in the promotion.
* Either this or percent_off is required.
*
*
* .google.ads.googleads.v10.common.Money money_amount_off = 4;
*/
public Builder setMoneyAmountOff(
com.google.ads.googleads.v10.common.Money.Builder builderForValue) {
if (moneyAmountOffBuilder_ == null) {
discountType_ = builderForValue.build();
onChanged();
} else {
moneyAmountOffBuilder_.setMessage(builderForValue.build());
}
discountTypeCase_ = 4;
return this;
}
/**
*
* Money amount off for discount in the promotion.
* Either this or percent_off is required.
*
*
* .google.ads.googleads.v10.common.Money money_amount_off = 4;
*/
public Builder mergeMoneyAmountOff(com.google.ads.googleads.v10.common.Money value) {
if (moneyAmountOffBuilder_ == null) {
if (discountTypeCase_ == 4 &&
discountType_ != com.google.ads.googleads.v10.common.Money.getDefaultInstance()) {
discountType_ = com.google.ads.googleads.v10.common.Money.newBuilder((com.google.ads.googleads.v10.common.Money) discountType_)
.mergeFrom(value).buildPartial();
} else {
discountType_ = value;
}
onChanged();
} else {
if (discountTypeCase_ == 4) {
moneyAmountOffBuilder_.mergeFrom(value);
} else {
moneyAmountOffBuilder_.setMessage(value);
}
}
discountTypeCase_ = 4;
return this;
}
/**
*
* Money amount off for discount in the promotion.
* Either this or percent_off is required.
*
*
* .google.ads.googleads.v10.common.Money money_amount_off = 4;
*/
public Builder clearMoneyAmountOff() {
if (moneyAmountOffBuilder_ == null) {
if (discountTypeCase_ == 4) {
discountTypeCase_ = 0;
discountType_ = null;
onChanged();
}
} else {
if (discountTypeCase_ == 4) {
discountTypeCase_ = 0;
discountType_ = null;
}
moneyAmountOffBuilder_.clear();
}
return this;
}
/**
*
* Money amount off for discount in the promotion.
* Either this or percent_off is required.
*
*
* .google.ads.googleads.v10.common.Money money_amount_off = 4;
*/
public com.google.ads.googleads.v10.common.Money.Builder getMoneyAmountOffBuilder() {
return getMoneyAmountOffFieldBuilder().getBuilder();
}
/**
*
* Money amount off for discount in the promotion.
* Either this or percent_off is required.
*
*
* .google.ads.googleads.v10.common.Money money_amount_off = 4;
*/
@java.lang.Override
public com.google.ads.googleads.v10.common.MoneyOrBuilder getMoneyAmountOffOrBuilder() {
if ((discountTypeCase_ == 4) && (moneyAmountOffBuilder_ != null)) {
return moneyAmountOffBuilder_.getMessageOrBuilder();
} else {
if (discountTypeCase_ == 4) {
return (com.google.ads.googleads.v10.common.Money) discountType_;
}
return com.google.ads.googleads.v10.common.Money.getDefaultInstance();
}
}
/**
*
* Money amount off for discount in the promotion.
* Either this or percent_off is required.
*
*
* .google.ads.googleads.v10.common.Money money_amount_off = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.ads.googleads.v10.common.Money, com.google.ads.googleads.v10.common.Money.Builder, com.google.ads.googleads.v10.common.MoneyOrBuilder>
getMoneyAmountOffFieldBuilder() {
if (moneyAmountOffBuilder_ == null) {
if (!(discountTypeCase_ == 4)) {
discountType_ = com.google.ads.googleads.v10.common.Money.getDefaultInstance();
}
moneyAmountOffBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.ads.googleads.v10.common.Money, com.google.ads.googleads.v10.common.Money.Builder, com.google.ads.googleads.v10.common.MoneyOrBuilder>(
(com.google.ads.googleads.v10.common.Money) discountType_,
getParentForChildren(),
isClean());
discountType_ = null;
}
discountTypeCase_ = 4;
onChanged();;
return moneyAmountOffBuilder_;
}
/**
*
* A code the user should use in order to be eligible for the promotion.
*
*
* string promotion_code = 18;
* @return Whether the promotionCode field is set.
*/
@java.lang.Override
public boolean hasPromotionCode() {
return promotionTriggerCase_ == 18;
}
/**
*
* A code the user should use in order to be eligible for the promotion.
*
*
* string promotion_code = 18;
* @return The promotionCode.
*/
@java.lang.Override
public java.lang.String getPromotionCode() {
java.lang.Object ref = "";
if (promotionTriggerCase_ == 18) {
ref = promotionTrigger_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (promotionTriggerCase_ == 18) {
promotionTrigger_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* A code the user should use in order to be eligible for the promotion.
*
*
* string promotion_code = 18;
* @return The bytes for promotionCode.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getPromotionCodeBytes() {
java.lang.Object ref = "";
if (promotionTriggerCase_ == 18) {
ref = promotionTrigger_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (promotionTriggerCase_ == 18) {
promotionTrigger_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* A code the user should use in order to be eligible for the promotion.
*
*
* string promotion_code = 18;
* @param value The promotionCode to set.
* @return This builder for chaining.
*/
public Builder setPromotionCode(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
promotionTriggerCase_ = 18;
promotionTrigger_ = value;
onChanged();
return this;
}
/**
*
* A code the user should use in order to be eligible for the promotion.
*
*
* string promotion_code = 18;
* @return This builder for chaining.
*/
public Builder clearPromotionCode() {
if (promotionTriggerCase_ == 18) {
promotionTriggerCase_ = 0;
promotionTrigger_ = null;
onChanged();
}
return this;
}
/**
*
* A code the user should use in order to be eligible for the promotion.
*
*
* string promotion_code = 18;
* @param value The bytes for promotionCode to set.
* @return This builder for chaining.
*/
public Builder setPromotionCodeBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
promotionTriggerCase_ = 18;
promotionTrigger_ = value;
onChanged();
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.ads.googleads.v10.common.Money, com.google.ads.googleads.v10.common.Money.Builder, com.google.ads.googleads.v10.common.MoneyOrBuilder> ordersOverAmountBuilder_;
/**
*
* The amount the total order needs to be for the user to be eligible for
* the promotion.
*
*
* .google.ads.googleads.v10.common.Money orders_over_amount = 6;
* @return Whether the ordersOverAmount field is set.
*/
@java.lang.Override
public boolean hasOrdersOverAmount() {
return promotionTriggerCase_ == 6;
}
/**
*
* The amount the total order needs to be for the user to be eligible for
* the promotion.
*
*
* .google.ads.googleads.v10.common.Money orders_over_amount = 6;
* @return The ordersOverAmount.
*/
@java.lang.Override
public com.google.ads.googleads.v10.common.Money getOrdersOverAmount() {
if (ordersOverAmountBuilder_ == null) {
if (promotionTriggerCase_ == 6) {
return (com.google.ads.googleads.v10.common.Money) promotionTrigger_;
}
return com.google.ads.googleads.v10.common.Money.getDefaultInstance();
} else {
if (promotionTriggerCase_ == 6) {
return ordersOverAmountBuilder_.getMessage();
}
return com.google.ads.googleads.v10.common.Money.getDefaultInstance();
}
}
/**
*
* The amount the total order needs to be for the user to be eligible for
* the promotion.
*
*
* .google.ads.googleads.v10.common.Money orders_over_amount = 6;
*/
public Builder setOrdersOverAmount(com.google.ads.googleads.v10.common.Money value) {
if (ordersOverAmountBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
promotionTrigger_ = value;
onChanged();
} else {
ordersOverAmountBuilder_.setMessage(value);
}
promotionTriggerCase_ = 6;
return this;
}
/**
*
* The amount the total order needs to be for the user to be eligible for
* the promotion.
*
*
* .google.ads.googleads.v10.common.Money orders_over_amount = 6;
*/
public Builder setOrdersOverAmount(
com.google.ads.googleads.v10.common.Money.Builder builderForValue) {
if (ordersOverAmountBuilder_ == null) {
promotionTrigger_ = builderForValue.build();
onChanged();
} else {
ordersOverAmountBuilder_.setMessage(builderForValue.build());
}
promotionTriggerCase_ = 6;
return this;
}
/**
*
* The amount the total order needs to be for the user to be eligible for
* the promotion.
*
*
* .google.ads.googleads.v10.common.Money orders_over_amount = 6;
*/
public Builder mergeOrdersOverAmount(com.google.ads.googleads.v10.common.Money value) {
if (ordersOverAmountBuilder_ == null) {
if (promotionTriggerCase_ == 6 &&
promotionTrigger_ != com.google.ads.googleads.v10.common.Money.getDefaultInstance()) {
promotionTrigger_ = com.google.ads.googleads.v10.common.Money.newBuilder((com.google.ads.googleads.v10.common.Money) promotionTrigger_)
.mergeFrom(value).buildPartial();
} else {
promotionTrigger_ = value;
}
onChanged();
} else {
if (promotionTriggerCase_ == 6) {
ordersOverAmountBuilder_.mergeFrom(value);
} else {
ordersOverAmountBuilder_.setMessage(value);
}
}
promotionTriggerCase_ = 6;
return this;
}
/**
*
* The amount the total order needs to be for the user to be eligible for
* the promotion.
*
*
* .google.ads.googleads.v10.common.Money orders_over_amount = 6;
*/
public Builder clearOrdersOverAmount() {
if (ordersOverAmountBuilder_ == null) {
if (promotionTriggerCase_ == 6) {
promotionTriggerCase_ = 0;
promotionTrigger_ = null;
onChanged();
}
} else {
if (promotionTriggerCase_ == 6) {
promotionTriggerCase_ = 0;
promotionTrigger_ = null;
}
ordersOverAmountBuilder_.clear();
}
return this;
}
/**
*
* The amount the total order needs to be for the user to be eligible for
* the promotion.
*
*
* .google.ads.googleads.v10.common.Money orders_over_amount = 6;
*/
public com.google.ads.googleads.v10.common.Money.Builder getOrdersOverAmountBuilder() {
return getOrdersOverAmountFieldBuilder().getBuilder();
}
/**
*
* The amount the total order needs to be for the user to be eligible for
* the promotion.
*
*
* .google.ads.googleads.v10.common.Money orders_over_amount = 6;
*/
@java.lang.Override
public com.google.ads.googleads.v10.common.MoneyOrBuilder getOrdersOverAmountOrBuilder() {
if ((promotionTriggerCase_ == 6) && (ordersOverAmountBuilder_ != null)) {
return ordersOverAmountBuilder_.getMessageOrBuilder();
} else {
if (promotionTriggerCase_ == 6) {
return (com.google.ads.googleads.v10.common.Money) promotionTrigger_;
}
return com.google.ads.googleads.v10.common.Money.getDefaultInstance();
}
}
/**
*
* The amount the total order needs to be for the user to be eligible for
* the promotion.
*
*
* .google.ads.googleads.v10.common.Money orders_over_amount = 6;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.ads.googleads.v10.common.Money, com.google.ads.googleads.v10.common.Money.Builder, com.google.ads.googleads.v10.common.MoneyOrBuilder>
getOrdersOverAmountFieldBuilder() {
if (ordersOverAmountBuilder_ == null) {
if (!(promotionTriggerCase_ == 6)) {
promotionTrigger_ = com.google.ads.googleads.v10.common.Money.getDefaultInstance();
}
ordersOverAmountBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.ads.googleads.v10.common.Money, com.google.ads.googleads.v10.common.Money.Builder, com.google.ads.googleads.v10.common.MoneyOrBuilder>(
(com.google.ads.googleads.v10.common.Money) promotionTrigger_,
getParentForChildren(),
isClean());
promotionTrigger_ = null;
}
promotionTriggerCase_ = 6;
onChanged();;
return ordersOverAmountBuilder_;
}
@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.ads.googleads.v10.common.PromotionFeedItem)
}
// @@protoc_insertion_point(class_scope:google.ads.googleads.v10.common.PromotionFeedItem)
private static final com.google.ads.googleads.v10.common.PromotionFeedItem DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.ads.googleads.v10.common.PromotionFeedItem();
}
public static com.google.ads.googleads.v10.common.PromotionFeedItem getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public PromotionFeedItem 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.ads.googleads.v10.common.PromotionFeedItem getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy