<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/v2/intent.proto

namespace Google\Cloud\Dialogflow\V2\Intent\Message\Card;

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

/**
 * Optional. Contains information about a button.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.Intent.Message.Card.Button</code>
 */
class Button extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The text to show on the button.
     *
     * Generated from protobuf field <code>string text = 1;</code>
     */
    private $text = '';
    /**
     * Optional. The text to send back to the Dialogflow API or a URI to
     * open.
     *
     * Generated from protobuf field <code>string postback = 2;</code>
     */
    private $postback = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $text
     *           Optional. The text to show on the button.
     *     @type string $postback
     *           Optional. The text to send back to the Dialogflow API or a URI to
     *           open.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The text to show on the button.
     *
     * Generated from protobuf field <code>string text = 1;</code>
     * @return string
     */
    public function getText()
    {
        return $this->text;
    }

    /**
     * Optional. The text to show on the button.
     *
     * Generated from protobuf field <code>string text = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setText($var)
    {
        GPBUtil::checkString($var, True);
        $this->text = $var;

        return $this;
    }

    /**
     * Optional. The text to send back to the Dialogflow API or a URI to
     * open.
     *
     * Generated from protobuf field <code>string postback = 2;</code>
     * @return string
     */
    public function getPostback()
    {
        return $this->postback;
    }

    /**
     * Optional. The text to send back to the Dialogflow API or a URI to
     * open.
     *
     * Generated from protobuf field <code>string postback = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setPostback($var)
    {
        GPBUtil::checkString($var, True);
        $this->postback = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Button::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Card_Button::class);

