// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/ads/googleads/v14/services/reach_plan_service.proto

package com.google.ads.googleads.v14.services;

/**
 * <pre>
 * The targeting for which traffic metrics will be reported.
 * </pre>
 *
 * Protobuf type {@code google.ads.googleads.v14.services.Targeting}
 */
public final class Targeting extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.ads.googleads.v14.services.Targeting)
    TargetingOrBuilder {
private static final long serialVersionUID = 0L;
  // Use Targeting.newBuilder() to construct.
  private Targeting(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private Targeting() {
    plannableLocationId_ = "";
    plannableLocationIds_ =
        com.google.protobuf.LazyStringArrayList.emptyList();
    ageRange_ = 0;
    genders_ = java.util.Collections.emptyList();
    devices_ = java.util.Collections.emptyList();
    network_ = 0;
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(
      UnusedPrivateParameter unused) {
    return new Targeting();
  }

  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.ads.googleads.v14.services.ReachPlanServiceProto.internal_static_google_ads_googleads_v14_services_Targeting_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.ads.googleads.v14.services.ReachPlanServiceProto.internal_static_google_ads_googleads_v14_services_Targeting_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.ads.googleads.v14.services.Targeting.class, com.google.ads.googleads.v14.services.Targeting.Builder.class);
  }

  private int bitField0_;
  public static final int PLANNABLE_LOCATION_ID_FIELD_NUMBER = 6;
  @SuppressWarnings("serial")
  private volatile java.lang.Object plannableLocationId_ = "";
  /**
   * <pre>
   * The ID of the selected location. Plannable location IDs can be
   * obtained from
   * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
   *
   * Requests must set either this field or `plannable_location_ids`.
   *
   * This field is deprecated as of V12 and will be removed in a future release.
   * Use `plannable_location_ids` instead.
   * </pre>
   *
   * <code>optional string plannable_location_id = 6;</code>
   * @return Whether the plannableLocationId field is set.
   */
  @java.lang.Override
  public boolean hasPlannableLocationId() {
    return ((bitField0_ & 0x00000001) != 0);
  }
  /**
   * <pre>
   * The ID of the selected location. Plannable location IDs can be
   * obtained from
   * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
   *
   * Requests must set either this field or `plannable_location_ids`.
   *
   * This field is deprecated as of V12 and will be removed in a future release.
   * Use `plannable_location_ids` instead.
   * </pre>
   *
   * <code>optional string plannable_location_id = 6;</code>
   * @return The plannableLocationId.
   */
  @java.lang.Override
  public java.lang.String getPlannableLocationId() {
    java.lang.Object ref = plannableLocationId_;
    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();
      plannableLocationId_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The ID of the selected location. Plannable location IDs can be
   * obtained from
   * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
   *
   * Requests must set either this field or `plannable_location_ids`.
   *
   * This field is deprecated as of V12 and will be removed in a future release.
   * Use `plannable_location_ids` instead.
   * </pre>
   *
   * <code>optional string plannable_location_id = 6;</code>
   * @return The bytes for plannableLocationId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getPlannableLocationIdBytes() {
    java.lang.Object ref = plannableLocationId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      plannableLocationId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PLANNABLE_LOCATION_IDS_FIELD_NUMBER = 8;
  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringArrayList plannableLocationIds_ =
      com.google.protobuf.LazyStringArrayList.emptyList();
  /**
   * <pre>
   * The list of plannable location IDs to target with this forecast.
   *
   * If more than one ID is provided, all IDs must have the same
   * `parent_country_id`. Planning for more than `parent_county` is not
   * supported. Plannable location IDs and their `parent_country_id` can be
   * obtained from
   * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
   *
   * Requests must set either this field or `plannable_location_id`.
   * </pre>
   *
   * <code>repeated string plannable_location_ids = 8;</code>
   * @return A list containing the plannableLocationIds.
   */
  public com.google.protobuf.ProtocolStringList
      getPlannableLocationIdsList() {
    return plannableLocationIds_;
  }
  /**
   * <pre>
   * The list of plannable location IDs to target with this forecast.
   *
   * If more than one ID is provided, all IDs must have the same
   * `parent_country_id`. Planning for more than `parent_county` is not
   * supported. Plannable location IDs and their `parent_country_id` can be
   * obtained from
   * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
   *
   * Requests must set either this field or `plannable_location_id`.
   * </pre>
   *
   * <code>repeated string plannable_location_ids = 8;</code>
   * @return The count of plannableLocationIds.
   */
  public int getPlannableLocationIdsCount() {
    return plannableLocationIds_.size();
  }
  /**
   * <pre>
   * The list of plannable location IDs to target with this forecast.
   *
   * If more than one ID is provided, all IDs must have the same
   * `parent_country_id`. Planning for more than `parent_county` is not
   * supported. Plannable location IDs and their `parent_country_id` can be
   * obtained from
   * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
   *
   * Requests must set either this field or `plannable_location_id`.
   * </pre>
   *
   * <code>repeated string plannable_location_ids = 8;</code>
   * @param index The index of the element to return.
   * @return The plannableLocationIds at the given index.
   */
  public java.lang.String getPlannableLocationIds(int index) {
    return plannableLocationIds_.get(index);
  }
  /**
   * <pre>
   * The list of plannable location IDs to target with this forecast.
   *
   * If more than one ID is provided, all IDs must have the same
   * `parent_country_id`. Planning for more than `parent_county` is not
   * supported. Plannable location IDs and their `parent_country_id` can be
   * obtained from
   * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
   *
   * Requests must set either this field or `plannable_location_id`.
   * </pre>
   *
   * <code>repeated string plannable_location_ids = 8;</code>
   * @param index The index of the value to return.
   * @return The bytes of the plannableLocationIds at the given index.
   */
  public com.google.protobuf.ByteString
      getPlannableLocationIdsBytes(int index) {
    return plannableLocationIds_.getByteString(index);
  }

  public static final int AGE_RANGE_FIELD_NUMBER = 2;
  private int ageRange_ = 0;
  /**
   * <pre>
   * Targeted age range.
   * An unset value is equivalent to targeting all ages.
   * </pre>
   *
   * <code>.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange age_range = 2;</code>
   * @return The enum numeric value on the wire for ageRange.
   */
  @java.lang.Override public int getAgeRangeValue() {
    return ageRange_;
  }
  /**
   * <pre>
   * Targeted age range.
   * An unset value is equivalent to targeting all ages.
   * </pre>
   *
   * <code>.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange age_range = 2;</code>
   * @return The ageRange.
   */
  @java.lang.Override public com.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange getAgeRange() {
    com.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange result = com.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange.forNumber(ageRange_);
    return result == null ? com.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange.UNRECOGNIZED : result;
  }

  public static final int GENDERS_FIELD_NUMBER = 3;
  @SuppressWarnings("serial")
  private java.util.List<com.google.ads.googleads.v14.common.GenderInfo> genders_;
  /**
   * <pre>
   * Targeted genders.
   * An unset value is equivalent to targeting MALE and FEMALE.
   * </pre>
   *
   * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.ads.googleads.v14.common.GenderInfo> getGendersList() {
    return genders_;
  }
  /**
   * <pre>
   * Targeted genders.
   * An unset value is equivalent to targeting MALE and FEMALE.
   * </pre>
   *
   * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.ads.googleads.v14.common.GenderInfoOrBuilder> 
      getGendersOrBuilderList() {
    return genders_;
  }
  /**
   * <pre>
   * Targeted genders.
   * An unset value is equivalent to targeting MALE and FEMALE.
   * </pre>
   *
   * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
   */
  @java.lang.Override
  public int getGendersCount() {
    return genders_.size();
  }
  /**
   * <pre>
   * Targeted genders.
   * An unset value is equivalent to targeting MALE and FEMALE.
   * </pre>
   *
   * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
   */
  @java.lang.Override
  public com.google.ads.googleads.v14.common.GenderInfo getGenders(int index) {
    return genders_.get(index);
  }
  /**
   * <pre>
   * Targeted genders.
   * An unset value is equivalent to targeting MALE and FEMALE.
   * </pre>
   *
   * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
   */
  @java.lang.Override
  public com.google.ads.googleads.v14.common.GenderInfoOrBuilder getGendersOrBuilder(
      int index) {
    return genders_.get(index);
  }

  public static final int DEVICES_FIELD_NUMBER = 4;
  @SuppressWarnings("serial")
  private java.util.List<com.google.ads.googleads.v14.common.DeviceInfo> devices_;
  /**
   * <pre>
   * Targeted devices.
   * If not specified, targets all applicable devices. Applicable devices vary
   * by product and region and can be obtained from
   * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
   * </pre>
   *
   * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.ads.googleads.v14.common.DeviceInfo> getDevicesList() {
    return devices_;
  }
  /**
   * <pre>
   * Targeted devices.
   * If not specified, targets all applicable devices. Applicable devices vary
   * by product and region and can be obtained from
   * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
   * </pre>
   *
   * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.ads.googleads.v14.common.DeviceInfoOrBuilder> 
      getDevicesOrBuilderList() {
    return devices_;
  }
  /**
   * <pre>
   * Targeted devices.
   * If not specified, targets all applicable devices. Applicable devices vary
   * by product and region and can be obtained from
   * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
   * </pre>
   *
   * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
   */
  @java.lang.Override
  public int getDevicesCount() {
    return devices_.size();
  }
  /**
   * <pre>
   * Targeted devices.
   * If not specified, targets all applicable devices. Applicable devices vary
   * by product and region and can be obtained from
   * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
   * </pre>
   *
   * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
   */
  @java.lang.Override
  public com.google.ads.googleads.v14.common.DeviceInfo getDevices(int index) {
    return devices_.get(index);
  }
  /**
   * <pre>
   * Targeted devices.
   * If not specified, targets all applicable devices. Applicable devices vary
   * by product and region and can be obtained from
   * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
   * </pre>
   *
   * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
   */
  @java.lang.Override
  public com.google.ads.googleads.v14.common.DeviceInfoOrBuilder getDevicesOrBuilder(
      int index) {
    return devices_.get(index);
  }

  public static final int NETWORK_FIELD_NUMBER = 5;
  private int network_ = 0;
  /**
   * <pre>
   * Targetable network for the ad product.
   * If not specified, targets all applicable networks. Applicable networks vary
   * by product and region and can be obtained from
   * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
   * </pre>
   *
   * <code>.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork network = 5;</code>
   * @return The enum numeric value on the wire for network.
   */
  @java.lang.Override public int getNetworkValue() {
    return network_;
  }
  /**
   * <pre>
   * Targetable network for the ad product.
   * If not specified, targets all applicable networks. Applicable networks vary
   * by product and region and can be obtained from
   * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
   * </pre>
   *
   * <code>.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork network = 5;</code>
   * @return The network.
   */
  @java.lang.Override public com.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork getNetwork() {
    com.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork result = com.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork.forNumber(network_);
    return result == null ? com.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork.UNRECOGNIZED : result;
  }

  public static final int AUDIENCE_TARGETING_FIELD_NUMBER = 7;
  private com.google.ads.googleads.v14.services.AudienceTargeting audienceTargeting_;
  /**
   * <pre>
   * Targeted audiences.
   * If not specified, does not target any specific audience.
   * </pre>
   *
   * <code>.google.ads.googleads.v14.services.AudienceTargeting audience_targeting = 7;</code>
   * @return Whether the audienceTargeting field is set.
   */
  @java.lang.Override
  public boolean hasAudienceTargeting() {
    return audienceTargeting_ != null;
  }
  /**
   * <pre>
   * Targeted audiences.
   * If not specified, does not target any specific audience.
   * </pre>
   *
   * <code>.google.ads.googleads.v14.services.AudienceTargeting audience_targeting = 7;</code>
   * @return The audienceTargeting.
   */
  @java.lang.Override
  public com.google.ads.googleads.v14.services.AudienceTargeting getAudienceTargeting() {
    return audienceTargeting_ == null ? com.google.ads.googleads.v14.services.AudienceTargeting.getDefaultInstance() : audienceTargeting_;
  }
  /**
   * <pre>
   * Targeted audiences.
   * If not specified, does not target any specific audience.
   * </pre>
   *
   * <code>.google.ads.googleads.v14.services.AudienceTargeting audience_targeting = 7;</code>
   */
  @java.lang.Override
  public com.google.ads.googleads.v14.services.AudienceTargetingOrBuilder getAudienceTargetingOrBuilder() {
    return audienceTargeting_ == null ? com.google.ads.googleads.v14.services.AudienceTargeting.getDefaultInstance() : audienceTargeting_;
  }

  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 (ageRange_ != com.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange.UNSPECIFIED.getNumber()) {
      output.writeEnum(2, ageRange_);
    }
    for (int i = 0; i < genders_.size(); i++) {
      output.writeMessage(3, genders_.get(i));
    }
    for (int i = 0; i < devices_.size(); i++) {
      output.writeMessage(4, devices_.get(i));
    }
    if (network_ != com.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork.UNSPECIFIED.getNumber()) {
      output.writeEnum(5, network_);
    }
    if (((bitField0_ & 0x00000001) != 0)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, plannableLocationId_);
    }
    if (audienceTargeting_ != null) {
      output.writeMessage(7, getAudienceTargeting());
    }
    for (int i = 0; i < plannableLocationIds_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 8, plannableLocationIds_.getRaw(i));
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (ageRange_ != com.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange.UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(2, ageRange_);
    }
    for (int i = 0; i < genders_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, genders_.get(i));
    }
    for (int i = 0; i < devices_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, devices_.get(i));
    }
    if (network_ != com.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork.UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(5, network_);
    }
    if (((bitField0_ & 0x00000001) != 0)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, plannableLocationId_);
    }
    if (audienceTargeting_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(7, getAudienceTargeting());
    }
    {
      int dataSize = 0;
      for (int i = 0; i < plannableLocationIds_.size(); i++) {
        dataSize += computeStringSizeNoTag(plannableLocationIds_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getPlannableLocationIdsList().size();
    }
    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.v14.services.Targeting)) {
      return super.equals(obj);
    }
    com.google.ads.googleads.v14.services.Targeting other = (com.google.ads.googleads.v14.services.Targeting) obj;

    if (hasPlannableLocationId() != other.hasPlannableLocationId()) return false;
    if (hasPlannableLocationId()) {
      if (!getPlannableLocationId()
          .equals(other.getPlannableLocationId())) return false;
    }
    if (!getPlannableLocationIdsList()
        .equals(other.getPlannableLocationIdsList())) return false;
    if (ageRange_ != other.ageRange_) return false;
    if (!getGendersList()
        .equals(other.getGendersList())) return false;
    if (!getDevicesList()
        .equals(other.getDevicesList())) return false;
    if (network_ != other.network_) return false;
    if (hasAudienceTargeting() != other.hasAudienceTargeting()) return false;
    if (hasAudienceTargeting()) {
      if (!getAudienceTargeting()
          .equals(other.getAudienceTargeting())) return false;
    }
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasPlannableLocationId()) {
      hash = (37 * hash) + PLANNABLE_LOCATION_ID_FIELD_NUMBER;
      hash = (53 * hash) + getPlannableLocationId().hashCode();
    }
    if (getPlannableLocationIdsCount() > 0) {
      hash = (37 * hash) + PLANNABLE_LOCATION_IDS_FIELD_NUMBER;
      hash = (53 * hash) + getPlannableLocationIdsList().hashCode();
    }
    hash = (37 * hash) + AGE_RANGE_FIELD_NUMBER;
    hash = (53 * hash) + ageRange_;
    if (getGendersCount() > 0) {
      hash = (37 * hash) + GENDERS_FIELD_NUMBER;
      hash = (53 * hash) + getGendersList().hashCode();
    }
    if (getDevicesCount() > 0) {
      hash = (37 * hash) + DEVICES_FIELD_NUMBER;
      hash = (53 * hash) + getDevicesList().hashCode();
    }
    hash = (37 * hash) + NETWORK_FIELD_NUMBER;
    hash = (53 * hash) + network_;
    if (hasAudienceTargeting()) {
      hash = (37 * hash) + AUDIENCE_TARGETING_FIELD_NUMBER;
      hash = (53 * hash) + getAudienceTargeting().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.ads.googleads.v14.services.Targeting parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.ads.googleads.v14.services.Targeting 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.v14.services.Targeting parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.ads.googleads.v14.services.Targeting 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.v14.services.Targeting parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.ads.googleads.v14.services.Targeting parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.ads.googleads.v14.services.Targeting parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.ads.googleads.v14.services.Targeting 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.v14.services.Targeting parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.ads.googleads.v14.services.Targeting 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.v14.services.Targeting parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.ads.googleads.v14.services.Targeting 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.v14.services.Targeting 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;
  }
  /**
   * <pre>
   * The targeting for which traffic metrics will be reported.
   * </pre>
   *
   * Protobuf type {@code google.ads.googleads.v14.services.Targeting}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.ads.googleads.v14.services.Targeting)
      com.google.ads.googleads.v14.services.TargetingOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.ads.googleads.v14.services.ReachPlanServiceProto.internal_static_google_ads_googleads_v14_services_Targeting_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.ads.googleads.v14.services.ReachPlanServiceProto.internal_static_google_ads_googleads_v14_services_Targeting_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.ads.googleads.v14.services.Targeting.class, com.google.ads.googleads.v14.services.Targeting.Builder.class);
    }

    // Construct using com.google.ads.googleads.v14.services.Targeting.newBuilder()
    private Builder() {

    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);

    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      plannableLocationId_ = "";
      plannableLocationIds_ =
          com.google.protobuf.LazyStringArrayList.emptyList();
      ageRange_ = 0;
      if (gendersBuilder_ == null) {
        genders_ = java.util.Collections.emptyList();
      } else {
        genders_ = null;
        gendersBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000008);
      if (devicesBuilder_ == null) {
        devices_ = java.util.Collections.emptyList();
      } else {
        devices_ = null;
        devicesBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000010);
      network_ = 0;
      audienceTargeting_ = null;
      if (audienceTargetingBuilder_ != null) {
        audienceTargetingBuilder_.dispose();
        audienceTargetingBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.ads.googleads.v14.services.ReachPlanServiceProto.internal_static_google_ads_googleads_v14_services_Targeting_descriptor;
    }

    @java.lang.Override
    public com.google.ads.googleads.v14.services.Targeting getDefaultInstanceForType() {
      return com.google.ads.googleads.v14.services.Targeting.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.ads.googleads.v14.services.Targeting build() {
      com.google.ads.googleads.v14.services.Targeting result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.ads.googleads.v14.services.Targeting buildPartial() {
      com.google.ads.googleads.v14.services.Targeting result = new com.google.ads.googleads.v14.services.Targeting(this);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) { buildPartial0(result); }
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(com.google.ads.googleads.v14.services.Targeting result) {
      if (gendersBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)) {
          genders_ = java.util.Collections.unmodifiableList(genders_);
          bitField0_ = (bitField0_ & ~0x00000008);
        }
        result.genders_ = genders_;
      } else {
        result.genders_ = gendersBuilder_.build();
      }
      if (devicesBuilder_ == null) {
        if (((bitField0_ & 0x00000010) != 0)) {
          devices_ = java.util.Collections.unmodifiableList(devices_);
          bitField0_ = (bitField0_ & ~0x00000010);
        }
        result.devices_ = devices_;
      } else {
        result.devices_ = devicesBuilder_.build();
      }
    }

    private void buildPartial0(com.google.ads.googleads.v14.services.Targeting result) {
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.plannableLocationId_ = plannableLocationId_;
        to_bitField0_ |= 0x00000001;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        plannableLocationIds_.makeImmutable();
        result.plannableLocationIds_ = plannableLocationIds_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.ageRange_ = ageRange_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.network_ = network_;
      }
      if (((from_bitField0_ & 0x00000040) != 0)) {
        result.audienceTargeting_ = audienceTargetingBuilder_ == null
            ? audienceTargeting_
            : audienceTargetingBuilder_.build();
      }
      result.bitField0_ |= to_bitField0_;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.ads.googleads.v14.services.Targeting) {
        return mergeFrom((com.google.ads.googleads.v14.services.Targeting)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.ads.googleads.v14.services.Targeting other) {
      if (other == com.google.ads.googleads.v14.services.Targeting.getDefaultInstance()) return this;
      if (other.hasPlannableLocationId()) {
        plannableLocationId_ = other.plannableLocationId_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.plannableLocationIds_.isEmpty()) {
        if (plannableLocationIds_.isEmpty()) {
          plannableLocationIds_ = other.plannableLocationIds_;
          bitField0_ |= 0x00000002;
        } else {
          ensurePlannableLocationIdsIsMutable();
          plannableLocationIds_.addAll(other.plannableLocationIds_);
        }
        onChanged();
      }
      if (other.ageRange_ != 0) {
        setAgeRangeValue(other.getAgeRangeValue());
      }
      if (gendersBuilder_ == null) {
        if (!other.genders_.isEmpty()) {
          if (genders_.isEmpty()) {
            genders_ = other.genders_;
            bitField0_ = (bitField0_ & ~0x00000008);
          } else {
            ensureGendersIsMutable();
            genders_.addAll(other.genders_);
          }
          onChanged();
        }
      } else {
        if (!other.genders_.isEmpty()) {
          if (gendersBuilder_.isEmpty()) {
            gendersBuilder_.dispose();
            gendersBuilder_ = null;
            genders_ = other.genders_;
            bitField0_ = (bitField0_ & ~0x00000008);
            gendersBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getGendersFieldBuilder() : null;
          } else {
            gendersBuilder_.addAllMessages(other.genders_);
          }
        }
      }
      if (devicesBuilder_ == null) {
        if (!other.devices_.isEmpty()) {
          if (devices_.isEmpty()) {
            devices_ = other.devices_;
            bitField0_ = (bitField0_ & ~0x00000010);
          } else {
            ensureDevicesIsMutable();
            devices_.addAll(other.devices_);
          }
          onChanged();
        }
      } else {
        if (!other.devices_.isEmpty()) {
          if (devicesBuilder_.isEmpty()) {
            devicesBuilder_.dispose();
            devicesBuilder_ = null;
            devices_ = other.devices_;
            bitField0_ = (bitField0_ & ~0x00000010);
            devicesBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getDevicesFieldBuilder() : null;
          } else {
            devicesBuilder_.addAllMessages(other.devices_);
          }
        }
      }
      if (other.network_ != 0) {
        setNetworkValue(other.getNetworkValue());
      }
      if (other.hasAudienceTargeting()) {
        mergeAudienceTargeting(other.getAudienceTargeting());
      }
      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: {
              ageRange_ = input.readEnum();
              bitField0_ |= 0x00000004;
              break;
            } // case 16
            case 26: {
              com.google.ads.googleads.v14.common.GenderInfo m =
                  input.readMessage(
                      com.google.ads.googleads.v14.common.GenderInfo.parser(),
                      extensionRegistry);
              if (gendersBuilder_ == null) {
                ensureGendersIsMutable();
                genders_.add(m);
              } else {
                gendersBuilder_.addMessage(m);
              }
              break;
            } // case 26
            case 34: {
              com.google.ads.googleads.v14.common.DeviceInfo m =
                  input.readMessage(
                      com.google.ads.googleads.v14.common.DeviceInfo.parser(),
                      extensionRegistry);
              if (devicesBuilder_ == null) {
                ensureDevicesIsMutable();
                devices_.add(m);
              } else {
                devicesBuilder_.addMessage(m);
              }
              break;
            } // case 34
            case 40: {
              network_ = input.readEnum();
              bitField0_ |= 0x00000020;
              break;
            } // case 40
            case 50: {
              plannableLocationId_ = input.readStringRequireUtf8();
              bitField0_ |= 0x00000001;
              break;
            } // case 50
            case 58: {
              input.readMessage(
                  getAudienceTargetingFieldBuilder().getBuilder(),
                  extensionRegistry);
              bitField0_ |= 0x00000040;
              break;
            } // case 58
            case 66: {
              java.lang.String s = input.readStringRequireUtf8();
              ensurePlannableLocationIdsIsMutable();
              plannableLocationIds_.add(s);
              break;
            } // case 66
            default: {
              if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                done = true; // was an endgroup tag
              }
              break;
            } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }
    private int bitField0_;

    private java.lang.Object plannableLocationId_ = "";
    /**
     * <pre>
     * The ID of the selected location. Plannable location IDs can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_ids`.
     *
     * This field is deprecated as of V12 and will be removed in a future release.
     * Use `plannable_location_ids` instead.
     * </pre>
     *
     * <code>optional string plannable_location_id = 6;</code>
     * @return Whether the plannableLocationId field is set.
     */
    public boolean hasPlannableLocationId() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     * <pre>
     * The ID of the selected location. Plannable location IDs can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_ids`.
     *
     * This field is deprecated as of V12 and will be removed in a future release.
     * Use `plannable_location_ids` instead.
     * </pre>
     *
     * <code>optional string plannable_location_id = 6;</code>
     * @return The plannableLocationId.
     */
    public java.lang.String getPlannableLocationId() {
      java.lang.Object ref = plannableLocationId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        plannableLocationId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The ID of the selected location. Plannable location IDs can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_ids`.
     *
     * This field is deprecated as of V12 and will be removed in a future release.
     * Use `plannable_location_ids` instead.
     * </pre>
     *
     * <code>optional string plannable_location_id = 6;</code>
     * @return The bytes for plannableLocationId.
     */
    public com.google.protobuf.ByteString
        getPlannableLocationIdBytes() {
      java.lang.Object ref = plannableLocationId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        plannableLocationId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The ID of the selected location. Plannable location IDs can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_ids`.
     *
     * This field is deprecated as of V12 and will be removed in a future release.
     * Use `plannable_location_ids` instead.
     * </pre>
     *
     * <code>optional string plannable_location_id = 6;</code>
     * @param value The plannableLocationId to set.
     * @return This builder for chaining.
     */
    public Builder setPlannableLocationId(
        java.lang.String value) {
      if (value == null) { throw new NullPointerException(); }
      plannableLocationId_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The ID of the selected location. Plannable location IDs can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_ids`.
     *
     * This field is deprecated as of V12 and will be removed in a future release.
     * Use `plannable_location_ids` instead.
     * </pre>
     *
     * <code>optional string plannable_location_id = 6;</code>
     * @return This builder for chaining.
     */
    public Builder clearPlannableLocationId() {
      plannableLocationId_ = getDefaultInstance().getPlannableLocationId();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The ID of the selected location. Plannable location IDs can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_ids`.
     *
     * This field is deprecated as of V12 and will be removed in a future release.
     * Use `plannable_location_ids` instead.
     * </pre>
     *
     * <code>optional string plannable_location_id = 6;</code>
     * @param value The bytes for plannableLocationId to set.
     * @return This builder for chaining.
     */
    public Builder setPlannableLocationIdBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) { throw new NullPointerException(); }
      checkByteStringIsUtf8(value);
      plannableLocationId_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringArrayList plannableLocationIds_ =
        com.google.protobuf.LazyStringArrayList.emptyList();
    private void ensurePlannableLocationIdsIsMutable() {
      if (!plannableLocationIds_.isModifiable()) {
        plannableLocationIds_ = new com.google.protobuf.LazyStringArrayList(plannableLocationIds_);
      }
      bitField0_ |= 0x00000002;
    }
    /**
     * <pre>
     * The list of plannable location IDs to target with this forecast.
     *
     * If more than one ID is provided, all IDs must have the same
     * `parent_country_id`. Planning for more than `parent_county` is not
     * supported. Plannable location IDs and their `parent_country_id` can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_id`.
     * </pre>
     *
     * <code>repeated string plannable_location_ids = 8;</code>
     * @return A list containing the plannableLocationIds.
     */
    public com.google.protobuf.ProtocolStringList
        getPlannableLocationIdsList() {
      plannableLocationIds_.makeImmutable();
      return plannableLocationIds_;
    }
    /**
     * <pre>
     * The list of plannable location IDs to target with this forecast.
     *
     * If more than one ID is provided, all IDs must have the same
     * `parent_country_id`. Planning for more than `parent_county` is not
     * supported. Plannable location IDs and their `parent_country_id` can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_id`.
     * </pre>
     *
     * <code>repeated string plannable_location_ids = 8;</code>
     * @return The count of plannableLocationIds.
     */
    public int getPlannableLocationIdsCount() {
      return plannableLocationIds_.size();
    }
    /**
     * <pre>
     * The list of plannable location IDs to target with this forecast.
     *
     * If more than one ID is provided, all IDs must have the same
     * `parent_country_id`. Planning for more than `parent_county` is not
     * supported. Plannable location IDs and their `parent_country_id` can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_id`.
     * </pre>
     *
     * <code>repeated string plannable_location_ids = 8;</code>
     * @param index The index of the element to return.
     * @return The plannableLocationIds at the given index.
     */
    public java.lang.String getPlannableLocationIds(int index) {
      return plannableLocationIds_.get(index);
    }
    /**
     * <pre>
     * The list of plannable location IDs to target with this forecast.
     *
     * If more than one ID is provided, all IDs must have the same
     * `parent_country_id`. Planning for more than `parent_county` is not
     * supported. Plannable location IDs and their `parent_country_id` can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_id`.
     * </pre>
     *
     * <code>repeated string plannable_location_ids = 8;</code>
     * @param index The index of the value to return.
     * @return The bytes of the plannableLocationIds at the given index.
     */
    public com.google.protobuf.ByteString
        getPlannableLocationIdsBytes(int index) {
      return plannableLocationIds_.getByteString(index);
    }
    /**
     * <pre>
     * The list of plannable location IDs to target with this forecast.
     *
     * If more than one ID is provided, all IDs must have the same
     * `parent_country_id`. Planning for more than `parent_county` is not
     * supported. Plannable location IDs and their `parent_country_id` can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_id`.
     * </pre>
     *
     * <code>repeated string plannable_location_ids = 8;</code>
     * @param index The index to set the value at.
     * @param value The plannableLocationIds to set.
     * @return This builder for chaining.
     */
    public Builder setPlannableLocationIds(
        int index, java.lang.String value) {
      if (value == null) { throw new NullPointerException(); }
      ensurePlannableLocationIdsIsMutable();
      plannableLocationIds_.set(index, value);
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The list of plannable location IDs to target with this forecast.
     *
     * If more than one ID is provided, all IDs must have the same
     * `parent_country_id`. Planning for more than `parent_county` is not
     * supported. Plannable location IDs and their `parent_country_id` can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_id`.
     * </pre>
     *
     * <code>repeated string plannable_location_ids = 8;</code>
     * @param value The plannableLocationIds to add.
     * @return This builder for chaining.
     */
    public Builder addPlannableLocationIds(
        java.lang.String value) {
      if (value == null) { throw new NullPointerException(); }
      ensurePlannableLocationIdsIsMutable();
      plannableLocationIds_.add(value);
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The list of plannable location IDs to target with this forecast.
     *
     * If more than one ID is provided, all IDs must have the same
     * `parent_country_id`. Planning for more than `parent_county` is not
     * supported. Plannable location IDs and their `parent_country_id` can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_id`.
     * </pre>
     *
     * <code>repeated string plannable_location_ids = 8;</code>
     * @param values The plannableLocationIds to add.
     * @return This builder for chaining.
     */
    public Builder addAllPlannableLocationIds(
        java.lang.Iterable<java.lang.String> values) {
      ensurePlannableLocationIdsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(
          values, plannableLocationIds_);
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The list of plannable location IDs to target with this forecast.
     *
     * If more than one ID is provided, all IDs must have the same
     * `parent_country_id`. Planning for more than `parent_county` is not
     * supported. Plannable location IDs and their `parent_country_id` can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_id`.
     * </pre>
     *
     * <code>repeated string plannable_location_ids = 8;</code>
     * @return This builder for chaining.
     */
    public Builder clearPlannableLocationIds() {
      plannableLocationIds_ =
        com.google.protobuf.LazyStringArrayList.emptyList();
      bitField0_ = (bitField0_ & ~0x00000002);;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The list of plannable location IDs to target with this forecast.
     *
     * If more than one ID is provided, all IDs must have the same
     * `parent_country_id`. Planning for more than `parent_county` is not
     * supported. Plannable location IDs and their `parent_country_id` can be
     * obtained from
     * [ReachPlanService.ListPlannableLocations][google.ads.googleads.v14.services.ReachPlanService.ListPlannableLocations].
     *
     * Requests must set either this field or `plannable_location_id`.
     * </pre>
     *
     * <code>repeated string plannable_location_ids = 8;</code>
     * @param value The bytes of the plannableLocationIds to add.
     * @return This builder for chaining.
     */
    public Builder addPlannableLocationIdsBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) { throw new NullPointerException(); }
      checkByteStringIsUtf8(value);
      ensurePlannableLocationIdsIsMutable();
      plannableLocationIds_.add(value);
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private int ageRange_ = 0;
    /**
     * <pre>
     * Targeted age range.
     * An unset value is equivalent to targeting all ages.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange age_range = 2;</code>
     * @return The enum numeric value on the wire for ageRange.
     */
    @java.lang.Override public int getAgeRangeValue() {
      return ageRange_;
    }
    /**
     * <pre>
     * Targeted age range.
     * An unset value is equivalent to targeting all ages.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange age_range = 2;</code>
     * @param value The enum numeric value on the wire for ageRange to set.
     * @return This builder for chaining.
     */
    public Builder setAgeRangeValue(int value) {
      ageRange_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Targeted age range.
     * An unset value is equivalent to targeting all ages.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange age_range = 2;</code>
     * @return The ageRange.
     */
    @java.lang.Override
    public com.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange getAgeRange() {
      com.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange result = com.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange.forNumber(ageRange_);
      return result == null ? com.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange.UNRECOGNIZED : result;
    }
    /**
     * <pre>
     * Targeted age range.
     * An unset value is equivalent to targeting all ages.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange age_range = 2;</code>
     * @param value The ageRange to set.
     * @return This builder for chaining.
     */
    public Builder setAgeRange(com.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000004;
      ageRange_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Targeted age range.
     * An unset value is equivalent to targeting all ages.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.enums.ReachPlanAgeRangeEnum.ReachPlanAgeRange age_range = 2;</code>
     * @return This builder for chaining.
     */
    public Builder clearAgeRange() {
      bitField0_ = (bitField0_ & ~0x00000004);
      ageRange_ = 0;
      onChanged();
      return this;
    }

    private java.util.List<com.google.ads.googleads.v14.common.GenderInfo> genders_ =
      java.util.Collections.emptyList();
    private void ensureGendersIsMutable() {
      if (!((bitField0_ & 0x00000008) != 0)) {
        genders_ = new java.util.ArrayList<com.google.ads.googleads.v14.common.GenderInfo>(genders_);
        bitField0_ |= 0x00000008;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.ads.googleads.v14.common.GenderInfo, com.google.ads.googleads.v14.common.GenderInfo.Builder, com.google.ads.googleads.v14.common.GenderInfoOrBuilder> gendersBuilder_;

    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public java.util.List<com.google.ads.googleads.v14.common.GenderInfo> getGendersList() {
      if (gendersBuilder_ == null) {
        return java.util.Collections.unmodifiableList(genders_);
      } else {
        return gendersBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public int getGendersCount() {
      if (gendersBuilder_ == null) {
        return genders_.size();
      } else {
        return gendersBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public com.google.ads.googleads.v14.common.GenderInfo getGenders(int index) {
      if (gendersBuilder_ == null) {
        return genders_.get(index);
      } else {
        return gendersBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public Builder setGenders(
        int index, com.google.ads.googleads.v14.common.GenderInfo value) {
      if (gendersBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureGendersIsMutable();
        genders_.set(index, value);
        onChanged();
      } else {
        gendersBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public Builder setGenders(
        int index, com.google.ads.googleads.v14.common.GenderInfo.Builder builderForValue) {
      if (gendersBuilder_ == null) {
        ensureGendersIsMutable();
        genders_.set(index, builderForValue.build());
        onChanged();
      } else {
        gendersBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public Builder addGenders(com.google.ads.googleads.v14.common.GenderInfo value) {
      if (gendersBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureGendersIsMutable();
        genders_.add(value);
        onChanged();
      } else {
        gendersBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public Builder addGenders(
        int index, com.google.ads.googleads.v14.common.GenderInfo value) {
      if (gendersBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureGendersIsMutable();
        genders_.add(index, value);
        onChanged();
      } else {
        gendersBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public Builder addGenders(
        com.google.ads.googleads.v14.common.GenderInfo.Builder builderForValue) {
      if (gendersBuilder_ == null) {
        ensureGendersIsMutable();
        genders_.add(builderForValue.build());
        onChanged();
      } else {
        gendersBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public Builder addGenders(
        int index, com.google.ads.googleads.v14.common.GenderInfo.Builder builderForValue) {
      if (gendersBuilder_ == null) {
        ensureGendersIsMutable();
        genders_.add(index, builderForValue.build());
        onChanged();
      } else {
        gendersBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public Builder addAllGenders(
        java.lang.Iterable<? extends com.google.ads.googleads.v14.common.GenderInfo> values) {
      if (gendersBuilder_ == null) {
        ensureGendersIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, genders_);
        onChanged();
      } else {
        gendersBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public Builder clearGenders() {
      if (gendersBuilder_ == null) {
        genders_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000008);
        onChanged();
      } else {
        gendersBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public Builder removeGenders(int index) {
      if (gendersBuilder_ == null) {
        ensureGendersIsMutable();
        genders_.remove(index);
        onChanged();
      } else {
        gendersBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public com.google.ads.googleads.v14.common.GenderInfo.Builder getGendersBuilder(
        int index) {
      return getGendersFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public com.google.ads.googleads.v14.common.GenderInfoOrBuilder getGendersOrBuilder(
        int index) {
      if (gendersBuilder_ == null) {
        return genders_.get(index);  } else {
        return gendersBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public java.util.List<? extends com.google.ads.googleads.v14.common.GenderInfoOrBuilder> 
         getGendersOrBuilderList() {
      if (gendersBuilder_ != null) {
        return gendersBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(genders_);
      }
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public com.google.ads.googleads.v14.common.GenderInfo.Builder addGendersBuilder() {
      return getGendersFieldBuilder().addBuilder(
          com.google.ads.googleads.v14.common.GenderInfo.getDefaultInstance());
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public com.google.ads.googleads.v14.common.GenderInfo.Builder addGendersBuilder(
        int index) {
      return getGendersFieldBuilder().addBuilder(
          index, com.google.ads.googleads.v14.common.GenderInfo.getDefaultInstance());
    }
    /**
     * <pre>
     * Targeted genders.
     * An unset value is equivalent to targeting MALE and FEMALE.
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.GenderInfo genders = 3;</code>
     */
    public java.util.List<com.google.ads.googleads.v14.common.GenderInfo.Builder> 
         getGendersBuilderList() {
      return getGendersFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.ads.googleads.v14.common.GenderInfo, com.google.ads.googleads.v14.common.GenderInfo.Builder, com.google.ads.googleads.v14.common.GenderInfoOrBuilder> 
        getGendersFieldBuilder() {
      if (gendersBuilder_ == null) {
        gendersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.ads.googleads.v14.common.GenderInfo, com.google.ads.googleads.v14.common.GenderInfo.Builder, com.google.ads.googleads.v14.common.GenderInfoOrBuilder>(
                genders_,
                ((bitField0_ & 0x00000008) != 0),
                getParentForChildren(),
                isClean());
        genders_ = null;
      }
      return gendersBuilder_;
    }

    private java.util.List<com.google.ads.googleads.v14.common.DeviceInfo> devices_ =
      java.util.Collections.emptyList();
    private void ensureDevicesIsMutable() {
      if (!((bitField0_ & 0x00000010) != 0)) {
        devices_ = new java.util.ArrayList<com.google.ads.googleads.v14.common.DeviceInfo>(devices_);
        bitField0_ |= 0x00000010;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.ads.googleads.v14.common.DeviceInfo, com.google.ads.googleads.v14.common.DeviceInfo.Builder, com.google.ads.googleads.v14.common.DeviceInfoOrBuilder> devicesBuilder_;

    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public java.util.List<com.google.ads.googleads.v14.common.DeviceInfo> getDevicesList() {
      if (devicesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(devices_);
      } else {
        return devicesBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public int getDevicesCount() {
      if (devicesBuilder_ == null) {
        return devices_.size();
      } else {
        return devicesBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public com.google.ads.googleads.v14.common.DeviceInfo getDevices(int index) {
      if (devicesBuilder_ == null) {
        return devices_.get(index);
      } else {
        return devicesBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public Builder setDevices(
        int index, com.google.ads.googleads.v14.common.DeviceInfo value) {
      if (devicesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDevicesIsMutable();
        devices_.set(index, value);
        onChanged();
      } else {
        devicesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public Builder setDevices(
        int index, com.google.ads.googleads.v14.common.DeviceInfo.Builder builderForValue) {
      if (devicesBuilder_ == null) {
        ensureDevicesIsMutable();
        devices_.set(index, builderForValue.build());
        onChanged();
      } else {
        devicesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public Builder addDevices(com.google.ads.googleads.v14.common.DeviceInfo value) {
      if (devicesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDevicesIsMutable();
        devices_.add(value);
        onChanged();
      } else {
        devicesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public Builder addDevices(
        int index, com.google.ads.googleads.v14.common.DeviceInfo value) {
      if (devicesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDevicesIsMutable();
        devices_.add(index, value);
        onChanged();
      } else {
        devicesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public Builder addDevices(
        com.google.ads.googleads.v14.common.DeviceInfo.Builder builderForValue) {
      if (devicesBuilder_ == null) {
        ensureDevicesIsMutable();
        devices_.add(builderForValue.build());
        onChanged();
      } else {
        devicesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public Builder addDevices(
        int index, com.google.ads.googleads.v14.common.DeviceInfo.Builder builderForValue) {
      if (devicesBuilder_ == null) {
        ensureDevicesIsMutable();
        devices_.add(index, builderForValue.build());
        onChanged();
      } else {
        devicesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public Builder addAllDevices(
        java.lang.Iterable<? extends com.google.ads.googleads.v14.common.DeviceInfo> values) {
      if (devicesBuilder_ == null) {
        ensureDevicesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, devices_);
        onChanged();
      } else {
        devicesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public Builder clearDevices() {
      if (devicesBuilder_ == null) {
        devices_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000010);
        onChanged();
      } else {
        devicesBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public Builder removeDevices(int index) {
      if (devicesBuilder_ == null) {
        ensureDevicesIsMutable();
        devices_.remove(index);
        onChanged();
      } else {
        devicesBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public com.google.ads.googleads.v14.common.DeviceInfo.Builder getDevicesBuilder(
        int index) {
      return getDevicesFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public com.google.ads.googleads.v14.common.DeviceInfoOrBuilder getDevicesOrBuilder(
        int index) {
      if (devicesBuilder_ == null) {
        return devices_.get(index);  } else {
        return devicesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public java.util.List<? extends com.google.ads.googleads.v14.common.DeviceInfoOrBuilder> 
         getDevicesOrBuilderList() {
      if (devicesBuilder_ != null) {
        return devicesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(devices_);
      }
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public com.google.ads.googleads.v14.common.DeviceInfo.Builder addDevicesBuilder() {
      return getDevicesFieldBuilder().addBuilder(
          com.google.ads.googleads.v14.common.DeviceInfo.getDefaultInstance());
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public com.google.ads.googleads.v14.common.DeviceInfo.Builder addDevicesBuilder(
        int index) {
      return getDevicesFieldBuilder().addBuilder(
          index, com.google.ads.googleads.v14.common.DeviceInfo.getDefaultInstance());
    }
    /**
     * <pre>
     * Targeted devices.
     * If not specified, targets all applicable devices. Applicable devices vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>repeated .google.ads.googleads.v14.common.DeviceInfo devices = 4;</code>
     */
    public java.util.List<com.google.ads.googleads.v14.common.DeviceInfo.Builder> 
         getDevicesBuilderList() {
      return getDevicesFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.ads.googleads.v14.common.DeviceInfo, com.google.ads.googleads.v14.common.DeviceInfo.Builder, com.google.ads.googleads.v14.common.DeviceInfoOrBuilder> 
        getDevicesFieldBuilder() {
      if (devicesBuilder_ == null) {
        devicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.ads.googleads.v14.common.DeviceInfo, com.google.ads.googleads.v14.common.DeviceInfo.Builder, com.google.ads.googleads.v14.common.DeviceInfoOrBuilder>(
                devices_,
                ((bitField0_ & 0x00000010) != 0),
                getParentForChildren(),
                isClean());
        devices_ = null;
      }
      return devicesBuilder_;
    }

    private int network_ = 0;
    /**
     * <pre>
     * Targetable network for the ad product.
     * If not specified, targets all applicable networks. Applicable networks vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork network = 5;</code>
     * @return The enum numeric value on the wire for network.
     */
    @java.lang.Override public int getNetworkValue() {
      return network_;
    }
    /**
     * <pre>
     * Targetable network for the ad product.
     * If not specified, targets all applicable networks. Applicable networks vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork network = 5;</code>
     * @param value The enum numeric value on the wire for network to set.
     * @return This builder for chaining.
     */
    public Builder setNetworkValue(int value) {
      network_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Targetable network for the ad product.
     * If not specified, targets all applicable networks. Applicable networks vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork network = 5;</code>
     * @return The network.
     */
    @java.lang.Override
    public com.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork getNetwork() {
      com.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork result = com.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork.forNumber(network_);
      return result == null ? com.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork.UNRECOGNIZED : result;
    }
    /**
     * <pre>
     * Targetable network for the ad product.
     * If not specified, targets all applicable networks. Applicable networks vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork network = 5;</code>
     * @param value The network to set.
     * @return This builder for chaining.
     */
    public Builder setNetwork(com.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000020;
      network_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Targetable network for the ad product.
     * If not specified, targets all applicable networks. Applicable networks vary
     * by product and region and can be obtained from
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v14.services.ReachPlanService.ListPlannableProducts].
     * </pre>
     *
     * <code>.google.ads.googleads.v14.enums.ReachPlanNetworkEnum.ReachPlanNetwork network = 5;</code>
     * @return This builder for chaining.
     */
    public Builder clearNetwork() {
      bitField0_ = (bitField0_ & ~0x00000020);
      network_ = 0;
      onChanged();
      return this;
    }

    private com.google.ads.googleads.v14.services.AudienceTargeting audienceTargeting_;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.ads.googleads.v14.services.AudienceTargeting, com.google.ads.googleads.v14.services.AudienceTargeting.Builder, com.google.ads.googleads.v14.services.AudienceTargetingOrBuilder> audienceTargetingBuilder_;
    /**
     * <pre>
     * Targeted audiences.
     * If not specified, does not target any specific audience.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.services.AudienceTargeting audience_targeting = 7;</code>
     * @return Whether the audienceTargeting field is set.
     */
    public boolean hasAudienceTargeting() {
      return ((bitField0_ & 0x00000040) != 0);
    }
    /**
     * <pre>
     * Targeted audiences.
     * If not specified, does not target any specific audience.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.services.AudienceTargeting audience_targeting = 7;</code>
     * @return The audienceTargeting.
     */
    public com.google.ads.googleads.v14.services.AudienceTargeting getAudienceTargeting() {
      if (audienceTargetingBuilder_ == null) {
        return audienceTargeting_ == null ? com.google.ads.googleads.v14.services.AudienceTargeting.getDefaultInstance() : audienceTargeting_;
      } else {
        return audienceTargetingBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Targeted audiences.
     * If not specified, does not target any specific audience.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.services.AudienceTargeting audience_targeting = 7;</code>
     */
    public Builder setAudienceTargeting(com.google.ads.googleads.v14.services.AudienceTargeting value) {
      if (audienceTargetingBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        audienceTargeting_ = value;
      } else {
        audienceTargetingBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Targeted audiences.
     * If not specified, does not target any specific audience.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.services.AudienceTargeting audience_targeting = 7;</code>
     */
    public Builder setAudienceTargeting(
        com.google.ads.googleads.v14.services.AudienceTargeting.Builder builderForValue) {
      if (audienceTargetingBuilder_ == null) {
        audienceTargeting_ = builderForValue.build();
      } else {
        audienceTargetingBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Targeted audiences.
     * If not specified, does not target any specific audience.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.services.AudienceTargeting audience_targeting = 7;</code>
     */
    public Builder mergeAudienceTargeting(com.google.ads.googleads.v14.services.AudienceTargeting value) {
      if (audienceTargetingBuilder_ == null) {
        if (((bitField0_ & 0x00000040) != 0) &&
          audienceTargeting_ != null &&
          audienceTargeting_ != com.google.ads.googleads.v14.services.AudienceTargeting.getDefaultInstance()) {
          getAudienceTargetingBuilder().mergeFrom(value);
        } else {
          audienceTargeting_ = value;
        }
      } else {
        audienceTargetingBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Targeted audiences.
     * If not specified, does not target any specific audience.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.services.AudienceTargeting audience_targeting = 7;</code>
     */
    public Builder clearAudienceTargeting() {
      bitField0_ = (bitField0_ & ~0x00000040);
      audienceTargeting_ = null;
      if (audienceTargetingBuilder_ != null) {
        audienceTargetingBuilder_.dispose();
        audienceTargetingBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Targeted audiences.
     * If not specified, does not target any specific audience.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.services.AudienceTargeting audience_targeting = 7;</code>
     */
    public com.google.ads.googleads.v14.services.AudienceTargeting.Builder getAudienceTargetingBuilder() {
      bitField0_ |= 0x00000040;
      onChanged();
      return getAudienceTargetingFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Targeted audiences.
     * If not specified, does not target any specific audience.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.services.AudienceTargeting audience_targeting = 7;</code>
     */
    public com.google.ads.googleads.v14.services.AudienceTargetingOrBuilder getAudienceTargetingOrBuilder() {
      if (audienceTargetingBuilder_ != null) {
        return audienceTargetingBuilder_.getMessageOrBuilder();
      } else {
        return audienceTargeting_ == null ?
            com.google.ads.googleads.v14.services.AudienceTargeting.getDefaultInstance() : audienceTargeting_;
      }
    }
    /**
     * <pre>
     * Targeted audiences.
     * If not specified, does not target any specific audience.
     * </pre>
     *
     * <code>.google.ads.googleads.v14.services.AudienceTargeting audience_targeting = 7;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.ads.googleads.v14.services.AudienceTargeting, com.google.ads.googleads.v14.services.AudienceTargeting.Builder, com.google.ads.googleads.v14.services.AudienceTargetingOrBuilder> 
        getAudienceTargetingFieldBuilder() {
      if (audienceTargetingBuilder_ == null) {
        audienceTargetingBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.ads.googleads.v14.services.AudienceTargeting, com.google.ads.googleads.v14.services.AudienceTargeting.Builder, com.google.ads.googleads.v14.services.AudienceTargetingOrBuilder>(
                getAudienceTargeting(),
                getParentForChildren(),
                isClean());
        audienceTargeting_ = null;
      }
      return audienceTargetingBuilder_;
    }
    @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.v14.services.Targeting)
  }

  // @@protoc_insertion_point(class_scope:google.ads.googleads.v14.services.Targeting)
  private static final com.google.ads.googleads.v14.services.Targeting DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.ads.googleads.v14.services.Targeting();
  }

  public static com.google.ads.googleads.v14.services.Targeting getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<Targeting>
      PARSER = new com.google.protobuf.AbstractParser<Targeting>() {
    @java.lang.Override
    public Targeting 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<Targeting> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<Targeting> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.ads.googleads.v14.services.Targeting getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

