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

/**
 * Configures the funnel in a funnel report request. A funnel reports on users
 * as they pass through a sequence of steps.
 * Funnel exploration lets you visualize the steps your users take to complete a
 * task and quickly see how well they are succeeding or failing at each step.
 * For example, how do prospects become shoppers and then become buyers? How do
 * one time buyers become repeat buyers? With this information, you can improve
 * inefficient or abandoned customer journeys.
 *
 * Generated from protobuf message <code>google.analytics.data.v1alpha.Funnel</code>
 */
class Funnel extends \Google\Protobuf\Internal\Message
{
    /**
     * In an open funnel, users can enter the funnel in any step, and in a closed
     * funnel, users must enter the funnel in the first step. Optional. If
     * unspecified, a closed funnel is used.
     *
     * Generated from protobuf field <code>bool is_open_funnel = 1;</code>
     */
    protected $is_open_funnel = false;
    /**
     * The sequential steps of this funnel.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1alpha.FunnelStep steps = 2;</code>
     */
    private $steps;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $is_open_funnel
     *           In an open funnel, users can enter the funnel in any step, and in a closed
     *           funnel, users must enter the funnel in the first step. Optional. If
     *           unspecified, a closed funnel is used.
     *     @type array<\Google\Analytics\Data\V1alpha\FunnelStep>|\Google\Protobuf\Internal\RepeatedField $steps
     *           The sequential steps of this funnel.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce();
        parent::__construct($data);
    }

    /**
     * In an open funnel, users can enter the funnel in any step, and in a closed
     * funnel, users must enter the funnel in the first step. Optional. If
     * unspecified, a closed funnel is used.
     *
     * Generated from protobuf field <code>bool is_open_funnel = 1;</code>
     * @return bool
     */
    public function getIsOpenFunnel()
    {
        return $this->is_open_funnel;
    }

    /**
     * In an open funnel, users can enter the funnel in any step, and in a closed
     * funnel, users must enter the funnel in the first step. Optional. If
     * unspecified, a closed funnel is used.
     *
     * Generated from protobuf field <code>bool is_open_funnel = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setIsOpenFunnel($var)
    {
        GPBUtil::checkBool($var);
        $this->is_open_funnel = $var;

        return $this;
    }

    /**
     * The sequential steps of this funnel.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1alpha.FunnelStep steps = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getSteps()
    {
        return $this->steps;
    }

    /**
     * The sequential steps of this funnel.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1alpha.FunnelStep steps = 2;</code>
     * @param array<\Google\Analytics\Data\V1alpha\FunnelStep>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setSteps($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\FunnelStep::class);
        $this->steps = $arr;

        return $this;
    }

}

