<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: WAProto.proto

namespace PhpWA\Protocol\Proto;

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

/**
 * Generated from protobuf message <code>proto.TemplateButton</code>
 */
class TemplateButton extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional uint32 index = 4;</code>
     */
    protected $index = null;
    protected $button;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $index
     *     @type \PhpWA\Protocol\Proto\TemplateButton\QuickReplyButton $quickReplyButton
     *     @type \PhpWA\Protocol\Proto\TemplateButton\URLButton $urlButton
     *     @type \PhpWA\Protocol\Proto\TemplateButton\CallButton $callButton
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional uint32 index = 4;</code>
     * @return int
     */
    public function getIndex()
    {
        return isset($this->index) ? $this->index : 0;
    }

    public function hasIndex()
    {
        return isset($this->index);
    }

    public function clearIndex()
    {
        unset($this->index);
    }

    /**
     * Generated from protobuf field <code>optional uint32 index = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setIndex($var)
    {
        GPBUtil::checkUint32($var);
        $this->index = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.proto.TemplateButton.QuickReplyButton quickReplyButton = 1;</code>
     * @return \PhpWA\Protocol\Proto\TemplateButton\QuickReplyButton|null
     */
    public function getQuickReplyButton()
    {
        return $this->readOneof(1);
    }

    public function hasQuickReplyButton()
    {
        return $this->hasOneof(1);
    }

    /**
     * Generated from protobuf field <code>.proto.TemplateButton.QuickReplyButton quickReplyButton = 1;</code>
     * @param \PhpWA\Protocol\Proto\TemplateButton\QuickReplyButton $var
     * @return $this
     */
    public function setQuickReplyButton($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\TemplateButton\QuickReplyButton::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.proto.TemplateButton.URLButton urlButton = 2;</code>
     * @return \PhpWA\Protocol\Proto\TemplateButton\URLButton|null
     */
    public function getUrlButton()
    {
        return $this->readOneof(2);
    }

    public function hasUrlButton()
    {
        return $this->hasOneof(2);
    }

    /**
     * Generated from protobuf field <code>.proto.TemplateButton.URLButton urlButton = 2;</code>
     * @param \PhpWA\Protocol\Proto\TemplateButton\URLButton $var
     * @return $this
     */
    public function setUrlButton($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\TemplateButton\URLButton::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.proto.TemplateButton.CallButton callButton = 3;</code>
     * @return \PhpWA\Protocol\Proto\TemplateButton\CallButton|null
     */
    public function getCallButton()
    {
        return $this->readOneof(3);
    }

    public function hasCallButton()
    {
        return $this->hasOneof(3);
    }

    /**
     * Generated from protobuf field <code>.proto.TemplateButton.CallButton callButton = 3;</code>
     * @param \PhpWA\Protocol\Proto\TemplateButton\CallButton $var
     * @return $this
     */
    public function setCallButton($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\TemplateButton\CallButton::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getButton()
    {
        return $this->whichOneof("button");
    }

}

