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

/**
 * Steps define the user journey you want to measure. Steps contain one or
 * more conditions that your users must meet to be included in that step of
 * the funnel journey.
 *
 * Generated from protobuf message <code>google.analytics.data.v1alpha.FunnelStep</code>
 */
class FunnelStep extends \Google\Protobuf\Internal\Message
{
    /**
     * The distinctive name for this step. If unspecified, steps will be named
     * by a 1 based indexed name (for example "0. ", "1. ", etc.). This name
     * defines string value returned by the `funnelStepName` dimension. For
     * example, specifying `name = Purchase` in the request's third funnel step
     * will produce `3. Purchase` in the funnel report response.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * If true, this step must directly follow the previous step. If false,
     * there can be events between the previous step and this step. If
     * unspecified, `isDirectlyFollowedBy` is treated as false.
     *
     * Generated from protobuf field <code>bool is_directly_followed_by = 2;</code>
     */
    private $is_directly_followed_by = false;
    /**
     * If specified, this step must complete within this duration of the
     * completion of the prior step. `withinDurationFromPriorStep` is inclusive
     * of the endpoint at the microsecond granularity. For example a duration of
     * 5 seconds can be completed at 4.9 or 5.0 seconds, but not 5 seconds and 1
     * microsecond.
     * `withinDurationFromPriorStep` is optional, and if unspecified, steps may
     * be separated by any time duration.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration within_duration_from_prior_step = 3;</code>
     */
    private $within_duration_from_prior_step = null;
    /**
     * The condition that your users must meet to be included in this step of
     * the funnel journey.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.FunnelFilterExpression filter_expression = 4;</code>
     */
    private $filter_expression = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The distinctive name for this step. If unspecified, steps will be named
     *           by a 1 based indexed name (for example "0. ", "1. ", etc.). This name
     *           defines string value returned by the `funnelStepName` dimension. For
     *           example, specifying `name = Purchase` in the request's third funnel step
     *           will produce `3. Purchase` in the funnel report response.
     *     @type bool $is_directly_followed_by
     *           If true, this step must directly follow the previous step. If false,
     *           there can be events between the previous step and this step. If
     *           unspecified, `isDirectlyFollowedBy` is treated as false.
     *     @type \Google\Protobuf\Duration $within_duration_from_prior_step
     *           If specified, this step must complete within this duration of the
     *           completion of the prior step. `withinDurationFromPriorStep` is inclusive
     *           of the endpoint at the microsecond granularity. For example a duration of
     *           5 seconds can be completed at 4.9 or 5.0 seconds, but not 5 seconds and 1
     *           microsecond.
     *           `withinDurationFromPriorStep` is optional, and if unspecified, steps may
     *           be separated by any time duration.
     *     @type \Google\Analytics\Data\V1alpha\FunnelFilterExpression $filter_expression
     *           The condition that your users must meet to be included in this step of
     *           the funnel journey.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce();
        parent::__construct($data);
    }

    /**
     * The distinctive name for this step. If unspecified, steps will be named
     * by a 1 based indexed name (for example "0. ", "1. ", etc.). This name
     * defines string value returned by the `funnelStepName` dimension. For
     * example, specifying `name = Purchase` in the request's third funnel step
     * will produce `3. Purchase` in the funnel report response.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The distinctive name for this step. If unspecified, steps will be named
     * by a 1 based indexed name (for example "0. ", "1. ", etc.). This name
     * defines string value returned by the `funnelStepName` dimension. For
     * example, specifying `name = Purchase` in the request's third funnel step
     * will produce `3. Purchase` in the funnel report response.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * If true, this step must directly follow the previous step. If false,
     * there can be events between the previous step and this step. If
     * unspecified, `isDirectlyFollowedBy` is treated as false.
     *
     * Generated from protobuf field <code>bool is_directly_followed_by = 2;</code>
     * @return bool
     */
    public function getIsDirectlyFollowedBy()
    {
        return $this->is_directly_followed_by;
    }

    /**
     * If true, this step must directly follow the previous step. If false,
     * there can be events between the previous step and this step. If
     * unspecified, `isDirectlyFollowedBy` is treated as false.
     *
     * Generated from protobuf field <code>bool is_directly_followed_by = 2;</code>
     * @param bool $var
     * @return $this
     */
    public function setIsDirectlyFollowedBy($var)
    {
        GPBUtil::checkBool($var);
        $this->is_directly_followed_by = $var;

        return $this;
    }

    /**
     * If specified, this step must complete within this duration of the
     * completion of the prior step. `withinDurationFromPriorStep` is inclusive
     * of the endpoint at the microsecond granularity. For example a duration of
     * 5 seconds can be completed at 4.9 or 5.0 seconds, but not 5 seconds and 1
     * microsecond.
     * `withinDurationFromPriorStep` is optional, and if unspecified, steps may
     * be separated by any time duration.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration within_duration_from_prior_step = 3;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getWithinDurationFromPriorStep()
    {
        return $this->within_duration_from_prior_step;
    }

    public function hasWithinDurationFromPriorStep()
    {
        return isset($this->within_duration_from_prior_step);
    }

    public function clearWithinDurationFromPriorStep()
    {
        unset($this->within_duration_from_prior_step);
    }

    /**
     * If specified, this step must complete within this duration of the
     * completion of the prior step. `withinDurationFromPriorStep` is inclusive
     * of the endpoint at the microsecond granularity. For example a duration of
     * 5 seconds can be completed at 4.9 or 5.0 seconds, but not 5 seconds and 1
     * microsecond.
     * `withinDurationFromPriorStep` is optional, and if unspecified, steps may
     * be separated by any time duration.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration within_duration_from_prior_step = 3;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setWithinDurationFromPriorStep($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->within_duration_from_prior_step = $var;

        return $this;
    }

    /**
     * The condition that your users must meet to be included in this step of
     * the funnel journey.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.FunnelFilterExpression filter_expression = 4;</code>
     * @return \Google\Analytics\Data\V1alpha\FunnelFilterExpression|null
     */
    public function getFilterExpression()
    {
        return $this->filter_expression;
    }

    public function hasFilterExpression()
    {
        return isset($this->filter_expression);
    }

    public function clearFilterExpression()
    {
        unset($this->filter_expression);
    }

    /**
     * The condition that your users must meet to be included in this step of
     * the funnel journey.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.FunnelFilterExpression filter_expression = 4;</code>
     * @param \Google\Analytics\Data\V1alpha\FunnelFilterExpression $var
     * @return $this
     */
    public function setFilterExpression($var)
    {
        GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\FunnelFilterExpression::class);
        $this->filter_expression = $var;

        return $this;
    }

}

