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

namespace Google\Apps\Chat\V1\WidgetMarkup;

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

/**
 * A UI element contains a key (label) and a value (content). This
 * element can also contain some actions such as `onclick` button.
 *
 * Generated from protobuf message <code>google.chat.v1.WidgetMarkup.KeyValue</code>
 */
class KeyValue extends \Google\Protobuf\Internal\Message
{
    /**
     * The text of the top label. Formatted text supported. For more information
     * about formatting text, see
     * [Formatting text in Google Chat
     * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
     * and
     * [Formatting
     * text in Google Workspace
     * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
     *
     * Generated from protobuf field <code>string top_label = 3;</code>
     */
    protected $top_label = '';
    /**
     * The text of the content. Formatted text supported and always required.
     * For more information
     * about formatting text, see
     * [Formatting text in Google Chat
     * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
     * and
     * [Formatting
     * text in Google Workspace
     * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
     *
     * Generated from protobuf field <code>string content = 4;</code>
     */
    protected $content = '';
    /**
     * If the content should be multiline.
     *
     * Generated from protobuf field <code>bool content_multiline = 9;</code>
     */
    protected $content_multiline = false;
    /**
     * The text of the bottom label. Formatted text supported. For more
     * information about formatting text, see [Formatting text in Google Chat
     * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
     * and
     * [Formatting
     * text in Google Workspace
     * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
     *
     * Generated from protobuf field <code>string bottom_label = 5;</code>
     */
    protected $bottom_label = '';
    /**
     * The `onclick` action. Only the top label, bottom label, and content
     * region are clickable.
     *
     * Generated from protobuf field <code>.google.chat.v1.WidgetMarkup.OnClick on_click = 6;</code>
     */
    protected $on_click = null;
    protected $icons;
    protected $control;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $icon
     *           An enum value that's replaced by the Chat API with the
     *           corresponding icon image.
     *     @type string $icon_url
     *           The icon specified by a URL.
     *     @type string $top_label
     *           The text of the top label. Formatted text supported. For more information
     *           about formatting text, see
     *           [Formatting text in Google Chat
     *           apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
     *           and
     *           [Formatting
     *           text in Google Workspace
     *           Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
     *     @type string $content
     *           The text of the content. Formatted text supported and always required.
     *           For more information
     *           about formatting text, see
     *           [Formatting text in Google Chat
     *           apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
     *           and
     *           [Formatting
     *           text in Google Workspace
     *           Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
     *     @type bool $content_multiline
     *           If the content should be multiline.
     *     @type string $bottom_label
     *           The text of the bottom label. Formatted text supported. For more
     *           information about formatting text, see [Formatting text in Google Chat
     *           apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
     *           and
     *           [Formatting
     *           text in Google Workspace
     *           Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
     *     @type \Google\Apps\Chat\V1\WidgetMarkup\OnClick $on_click
     *           The `onclick` action. Only the top label, bottom label, and content
     *           region are clickable.
     *     @type \Google\Apps\Chat\V1\WidgetMarkup\Button $button
     *           A button that can be clicked to trigger an action.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Chat\V1\Widgets::initOnce();
        parent::__construct($data);
    }

    /**
     * An enum value that's replaced by the Chat API with the
     * corresponding icon image.
     *
     * Generated from protobuf field <code>.google.chat.v1.WidgetMarkup.Icon icon = 1;</code>
     * @return int
     */
    public function getIcon()
    {
        return $this->readOneof(1);
    }

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

    /**
     * An enum value that's replaced by the Chat API with the
     * corresponding icon image.
     *
     * Generated from protobuf field <code>.google.chat.v1.WidgetMarkup.Icon icon = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setIcon($var)
    {
        GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\WidgetMarkup\Icon::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The icon specified by a URL.
     *
     * Generated from protobuf field <code>string icon_url = 2;</code>
     * @return string
     */
    public function getIconUrl()
    {
        return $this->readOneof(2);
    }

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

    /**
     * The icon specified by a URL.
     *
     * Generated from protobuf field <code>string icon_url = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setIconUrl($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * The text of the top label. Formatted text supported. For more information
     * about formatting text, see
     * [Formatting text in Google Chat
     * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
     * and
     * [Formatting
     * text in Google Workspace
     * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
     *
     * Generated from protobuf field <code>string top_label = 3;</code>
     * @return string
     */
    public function getTopLabel()
    {
        return $this->top_label;
    }

    /**
     * The text of the top label. Formatted text supported. For more information
     * about formatting text, see
     * [Formatting text in Google Chat
     * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
     * and
     * [Formatting
     * text in Google Workspace
     * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
     *
     * Generated from protobuf field <code>string top_label = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setTopLabel($var)
    {
        GPBUtil::checkString($var, True);
        $this->top_label = $var;

        return $this;
    }

    /**
     * The text of the content. Formatted text supported and always required.
     * For more information
     * about formatting text, see
     * [Formatting text in Google Chat
     * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
     * and
     * [Formatting
     * text in Google Workspace
     * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
     *
     * Generated from protobuf field <code>string content = 4;</code>
     * @return string
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * The text of the content. Formatted text supported and always required.
     * For more information
     * about formatting text, see
     * [Formatting text in Google Chat
     * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
     * and
     * [Formatting
     * text in Google Workspace
     * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
     *
     * Generated from protobuf field <code>string content = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setContent($var)
    {
        GPBUtil::checkString($var, True);
        $this->content = $var;

        return $this;
    }

    /**
     * If the content should be multiline.
     *
     * Generated from protobuf field <code>bool content_multiline = 9;</code>
     * @return bool
     */
    public function getContentMultiline()
    {
        return $this->content_multiline;
    }

    /**
     * If the content should be multiline.
     *
     * Generated from protobuf field <code>bool content_multiline = 9;</code>
     * @param bool $var
     * @return $this
     */
    public function setContentMultiline($var)
    {
        GPBUtil::checkBool($var);
        $this->content_multiline = $var;

        return $this;
    }

    /**
     * The text of the bottom label. Formatted text supported. For more
     * information about formatting text, see [Formatting text in Google Chat
     * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
     * and
     * [Formatting
     * text in Google Workspace
     * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
     *
     * Generated from protobuf field <code>string bottom_label = 5;</code>
     * @return string
     */
    public function getBottomLabel()
    {
        return $this->bottom_label;
    }

    /**
     * The text of the bottom label. Formatted text supported. For more
     * information about formatting text, see [Formatting text in Google Chat
     * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
     * and
     * [Formatting
     * text in Google Workspace
     * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
     *
     * Generated from protobuf field <code>string bottom_label = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setBottomLabel($var)
    {
        GPBUtil::checkString($var, True);
        $this->bottom_label = $var;

        return $this;
    }

    /**
     * The `onclick` action. Only the top label, bottom label, and content
     * region are clickable.
     *
     * Generated from protobuf field <code>.google.chat.v1.WidgetMarkup.OnClick on_click = 6;</code>
     * @return \Google\Apps\Chat\V1\WidgetMarkup\OnClick|null
     */
    public function getOnClick()
    {
        return $this->on_click;
    }

    public function hasOnClick()
    {
        return isset($this->on_click);
    }

    public function clearOnClick()
    {
        unset($this->on_click);
    }

    /**
     * The `onclick` action. Only the top label, bottom label, and content
     * region are clickable.
     *
     * Generated from protobuf field <code>.google.chat.v1.WidgetMarkup.OnClick on_click = 6;</code>
     * @param \Google\Apps\Chat\V1\WidgetMarkup\OnClick $var
     * @return $this
     */
    public function setOnClick($var)
    {
        GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\OnClick::class);
        $this->on_click = $var;

        return $this;
    }

    /**
     * A button that can be clicked to trigger an action.
     *
     * Generated from protobuf field <code>.google.chat.v1.WidgetMarkup.Button button = 7;</code>
     * @return \Google\Apps\Chat\V1\WidgetMarkup\Button|null
     */
    public function getButton()
    {
        return $this->readOneof(7);
    }

    public function hasButton()
    {
        return $this->hasOneof(7);
    }

    /**
     * A button that can be clicked to trigger an action.
     *
     * Generated from protobuf field <code>.google.chat.v1.WidgetMarkup.Button button = 7;</code>
     * @param \Google\Apps\Chat\V1\WidgetMarkup\Button $var
     * @return $this
     */
    public function setButton($var)
    {
        GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\Button::class);
        $this->writeOneof(7, $var);

        return $this;
    }

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

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

}


