<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/discoveryengine/v1/user_event.proto

namespace Google\Cloud\DiscoveryEngine\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Detailed panel information associated with a user event.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.PanelInfo</code>
 */
class PanelInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The panel ID.
     *
     * Generated from protobuf field <code>string panel_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $panel_id = '';
    /**
     * The display name of the panel.
     *
     * Generated from protobuf field <code>string display_name = 3;</code>
     */
    protected $display_name = '';
    /**
     * The ordered position of the panel, if shown to the user with other panels.
     * If set, then
     * [total_panels][google.cloud.discoveryengine.v1.PanelInfo.total_panels] must
     * also be set.
     *
     * Generated from protobuf field <code>optional int32 panel_position = 4;</code>
     */
    protected $panel_position = null;
    /**
     * The total number of panels, including this one, shown to the user.
     * Must be set if
     * [panel_position][google.cloud.discoveryengine.v1.PanelInfo.panel_position]
     * is set.
     *
     * Generated from protobuf field <code>optional int32 total_panels = 5;</code>
     */
    protected $total_panels = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $panel_id
     *           Required. The panel ID.
     *     @type string $display_name
     *           The display name of the panel.
     *     @type int $panel_position
     *           The ordered position of the panel, if shown to the user with other panels.
     *           If set, then
     *           [total_panels][google.cloud.discoveryengine.v1.PanelInfo.total_panels] must
     *           also be set.
     *     @type int $total_panels
     *           The total number of panels, including this one, shown to the user.
     *           Must be set if
     *           [panel_position][google.cloud.discoveryengine.v1.PanelInfo.panel_position]
     *           is set.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\UserEvent::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The panel ID.
     *
     * Generated from protobuf field <code>string panel_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getPanelId()
    {
        return $this->panel_id;
    }

    /**
     * Required. The panel ID.
     *
     * Generated from protobuf field <code>string panel_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setPanelId($var)
    {
        GPBUtil::checkString($var, True);
        $this->panel_id = $var;

        return $this;
    }

    /**
     * The display name of the panel.
     *
     * Generated from protobuf field <code>string display_name = 3;</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * The display name of the panel.
     *
     * Generated from protobuf field <code>string display_name = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * The ordered position of the panel, if shown to the user with other panels.
     * If set, then
     * [total_panels][google.cloud.discoveryengine.v1.PanelInfo.total_panels] must
     * also be set.
     *
     * Generated from protobuf field <code>optional int32 panel_position = 4;</code>
     * @return int
     */
    public function getPanelPosition()
    {
        return isset($this->panel_position) ? $this->panel_position : 0;
    }

    public function hasPanelPosition()
    {
        return isset($this->panel_position);
    }

    public function clearPanelPosition()
    {
        unset($this->panel_position);
    }

    /**
     * The ordered position of the panel, if shown to the user with other panels.
     * If set, then
     * [total_panels][google.cloud.discoveryengine.v1.PanelInfo.total_panels] must
     * also be set.
     *
     * Generated from protobuf field <code>optional int32 panel_position = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setPanelPosition($var)
    {
        GPBUtil::checkInt32($var);
        $this->panel_position = $var;

        return $this;
    }

    /**
     * The total number of panels, including this one, shown to the user.
     * Must be set if
     * [panel_position][google.cloud.discoveryengine.v1.PanelInfo.panel_position]
     * is set.
     *
     * Generated from protobuf field <code>optional int32 total_panels = 5;</code>
     * @return int
     */
    public function getTotalPanels()
    {
        return isset($this->total_panels) ? $this->total_panels : 0;
    }

    public function hasTotalPanels()
    {
        return isset($this->total_panels);
    }

    public function clearTotalPanels()
    {
        unset($this->total_panels);
    }

    /**
     * The total number of panels, including this one, shown to the user.
     * Must be set if
     * [panel_position][google.cloud.discoveryengine.v1.PanelInfo.panel_position]
     * is set.
     *
     * Generated from protobuf field <code>optional int32 total_panels = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setTotalPanels($var)
    {
        GPBUtil::checkInt32($var);
        $this->total_panels = $var;

        return $this;
    }

}

