<?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 sessions are excluded in this segment.
 *
 * Generated from protobuf message <code>google.analytics.data.v1alpha.SessionSegmentExclusion</code>
 */
class SessionSegmentExclusion extends \Google\Protobuf\Internal\Message
{
    /**
     * Specifies how long an exclusion will last if a session matches the
     * `sessionExclusionCriteria`.
     * Optional. If unspecified, a `sessionExclusionDuration` of
     * `SESSION_EXCLUSION_TEMPORARY` is used.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.SessionExclusionDuration session_exclusion_duration = 1;</code>
     */
    private $session_exclusion_duration = 0;
    /**
     * If a session meets this condition, the session is excluded from
     * membership in the segment for the `sessionExclusionDuration`.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.SessionSegmentCriteria session_exclusion_criteria = 2;</code>
     */
    private $session_exclusion_criteria = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $session_exclusion_duration
     *           Specifies how long an exclusion will last if a session matches the
     *           `sessionExclusionCriteria`.
     *           Optional. If unspecified, a `sessionExclusionDuration` of
     *           `SESSION_EXCLUSION_TEMPORARY` is used.
     *     @type \Google\Analytics\Data\V1alpha\SessionSegmentCriteria $session_exclusion_criteria
     *           If a session meets this condition, the session is excluded from
     *           membership in the segment for the `sessionExclusionDuration`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce();
        parent::__construct($data);
    }

    /**
     * Specifies how long an exclusion will last if a session matches the
     * `sessionExclusionCriteria`.
     * Optional. If unspecified, a `sessionExclusionDuration` of
     * `SESSION_EXCLUSION_TEMPORARY` is used.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.SessionExclusionDuration session_exclusion_duration = 1;</code>
     * @return int
     */
    public function getSessionExclusionDuration()
    {
        return $this->session_exclusion_duration;
    }

    /**
     * Specifies how long an exclusion will last if a session matches the
     * `sessionExclusionCriteria`.
     * Optional. If unspecified, a `sessionExclusionDuration` of
     * `SESSION_EXCLUSION_TEMPORARY` is used.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.SessionExclusionDuration session_exclusion_duration = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setSessionExclusionDuration($var)
    {
        GPBUtil::checkEnum($var, \Google\Analytics\Data\V1alpha\SessionExclusionDuration::class);
        $this->session_exclusion_duration = $var;

        return $this;
    }

    /**
     * If a session meets this condition, the session is excluded from
     * membership in the segment for the `sessionExclusionDuration`.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.SessionSegmentCriteria session_exclusion_criteria = 2;</code>
     * @return \Google\Analytics\Data\V1alpha\SessionSegmentCriteria|null
     */
    public function getSessionExclusionCriteria()
    {
        return $this->session_exclusion_criteria;
    }

    public function hasSessionExclusionCriteria()
    {
        return isset($this->session_exclusion_criteria);
    }

    public function clearSessionExclusionCriteria()
    {
        unset($this->session_exclusion_criteria);
    }

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

        return $this;
    }

}

