<?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 filter that matches events of a single event name. If an event parameter
 * is specified, only the subset of events that match both the single event name
 * and the parameter filter expressions match this event filter.
 *
 * Generated from protobuf message <code>google.analytics.admin.v1alpha.AudienceEventFilter</code>
 */
class AudienceEventFilter extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Immutable. The name of the event to match against.
     *
     * Generated from protobuf field <code>string event_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    private $event_name = '';
    /**
     * Optional. If specified, this filter matches events that match both the
     * single event name and the parameter filter expressions. AudienceEventFilter
     * inside the parameter filter expression cannot be set (i.e., nested
     * event filters are not supported). This should be a single and_group of
     * dimension_or_metric_filter or not_expression; ANDs of ORs are not
     * supported. Also, if it includes a filter for "eventCount", only that one
     * will be considered; all the other filters will be ignored.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceFilterExpression event_parameter_filter_expression = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $event_parameter_filter_expression = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $event_name
     *           Required. Immutable. The name of the event to match against.
     *     @type \Google\Analytics\Admin\V1alpha\AudienceFilterExpression $event_parameter_filter_expression
     *           Optional. If specified, this filter matches events that match both the
     *           single event name and the parameter filter expressions. AudienceEventFilter
     *           inside the parameter filter expression cannot be set (i.e., nested
     *           event filters are not supported). This should be a single and_group of
     *           dimension_or_metric_filter or not_expression; ANDs of ORs are not
     *           supported. Also, if it includes a filter for "eventCount", only that one
     *           will be considered; all the other filters will be ignored.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Admin\V1Alpha\Audience::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Immutable. The name of the event to match against.
     *
     * Generated from protobuf field <code>string event_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getEventName()
    {
        return $this->event_name;
    }

    /**
     * Required. Immutable. The name of the event to match against.
     *
     * Generated from protobuf field <code>string event_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setEventName($var)
    {
        GPBUtil::checkString($var, True);
        $this->event_name = $var;

        return $this;
    }

    /**
     * Optional. If specified, this filter matches events that match both the
     * single event name and the parameter filter expressions. AudienceEventFilter
     * inside the parameter filter expression cannot be set (i.e., nested
     * event filters are not supported). This should be a single and_group of
     * dimension_or_metric_filter or not_expression; ANDs of ORs are not
     * supported. Also, if it includes a filter for "eventCount", only that one
     * will be considered; all the other filters will be ignored.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceFilterExpression event_parameter_filter_expression = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Analytics\Admin\V1alpha\AudienceFilterExpression|null
     */
    public function getEventParameterFilterExpression()
    {
        return $this->event_parameter_filter_expression;
    }

    public function hasEventParameterFilterExpression()
    {
        return isset($this->event_parameter_filter_expression);
    }

    public function clearEventParameterFilterExpression()
    {
        unset($this->event_parameter_filter_expression);
    }

    /**
     * Optional. If specified, this filter matches events that match both the
     * single event name and the parameter filter expressions. AudienceEventFilter
     * inside the parameter filter expression cannot be set (i.e., nested
     * event filters are not supported). This should be a single and_group of
     * dimension_or_metric_filter or not_expression; ANDs of ORs are not
     * supported. Also, if it includes a filter for "eventCount", only that one
     * will be considered; all the other filters will be ignored.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AudienceFilterExpression event_parameter_filter_expression = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Analytics\Admin\V1alpha\AudienceFilterExpression $var
     * @return $this
     */
    public function setEventParameterFilterExpression($var)
    {
        GPBUtil::checkMessage($var, \Google\Analytics\Admin\V1alpha\AudienceFilterExpression::class);
        $this->event_parameter_filter_expression = $var;

        return $this;
    }

}

