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

namespace Google\Apps\Chat\V1;

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

/**
 * Parameters that a Chat app can use to configure how its response is posted.
 *
 * Generated from protobuf message <code>google.chat.v1.ActionResponse</code>
 */
class ActionResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Input only. The type of Chat app response.
     *
     * Generated from protobuf field <code>.google.chat.v1.ActionResponse.ResponseType type = 1 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     */
    protected $type = 0;
    /**
     * Input only. URL for users to authenticate or configure. (Only for
     * `REQUEST_CONFIG` response types.)
     *
     * Generated from protobuf field <code>string url = 2 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     */
    protected $url = '';
    /**
     * Input only. A response to an interaction event related to a
     * [dialog](https://developers.google.com/workspace/chat/dialogs). Must be
     * accompanied by `ResponseType.Dialog`.
     *
     * Generated from protobuf field <code>.google.chat.v1.DialogAction dialog_action = 3 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     */
    protected $dialog_action = null;
    /**
     * Input only. The response of the updated widget.
     *
     * Generated from protobuf field <code>.google.chat.v1.ActionResponse.UpdatedWidget updated_widget = 4 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     */
    protected $updated_widget = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $type
     *           Input only. The type of Chat app response.
     *     @type string $url
     *           Input only. URL for users to authenticate or configure. (Only for
     *           `REQUEST_CONFIG` response types.)
     *     @type \Google\Apps\Chat\V1\DialogAction $dialog_action
     *           Input only. A response to an interaction event related to a
     *           [dialog](https://developers.google.com/workspace/chat/dialogs). Must be
     *           accompanied by `ResponseType.Dialog`.
     *     @type \Google\Apps\Chat\V1\ActionResponse\UpdatedWidget $updated_widget
     *           Input only. The response of the updated widget.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Chat\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Input only. The type of Chat app response.
     *
     * Generated from protobuf field <code>.google.chat.v1.ActionResponse.ResponseType type = 1 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Input only. The type of Chat app response.
     *
     * Generated from protobuf field <code>.google.chat.v1.ActionResponse.ResponseType type = 1 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\ActionResponse\ResponseType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Input only. URL for users to authenticate or configure. (Only for
     * `REQUEST_CONFIG` response types.)
     *
     * Generated from protobuf field <code>string url = 2 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @return string
     */
    public function getUrl()
    {
        return $this->url;
    }

    /**
     * Input only. URL for users to authenticate or configure. (Only for
     * `REQUEST_CONFIG` response types.)
     *
     * Generated from protobuf field <code>string url = 2 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setUrl($var)
    {
        GPBUtil::checkString($var, True);
        $this->url = $var;

        return $this;
    }

    /**
     * Input only. A response to an interaction event related to a
     * [dialog](https://developers.google.com/workspace/chat/dialogs). Must be
     * accompanied by `ResponseType.Dialog`.
     *
     * Generated from protobuf field <code>.google.chat.v1.DialogAction dialog_action = 3 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @return \Google\Apps\Chat\V1\DialogAction|null
     */
    public function getDialogAction()
    {
        return $this->dialog_action;
    }

    public function hasDialogAction()
    {
        return isset($this->dialog_action);
    }

    public function clearDialogAction()
    {
        unset($this->dialog_action);
    }

    /**
     * Input only. A response to an interaction event related to a
     * [dialog](https://developers.google.com/workspace/chat/dialogs). Must be
     * accompanied by `ResponseType.Dialog`.
     *
     * Generated from protobuf field <code>.google.chat.v1.DialogAction dialog_action = 3 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @param \Google\Apps\Chat\V1\DialogAction $var
     * @return $this
     */
    public function setDialogAction($var)
    {
        GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\DialogAction::class);
        $this->dialog_action = $var;

        return $this;
    }

    /**
     * Input only. The response of the updated widget.
     *
     * Generated from protobuf field <code>.google.chat.v1.ActionResponse.UpdatedWidget updated_widget = 4 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @return \Google\Apps\Chat\V1\ActionResponse\UpdatedWidget|null
     */
    public function getUpdatedWidget()
    {
        return $this->updated_widget;
    }

    public function hasUpdatedWidget()
    {
        return isset($this->updated_widget);
    }

    public function clearUpdatedWidget()
    {
        unset($this->updated_widget);
    }

    /**
     * Input only. The response of the updated widget.
     *
     * Generated from protobuf field <code>.google.chat.v1.ActionResponse.UpdatedWidget updated_widget = 4 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @param \Google\Apps\Chat\V1\ActionResponse\UpdatedWidget $var
     * @return $this
     */
    public function setUpdatedWidget($var)
    {
        GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\ActionResponse\UpdatedWidget::class);
        $this->updated_widget = $var;

        return $this;
    }

}

