/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/analytics/data/v1alpha/data.proto

package com.google.analytics.data.v1alpha;

/**
 *
 *
 * <pre>
 * Scopings specify how multiple events should be considered when evaluating a
 * segment parameter filter.
 * </pre>
 *
 * Protobuf type {@code google.analytics.data.v1alpha.SegmentParameterFilterScoping}
 */
public final class SegmentParameterFilterScoping extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.analytics.data.v1alpha.SegmentParameterFilterScoping)
    SegmentParameterFilterScopingOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use SegmentParameterFilterScoping.newBuilder() to construct.
  private SegmentParameterFilterScoping(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private SegmentParameterFilterScoping() {}

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

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private SegmentParameterFilterScoping(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 8:
            {
              bitField0_ |= 0x00000001;
              inAnyNDayPeriod_ = input.readInt64();
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (com.google.protobuf.UninitializedMessageException e) {
      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.analytics.data.v1alpha.ReportingApiProto
        .internal_static_google_analytics_data_v1alpha_SegmentParameterFilterScoping_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.analytics.data.v1alpha.ReportingApiProto
        .internal_static_google_analytics_data_v1alpha_SegmentParameterFilterScoping_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.analytics.data.v1alpha.SegmentParameterFilterScoping.class,
            com.google.analytics.data.v1alpha.SegmentParameterFilterScoping.Builder.class);
  }

  private int bitField0_;
  public static final int IN_ANY_N_DAY_PERIOD_FIELD_NUMBER = 1;
  private long inAnyNDayPeriod_;
  /**
   *
   *
   * <pre>
   * Accumulates the parameter over the specified period of days before
   * applying the filter. Only supported if criteria scoping is
   * `ACROSS_ALL_SESSIONS` or `WITHIN_SAME_SESSION`. Only supported if the
   * parameter is `event_count`.
   * For example if `inAnyNDayPeriod` is 3, the event_name is "purchase",
   * the event parameter is "event_count", and the Filter's criteria is
   * greater than 5, this filter will accumulate the event count of purchase
   * events over every 3 consecutive day period in the report's date range; a
   * user will pass this Filter's criteria to be included in this segment if
   * their count of purchase events exceeds 5 in any 3 consecutive day period.
   * For example, the periods 2021-11-01 to 2021-11-03, 2021-11-02 to
   * 2021-11-04, 2021-11-03 to 2021-11-05, and etc. will be considered.
   * The date range is not extended for the purpose of having a full N day
   * window near the start of the date range. For example if a report is for
   * 2021-11-01 to 2021-11-10 and `inAnyNDayPeriod` = 3, the first two day
   * period will be effectively shortened because no event data outside the
   * report's date range will be read. For example, the first four periods
   * will effectively be: 2021-11-01 to 2021-11-01, 2021-11-01 to 2021-11-02,
   * 2021-11-01 to 2021-11-03, and 2021-11-02 to 2021-11-04.
   * `inAnyNDayPeriod` is optional. If not specified, the
   * `segmentParameterFilter` is applied to each event individually.
   * </pre>
   *
   * <code>optional int64 in_any_n_day_period = 1;</code>
   *
   * @return Whether the inAnyNDayPeriod field is set.
   */
  @java.lang.Override
  public boolean hasInAnyNDayPeriod() {
    return ((bitField0_ & 0x00000001) != 0);
  }
  /**
   *
   *
   * <pre>
   * Accumulates the parameter over the specified period of days before
   * applying the filter. Only supported if criteria scoping is
   * `ACROSS_ALL_SESSIONS` or `WITHIN_SAME_SESSION`. Only supported if the
   * parameter is `event_count`.
   * For example if `inAnyNDayPeriod` is 3, the event_name is "purchase",
   * the event parameter is "event_count", and the Filter's criteria is
   * greater than 5, this filter will accumulate the event count of purchase
   * events over every 3 consecutive day period in the report's date range; a
   * user will pass this Filter's criteria to be included in this segment if
   * their count of purchase events exceeds 5 in any 3 consecutive day period.
   * For example, the periods 2021-11-01 to 2021-11-03, 2021-11-02 to
   * 2021-11-04, 2021-11-03 to 2021-11-05, and etc. will be considered.
   * The date range is not extended for the purpose of having a full N day
   * window near the start of the date range. For example if a report is for
   * 2021-11-01 to 2021-11-10 and `inAnyNDayPeriod` = 3, the first two day
   * period will be effectively shortened because no event data outside the
   * report's date range will be read. For example, the first four periods
   * will effectively be: 2021-11-01 to 2021-11-01, 2021-11-01 to 2021-11-02,
   * 2021-11-01 to 2021-11-03, and 2021-11-02 to 2021-11-04.
   * `inAnyNDayPeriod` is optional. If not specified, the
   * `segmentParameterFilter` is applied to each event individually.
   * </pre>
   *
   * <code>optional int64 in_any_n_day_period = 1;</code>
   *
   * @return The inAnyNDayPeriod.
   */
  @java.lang.Override
  public long getInAnyNDayPeriod() {
    return inAnyNDayPeriod_;
  }

  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 (((bitField0_ & 0x00000001) != 0)) {
      output.writeInt64(1, inAnyNDayPeriod_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (((bitField0_ & 0x00000001) != 0)) {
      size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, inAnyNDayPeriod_);
    }
    size += unknownFields.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.analytics.data.v1alpha.SegmentParameterFilterScoping)) {
      return super.equals(obj);
    }
    com.google.analytics.data.v1alpha.SegmentParameterFilterScoping other =
        (com.google.analytics.data.v1alpha.SegmentParameterFilterScoping) obj;

    if (hasInAnyNDayPeriod() != other.hasInAnyNDayPeriod()) return false;
    if (hasInAnyNDayPeriod()) {
      if (getInAnyNDayPeriod() != other.getInAnyNDayPeriod()) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasInAnyNDayPeriod()) {
      hash = (37 * hash) + IN_ANY_N_DAY_PERIOD_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getInAnyNDayPeriod());
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.analytics.data.v1alpha.SegmentParameterFilterScoping parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.analytics.data.v1alpha.SegmentParameterFilterScoping parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.analytics.data.v1alpha.SegmentParameterFilterScoping parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.analytics.data.v1alpha.SegmentParameterFilterScoping 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.analytics.data.v1alpha.SegmentParameterFilterScoping parseFrom(
      byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.analytics.data.v1alpha.SegmentParameterFilterScoping parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.analytics.data.v1alpha.SegmentParameterFilterScoping parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.analytics.data.v1alpha.SegmentParameterFilterScoping 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.analytics.data.v1alpha.SegmentParameterFilterScoping parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.analytics.data.v1alpha.SegmentParameterFilterScoping 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.analytics.data.v1alpha.SegmentParameterFilterScoping parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.analytics.data.v1alpha.SegmentParameterFilterScoping 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.analytics.data.v1alpha.SegmentParameterFilterScoping 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>
   * Scopings specify how multiple events should be considered when evaluating a
   * segment parameter filter.
   * </pre>
   *
   * Protobuf type {@code google.analytics.data.v1alpha.SegmentParameterFilterScoping}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.analytics.data.v1alpha.SegmentParameterFilterScoping)
      com.google.analytics.data.v1alpha.SegmentParameterFilterScopingOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.analytics.data.v1alpha.ReportingApiProto
          .internal_static_google_analytics_data_v1alpha_SegmentParameterFilterScoping_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.analytics.data.v1alpha.ReportingApiProto
          .internal_static_google_analytics_data_v1alpha_SegmentParameterFilterScoping_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.analytics.data.v1alpha.SegmentParameterFilterScoping.class,
              com.google.analytics.data.v1alpha.SegmentParameterFilterScoping.Builder.class);
    }

    // Construct using com.google.analytics.data.v1alpha.SegmentParameterFilterScoping.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      inAnyNDayPeriod_ = 0L;
      bitField0_ = (bitField0_ & ~0x00000001);
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.analytics.data.v1alpha.ReportingApiProto
          .internal_static_google_analytics_data_v1alpha_SegmentParameterFilterScoping_descriptor;
    }

    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentParameterFilterScoping
        getDefaultInstanceForType() {
      return com.google.analytics.data.v1alpha.SegmentParameterFilterScoping.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentParameterFilterScoping build() {
      com.google.analytics.data.v1alpha.SegmentParameterFilterScoping result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.analytics.data.v1alpha.SegmentParameterFilterScoping buildPartial() {
      com.google.analytics.data.v1alpha.SegmentParameterFilterScoping result =
          new com.google.analytics.data.v1alpha.SegmentParameterFilterScoping(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.inAnyNDayPeriod_ = inAnyNDayPeriod_;
        to_bitField0_ |= 0x00000001;
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.analytics.data.v1alpha.SegmentParameterFilterScoping) {
        return mergeFrom((com.google.analytics.data.v1alpha.SegmentParameterFilterScoping) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(
        com.google.analytics.data.v1alpha.SegmentParameterFilterScoping other) {
      if (other
          == com.google.analytics.data.v1alpha.SegmentParameterFilterScoping.getDefaultInstance())
        return this;
      if (other.hasInAnyNDayPeriod()) {
        setInAnyNDayPeriod(other.getInAnyNDayPeriod());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.analytics.data.v1alpha.SegmentParameterFilterScoping parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.analytics.data.v1alpha.SegmentParameterFilterScoping)
                e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private long inAnyNDayPeriod_;
    /**
     *
     *
     * <pre>
     * Accumulates the parameter over the specified period of days before
     * applying the filter. Only supported if criteria scoping is
     * `ACROSS_ALL_SESSIONS` or `WITHIN_SAME_SESSION`. Only supported if the
     * parameter is `event_count`.
     * For example if `inAnyNDayPeriod` is 3, the event_name is "purchase",
     * the event parameter is "event_count", and the Filter's criteria is
     * greater than 5, this filter will accumulate the event count of purchase
     * events over every 3 consecutive day period in the report's date range; a
     * user will pass this Filter's criteria to be included in this segment if
     * their count of purchase events exceeds 5 in any 3 consecutive day period.
     * For example, the periods 2021-11-01 to 2021-11-03, 2021-11-02 to
     * 2021-11-04, 2021-11-03 to 2021-11-05, and etc. will be considered.
     * The date range is not extended for the purpose of having a full N day
     * window near the start of the date range. For example if a report is for
     * 2021-11-01 to 2021-11-10 and `inAnyNDayPeriod` = 3, the first two day
     * period will be effectively shortened because no event data outside the
     * report's date range will be read. For example, the first four periods
     * will effectively be: 2021-11-01 to 2021-11-01, 2021-11-01 to 2021-11-02,
     * 2021-11-01 to 2021-11-03, and 2021-11-02 to 2021-11-04.
     * `inAnyNDayPeriod` is optional. If not specified, the
     * `segmentParameterFilter` is applied to each event individually.
     * </pre>
     *
     * <code>optional int64 in_any_n_day_period = 1;</code>
     *
     * @return Whether the inAnyNDayPeriod field is set.
     */
    @java.lang.Override
    public boolean hasInAnyNDayPeriod() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     *
     *
     * <pre>
     * Accumulates the parameter over the specified period of days before
     * applying the filter. Only supported if criteria scoping is
     * `ACROSS_ALL_SESSIONS` or `WITHIN_SAME_SESSION`. Only supported if the
     * parameter is `event_count`.
     * For example if `inAnyNDayPeriod` is 3, the event_name is "purchase",
     * the event parameter is "event_count", and the Filter's criteria is
     * greater than 5, this filter will accumulate the event count of purchase
     * events over every 3 consecutive day period in the report's date range; a
     * user will pass this Filter's criteria to be included in this segment if
     * their count of purchase events exceeds 5 in any 3 consecutive day period.
     * For example, the periods 2021-11-01 to 2021-11-03, 2021-11-02 to
     * 2021-11-04, 2021-11-03 to 2021-11-05, and etc. will be considered.
     * The date range is not extended for the purpose of having a full N day
     * window near the start of the date range. For example if a report is for
     * 2021-11-01 to 2021-11-10 and `inAnyNDayPeriod` = 3, the first two day
     * period will be effectively shortened because no event data outside the
     * report's date range will be read. For example, the first four periods
     * will effectively be: 2021-11-01 to 2021-11-01, 2021-11-01 to 2021-11-02,
     * 2021-11-01 to 2021-11-03, and 2021-11-02 to 2021-11-04.
     * `inAnyNDayPeriod` is optional. If not specified, the
     * `segmentParameterFilter` is applied to each event individually.
     * </pre>
     *
     * <code>optional int64 in_any_n_day_period = 1;</code>
     *
     * @return The inAnyNDayPeriod.
     */
    @java.lang.Override
    public long getInAnyNDayPeriod() {
      return inAnyNDayPeriod_;
    }
    /**
     *
     *
     * <pre>
     * Accumulates the parameter over the specified period of days before
     * applying the filter. Only supported if criteria scoping is
     * `ACROSS_ALL_SESSIONS` or `WITHIN_SAME_SESSION`. Only supported if the
     * parameter is `event_count`.
     * For example if `inAnyNDayPeriod` is 3, the event_name is "purchase",
     * the event parameter is "event_count", and the Filter's criteria is
     * greater than 5, this filter will accumulate the event count of purchase
     * events over every 3 consecutive day period in the report's date range; a
     * user will pass this Filter's criteria to be included in this segment if
     * their count of purchase events exceeds 5 in any 3 consecutive day period.
     * For example, the periods 2021-11-01 to 2021-11-03, 2021-11-02 to
     * 2021-11-04, 2021-11-03 to 2021-11-05, and etc. will be considered.
     * The date range is not extended for the purpose of having a full N day
     * window near the start of the date range. For example if a report is for
     * 2021-11-01 to 2021-11-10 and `inAnyNDayPeriod` = 3, the first two day
     * period will be effectively shortened because no event data outside the
     * report's date range will be read. For example, the first four periods
     * will effectively be: 2021-11-01 to 2021-11-01, 2021-11-01 to 2021-11-02,
     * 2021-11-01 to 2021-11-03, and 2021-11-02 to 2021-11-04.
     * `inAnyNDayPeriod` is optional. If not specified, the
     * `segmentParameterFilter` is applied to each event individually.
     * </pre>
     *
     * <code>optional int64 in_any_n_day_period = 1;</code>
     *
     * @param value The inAnyNDayPeriod to set.
     * @return This builder for chaining.
     */
    public Builder setInAnyNDayPeriod(long value) {
      bitField0_ |= 0x00000001;
      inAnyNDayPeriod_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Accumulates the parameter over the specified period of days before
     * applying the filter. Only supported if criteria scoping is
     * `ACROSS_ALL_SESSIONS` or `WITHIN_SAME_SESSION`. Only supported if the
     * parameter is `event_count`.
     * For example if `inAnyNDayPeriod` is 3, the event_name is "purchase",
     * the event parameter is "event_count", and the Filter's criteria is
     * greater than 5, this filter will accumulate the event count of purchase
     * events over every 3 consecutive day period in the report's date range; a
     * user will pass this Filter's criteria to be included in this segment if
     * their count of purchase events exceeds 5 in any 3 consecutive day period.
     * For example, the periods 2021-11-01 to 2021-11-03, 2021-11-02 to
     * 2021-11-04, 2021-11-03 to 2021-11-05, and etc. will be considered.
     * The date range is not extended for the purpose of having a full N day
     * window near the start of the date range. For example if a report is for
     * 2021-11-01 to 2021-11-10 and `inAnyNDayPeriod` = 3, the first two day
     * period will be effectively shortened because no event data outside the
     * report's date range will be read. For example, the first four periods
     * will effectively be: 2021-11-01 to 2021-11-01, 2021-11-01 to 2021-11-02,
     * 2021-11-01 to 2021-11-03, and 2021-11-02 to 2021-11-04.
     * `inAnyNDayPeriod` is optional. If not specified, the
     * `segmentParameterFilter` is applied to each event individually.
     * </pre>
     *
     * <code>optional int64 in_any_n_day_period = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearInAnyNDayPeriod() {
      bitField0_ = (bitField0_ & ~0x00000001);
      inAnyNDayPeriod_ = 0L;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.analytics.data.v1alpha.SegmentParameterFilterScoping)
  }

  // @@protoc_insertion_point(class_scope:google.analytics.data.v1alpha.SegmentParameterFilterScoping)
  private static final com.google.analytics.data.v1alpha.SegmentParameterFilterScoping
      DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.analytics.data.v1alpha.SegmentParameterFilterScoping();
  }

  public static com.google.analytics.data.v1alpha.SegmentParameterFilterScoping
      getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<SegmentParameterFilterScoping> PARSER =
      new com.google.protobuf.AbstractParser<SegmentParameterFilterScoping>() {
        @java.lang.Override
        public SegmentParameterFilterScoping parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new SegmentParameterFilterScoping(input, extensionRegistry);
        }
      };

  public static com.google.protobuf.Parser<SegmentParameterFilterScoping> parser() {
    return PARSER;
  }

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

  @java.lang.Override
  public com.google.analytics.data.v1alpha.SegmentParameterFilterScoping
      getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
