<?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;

/**
 * Defines a simple filter that a user must satisfy to be a member of the
 * Audience.
 *
 * Generated from protobuf message <code>google.analytics.admin.v1alpha.AudienceSimpleFilter</code>
 */
class AudienceSimpleFilter extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Immutable. Specifies the scope for this filter.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceFilterScope scope = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    private $scope = 0;
    /**
     * Required. Immutable. A logical expression of Audience dimension, metric, or
     * event filters.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceFilterExpression filter_expression = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    private $filter_expression = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $scope
     *           Required. Immutable. Specifies the scope for this filter.
     *     @type \Google\Analytics\Admin\V1alpha\AudienceFilterExpression $filter_expression
     *           Required. Immutable. A logical expression of Audience dimension, metric, or
     *           event filters.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Admin\V1Alpha\Audience::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Immutable. Specifies the scope for this filter.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceFilterScope scope = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return int
     */
    public function getScope()
    {
        return $this->scope;
    }

    /**
     * Required. Immutable. Specifies the scope for this filter.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceFilterScope scope = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param int $var
     * @return $this
     */
    public function setScope($var)
    {
        GPBUtil::checkEnum($var, \Google\Analytics\Admin\V1alpha\AudienceFilterScope::class);
        $this->scope = $var;

        return $this;
    }

    /**
     * Required. Immutable. A logical expression of Audience dimension, metric, or
     * event filters.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceFilterExpression filter_expression = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return \Google\Analytics\Admin\V1alpha\AudienceFilterExpression|null
     */
    public function getFilterExpression()
    {
        return $this->filter_expression;
    }

    public function hasFilterExpression()
    {
        return isset($this->filter_expression);
    }

    public function clearFilterExpression()
    {
        unset($this->filter_expression);
    }

    /**
     * Required. Immutable. A logical expression of Audience dimension, metric, or
     * event filters.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceFilterExpression filter_expression = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param \Google\Analytics\Admin\V1alpha\AudienceFilterExpression $var
     * @return $this
     */
    public function setFilterExpression($var)
    {
        GPBUtil::checkMessage($var, \Google\Analytics\Admin\V1alpha\AudienceFilterExpression::class);
        $this->filter_expression = $var;

        return $this;
    }

}

