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

/**
 * Define conditions that must occur in a specific order for the user to be
 * a member of the segment.
 *
 * Generated from protobuf message <code>google.analytics.data.v1alpha.UserSegmentSequenceGroup</code>
 */
class UserSegmentSequenceGroup extends \Google\Protobuf\Internal\Message
{
    /**
     * All sequence steps must be satisfied in the scoping for the user to
     * match the sequence. For example if `sequenceScoping =
     * USER_CRITERIA_WITHIN_SAME_SESSION`, all sequence steps must complete within
     * one session for the user to match the sequence. `sequenceScoping =
     * USER_CRITERIA_WITHIN_SAME_EVENT` is not supported.
     * Optional. If unspecified, `conditionScoping = ACROSS_ALL_SESSIONS` is
     * used.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.UserCriteriaScoping sequence_scoping = 1;</code>
     */
    protected $sequence_scoping = 0;
    /**
     * Defines the time period in which the whole sequence must occur; for
     * example, 30 Minutes. `sequenceMaximumDuration` is inclusive
     * of the endpoint at the microsecond granularity. For example a sequence
     * with a maximum duration of 5 seconds can be completed at 4.9 or 5.0
     * seconds, but not 5 seconds and 1 microsecond.
     * `sequenceMaximumDuration` is optional, and if unspecified, sequences can
     * be completed in any time duration.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration sequence_maximum_duration = 2;</code>
     */
    protected $sequence_maximum_duration = null;
    /**
     * An ordered sequence of condition steps. A user's events must complete
     * each step in order for the user to match the
     * `UserSegmentSequenceGroup`.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1alpha.UserSequenceStep user_sequence_steps = 3;</code>
     */
    private $user_sequence_steps;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $sequence_scoping
     *           All sequence steps must be satisfied in the scoping for the user to
     *           match the sequence. For example if `sequenceScoping =
     *           USER_CRITERIA_WITHIN_SAME_SESSION`, all sequence steps must complete within
     *           one session for the user to match the sequence. `sequenceScoping =
     *           USER_CRITERIA_WITHIN_SAME_EVENT` is not supported.
     *           Optional. If unspecified, `conditionScoping = ACROSS_ALL_SESSIONS` is
     *           used.
     *     @type \Google\Protobuf\Duration $sequence_maximum_duration
     *           Defines the time period in which the whole sequence must occur; for
     *           example, 30 Minutes. `sequenceMaximumDuration` is inclusive
     *           of the endpoint at the microsecond granularity. For example a sequence
     *           with a maximum duration of 5 seconds can be completed at 4.9 or 5.0
     *           seconds, but not 5 seconds and 1 microsecond.
     *           `sequenceMaximumDuration` is optional, and if unspecified, sequences can
     *           be completed in any time duration.
     *     @type array<\Google\Analytics\Data\V1alpha\UserSequenceStep>|\Google\Protobuf\Internal\RepeatedField $user_sequence_steps
     *           An ordered sequence of condition steps. A user's events must complete
     *           each step in order for the user to match the
     *           `UserSegmentSequenceGroup`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce();
        parent::__construct($data);
    }

    /**
     * All sequence steps must be satisfied in the scoping for the user to
     * match the sequence. For example if `sequenceScoping =
     * USER_CRITERIA_WITHIN_SAME_SESSION`, all sequence steps must complete within
     * one session for the user to match the sequence. `sequenceScoping =
     * USER_CRITERIA_WITHIN_SAME_EVENT` is not supported.
     * Optional. If unspecified, `conditionScoping = ACROSS_ALL_SESSIONS` is
     * used.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.UserCriteriaScoping sequence_scoping = 1;</code>
     * @return int
     */
    public function getSequenceScoping()
    {
        return $this->sequence_scoping;
    }

    /**
     * All sequence steps must be satisfied in the scoping for the user to
     * match the sequence. For example if `sequenceScoping =
     * USER_CRITERIA_WITHIN_SAME_SESSION`, all sequence steps must complete within
     * one session for the user to match the sequence. `sequenceScoping =
     * USER_CRITERIA_WITHIN_SAME_EVENT` is not supported.
     * Optional. If unspecified, `conditionScoping = ACROSS_ALL_SESSIONS` is
     * used.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.UserCriteriaScoping sequence_scoping = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setSequenceScoping($var)
    {
        GPBUtil::checkEnum($var, \Google\Analytics\Data\V1alpha\UserCriteriaScoping::class);
        $this->sequence_scoping = $var;

        return $this;
    }

    /**
     * Defines the time period in which the whole sequence must occur; for
     * example, 30 Minutes. `sequenceMaximumDuration` is inclusive
     * of the endpoint at the microsecond granularity. For example a sequence
     * with a maximum duration of 5 seconds can be completed at 4.9 or 5.0
     * seconds, but not 5 seconds and 1 microsecond.
     * `sequenceMaximumDuration` is optional, and if unspecified, sequences can
     * be completed in any time duration.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration sequence_maximum_duration = 2;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getSequenceMaximumDuration()
    {
        return $this->sequence_maximum_duration;
    }

    public function hasSequenceMaximumDuration()
    {
        return isset($this->sequence_maximum_duration);
    }

    public function clearSequenceMaximumDuration()
    {
        unset($this->sequence_maximum_duration);
    }

    /**
     * Defines the time period in which the whole sequence must occur; for
     * example, 30 Minutes. `sequenceMaximumDuration` is inclusive
     * of the endpoint at the microsecond granularity. For example a sequence
     * with a maximum duration of 5 seconds can be completed at 4.9 or 5.0
     * seconds, but not 5 seconds and 1 microsecond.
     * `sequenceMaximumDuration` is optional, and if unspecified, sequences can
     * be completed in any time duration.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration sequence_maximum_duration = 2;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setSequenceMaximumDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->sequence_maximum_duration = $var;

        return $this;
    }

    /**
     * An ordered sequence of condition steps. A user's events must complete
     * each step in order for the user to match the
     * `UserSegmentSequenceGroup`.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1alpha.UserSequenceStep user_sequence_steps = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getUserSequenceSteps()
    {
        return $this->user_sequence_steps;
    }

    /**
     * An ordered sequence of condition steps. A user's events must complete
     * each step in order for the user to match the
     * `UserSegmentSequenceGroup`.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1alpha.UserSequenceStep user_sequence_steps = 3;</code>
     * @param array<\Google\Analytics\Data\V1alpha\UserSequenceStep>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setUserSequenceSteps($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\UserSequenceStep::class);
        $this->user_sequence_steps = $arr;

        return $this;
    }

}

