<?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 users are excluded in this segment.
 *
 * Generated from protobuf message <code>google.analytics.data.v1alpha.UserSegmentExclusion</code>
 */
class UserSegmentExclusion extends \Google\Protobuf\Internal\Message
{
    /**
     * Specifies how long an exclusion will last if a user matches the
     * `userExclusionCriteria`.
     * Optional. If unspecified, `userExclusionDuration` of
     * `USER_EXCLUSION_TEMPORARY` is used.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.UserExclusionDuration user_exclusion_duration = 1;</code>
     */
    private $user_exclusion_duration = 0;
    /**
     * If a user meets this condition, the user is excluded from membership in
     * the segment for the `userExclusionDuration`.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.UserSegmentCriteria user_exclusion_criteria = 2;</code>
     */
    private $user_exclusion_criteria = null;

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

    /**
     * Specifies how long an exclusion will last if a user matches the
     * `userExclusionCriteria`.
     * Optional. If unspecified, `userExclusionDuration` of
     * `USER_EXCLUSION_TEMPORARY` is used.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.UserExclusionDuration user_exclusion_duration = 1;</code>
     * @return int
     */
    public function getUserExclusionDuration()
    {
        return $this->user_exclusion_duration;
    }

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

        return $this;
    }

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

    public function hasUserExclusionCriteria()
    {
        return isset($this->user_exclusion_criteria);
    }

    public function clearUserExclusionCriteria()
    {
        unset($this->user_exclusion_criteria);
    }

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

        return $this;
    }

}

