<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/analytics/admin/v1alpha/audience.proto

namespace Google\Analytics\Admin\V1alpha;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * A specific filter for a single dimension or metric.
 *
 * Generated from protobuf message <code>google.analytics.admin.v1alpha.AudienceDimensionOrMetricFilter</code>
 */
class AudienceDimensionOrMetricFilter extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Immutable. The dimension name or metric name to filter.
     *
     * Generated from protobuf field <code>string field_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    private $field_name = '';
    /**
     * Optional. Indicates whether this filter needs dynamic evaluation or not. If
     * set to true, users join the Audience if they ever met the condition (static
     * evaluation). If unset or set to false, user evaluation for an Audience is
     * dynamic; users are added to an Audience when they meet the conditions and
     * then removed when they no longer meet them.
     * This can only be set when Audience scope is ACROSS_ALL_SESSIONS.
     *
     * Generated from protobuf field <code>bool at_any_point_in_time = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $at_any_point_in_time = false;
    /**
     * Optional. If set, specifies the time window for which to evaluate data in
     * number of days. If not set, then audience data is evaluated against
     * lifetime data (i.e., infinite time window).
     * For example, if set to 1 day, only the current day's data is evaluated. The
     * reference point is the current day when at_any_point_in_time is unset or
     * false.
     * It can only be set when Audience scope is ACROSS_ALL_SESSIONS and cannot be
     * greater than 60 days.
     *
     * Generated from protobuf field <code>int32 in_any_n_day_period = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $in_any_n_day_period = 0;
    protected $one_filter;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\StringFilter $string_filter
     *           A filter for a string-type dimension that matches a particular pattern.
     *     @type \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\InListFilter $in_list_filter
     *           A filter for a string dimension that matches a particular list of
     *           options.
     *     @type \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\NumericFilter $numeric_filter
     *           A filter for numeric or date values on a dimension or metric.
     *     @type \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\BetweenFilter $between_filter
     *           A filter for numeric or date values between certain values on a dimension
     *           or metric.
     *     @type string $field_name
     *           Required. Immutable. The dimension name or metric name to filter.
     *     @type bool $at_any_point_in_time
     *           Optional. Indicates whether this filter needs dynamic evaluation or not. If
     *           set to true, users join the Audience if they ever met the condition (static
     *           evaluation). If unset or set to false, user evaluation for an Audience is
     *           dynamic; users are added to an Audience when they meet the conditions and
     *           then removed when they no longer meet them.
     *           This can only be set when Audience scope is ACROSS_ALL_SESSIONS.
     *     @type int $in_any_n_day_period
     *           Optional. If set, specifies the time window for which to evaluate data in
     *           number of days. If not set, then audience data is evaluated against
     *           lifetime data (i.e., infinite time window).
     *           For example, if set to 1 day, only the current day's data is evaluated. The
     *           reference point is the current day when at_any_point_in_time is unset or
     *           false.
     *           It can only be set when Audience scope is ACROSS_ALL_SESSIONS and cannot be
     *           greater than 60 days.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Admin\V1Alpha\Audience::initOnce();
        parent::__construct($data);
    }

    /**
     * A filter for a string-type dimension that matches a particular pattern.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceDimensionOrMetricFilter.StringFilter string_filter = 2;</code>
     * @return \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\StringFilter|null
     */
    public function getStringFilter()
    {
        return $this->readOneof(2);
    }

    public function hasStringFilter()
    {
        return $this->hasOneof(2);
    }

    /**
     * A filter for a string-type dimension that matches a particular pattern.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceDimensionOrMetricFilter.StringFilter string_filter = 2;</code>
     * @param \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\StringFilter $var
     * @return $this
     */
    public function setStringFilter($var)
    {
        GPBUtil::checkMessage($var, \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\StringFilter::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * A filter for a string dimension that matches a particular list of
     * options.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceDimensionOrMetricFilter.InListFilter in_list_filter = 3;</code>
     * @return \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\InListFilter|null
     */
    public function getInListFilter()
    {
        return $this->readOneof(3);
    }

    public function hasInListFilter()
    {
        return $this->hasOneof(3);
    }

    /**
     * A filter for a string dimension that matches a particular list of
     * options.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceDimensionOrMetricFilter.InListFilter in_list_filter = 3;</code>
     * @param \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\InListFilter $var
     * @return $this
     */
    public function setInListFilter($var)
    {
        GPBUtil::checkMessage($var, \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\InListFilter::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * A filter for numeric or date values on a dimension or metric.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceDimensionOrMetricFilter.NumericFilter numeric_filter = 4;</code>
     * @return \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\NumericFilter|null
     */
    public function getNumericFilter()
    {
        return $this->readOneof(4);
    }

    public function hasNumericFilter()
    {
        return $this->hasOneof(4);
    }

    /**
     * A filter for numeric or date values on a dimension or metric.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceDimensionOrMetricFilter.NumericFilter numeric_filter = 4;</code>
     * @param \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\NumericFilter $var
     * @return $this
     */
    public function setNumericFilter($var)
    {
        GPBUtil::checkMessage($var, \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\NumericFilter::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * A filter for numeric or date values between certain values on a dimension
     * or metric.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceDimensionOrMetricFilter.BetweenFilter between_filter = 5;</code>
     * @return \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\BetweenFilter|null
     */
    public function getBetweenFilter()
    {
        return $this->readOneof(5);
    }

    public function hasBetweenFilter()
    {
        return $this->hasOneof(5);
    }

    /**
     * A filter for numeric or date values between certain values on a dimension
     * or metric.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceDimensionOrMetricFilter.BetweenFilter between_filter = 5;</code>
     * @param \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\BetweenFilter $var
     * @return $this
     */
    public function setBetweenFilter($var)
    {
        GPBUtil::checkMessage($var, \Google\Analytics\Admin\V1alpha\AudienceDimensionOrMetricFilter\BetweenFilter::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Required. Immutable. The dimension name or metric name to filter.
     *
     * Generated from protobuf field <code>string field_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getFieldName()
    {
        return $this->field_name;
    }

    /**
     * Required. Immutable. The dimension name or metric name to filter.
     *
     * Generated from protobuf field <code>string field_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setFieldName($var)
    {
        GPBUtil::checkString($var, True);
        $this->field_name = $var;

        return $this;
    }

    /**
     * Optional. Indicates whether this filter needs dynamic evaluation or not. If
     * set to true, users join the Audience if they ever met the condition (static
     * evaluation). If unset or set to false, user evaluation for an Audience is
     * dynamic; users are added to an Audience when they meet the conditions and
     * then removed when they no longer meet them.
     * This can only be set when Audience scope is ACROSS_ALL_SESSIONS.
     *
     * Generated from protobuf field <code>bool at_any_point_in_time = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getAtAnyPointInTime()
    {
        return $this->at_any_point_in_time;
    }

    /**
     * Optional. Indicates whether this filter needs dynamic evaluation or not. If
     * set to true, users join the Audience if they ever met the condition (static
     * evaluation). If unset or set to false, user evaluation for an Audience is
     * dynamic; users are added to an Audience when they meet the conditions and
     * then removed when they no longer meet them.
     * This can only be set when Audience scope is ACROSS_ALL_SESSIONS.
     *
     * Generated from protobuf field <code>bool at_any_point_in_time = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setAtAnyPointInTime($var)
    {
        GPBUtil::checkBool($var);
        $this->at_any_point_in_time = $var;

        return $this;
    }

    /**
     * Optional. If set, specifies the time window for which to evaluate data in
     * number of days. If not set, then audience data is evaluated against
     * lifetime data (i.e., infinite time window).
     * For example, if set to 1 day, only the current day's data is evaluated. The
     * reference point is the current day when at_any_point_in_time is unset or
     * false.
     * It can only be set when Audience scope is ACROSS_ALL_SESSIONS and cannot be
     * greater than 60 days.
     *
     * Generated from protobuf field <code>int32 in_any_n_day_period = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getInAnyNDayPeriod()
    {
        return $this->in_any_n_day_period;
    }

    /**
     * Optional. If set, specifies the time window for which to evaluate data in
     * number of days. If not set, then audience data is evaluated against
     * lifetime data (i.e., infinite time window).
     * For example, if set to 1 day, only the current day's data is evaluated. The
     * reference point is the current day when at_any_point_in_time is unset or
     * false.
     * It can only be set when Audience scope is ACROSS_ALL_SESSIONS and cannot be
     * greater than 60 days.
     *
     * Generated from protobuf field <code>int32 in_any_n_day_period = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setInAnyNDayPeriod($var)
    {
        GPBUtil::checkInt32($var);
        $this->in_any_n_day_period = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getOneFilter()
    {
        return $this->whichOneof("one_filter");
    }

}

