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

namespace Google\Analytics\Data\V1alpha;

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

/**
 * Specifies which events are excluded in this segment.
 *
 * Generated from protobuf message <code>google.analytics.data.v1alpha.EventSegmentExclusion</code>
 */
class EventSegmentExclusion extends \Google\Protobuf\Internal\Message
{
    /**
     * `eventExclusionDuration` should always be `PERMANENTLY_EXCLUDE`.
     * Optional. If unspecified, an `eventExclusionDuration` of
     * `EVENT_EXCLUSION_PERMANENT` is used.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.EventExclusionDuration event_exclusion_duration = 1;</code>
     */
    private $event_exclusion_duration = 0;
    /**
     * If an event meets this condition, the event is excluded from membership
     * in the segment for the `eventExclusionDuration`.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.EventSegmentCriteria event_exclusion_criteria = 2;</code>
     */
    private $event_exclusion_criteria = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $event_exclusion_duration
     *           `eventExclusionDuration` should always be `PERMANENTLY_EXCLUDE`.
     *           Optional. If unspecified, an `eventExclusionDuration` of
     *           `EVENT_EXCLUSION_PERMANENT` is used.
     *     @type \Google\Analytics\Data\V1alpha\EventSegmentCriteria $event_exclusion_criteria
     *           If an event meets this condition, the event is excluded from membership
     *           in the segment for the `eventExclusionDuration`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce();
        parent::__construct($data);
    }

    /**
     * `eventExclusionDuration` should always be `PERMANENTLY_EXCLUDE`.
     * Optional. If unspecified, an `eventExclusionDuration` of
     * `EVENT_EXCLUSION_PERMANENT` is used.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.EventExclusionDuration event_exclusion_duration = 1;</code>
     * @return int
     */
    public function getEventExclusionDuration()
    {
        return $this->event_exclusion_duration;
    }

    /**
     * `eventExclusionDuration` should always be `PERMANENTLY_EXCLUDE`.
     * Optional. If unspecified, an `eventExclusionDuration` of
     * `EVENT_EXCLUSION_PERMANENT` is used.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.EventExclusionDuration event_exclusion_duration = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setEventExclusionDuration($var)
    {
        GPBUtil::checkEnum($var, \Google\Analytics\Data\V1alpha\EventExclusionDuration::class);
        $this->event_exclusion_duration = $var;

        return $this;
    }

    /**
     * If an event meets this condition, the event is excluded from membership
     * in the segment for the `eventExclusionDuration`.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.EventSegmentCriteria event_exclusion_criteria = 2;</code>
     * @return \Google\Analytics\Data\V1alpha\EventSegmentCriteria|null
     */
    public function getEventExclusionCriteria()
    {
        return $this->event_exclusion_criteria;
    }

    public function hasEventExclusionCriteria()
    {
        return isset($this->event_exclusion_criteria);
    }

    public function clearEventExclusionCriteria()
    {
        unset($this->event_exclusion_criteria);
    }

    /**
     * If an event meets this condition, the event is excluded from membership
     * in the segment for the `eventExclusionDuration`.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.EventSegmentCriteria event_exclusion_criteria = 2;</code>
     * @param \Google\Analytics\Data\V1alpha\EventSegmentCriteria $var
     * @return $this
     */
    public function setEventExclusionCriteria($var)
    {
        GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\EventSegmentCriteria::class);
        $this->event_exclusion_criteria = $var;

        return $this;
    }

}

