<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/apps/script/type/extension_point.proto

namespace Google\Apps\Script\Type;

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

/**
 * Format for declaring a universal action menu item extension point.
 *
 * Generated from protobuf message <code>google.apps.script.type.UniversalActionExtensionPoint</code>
 */
class UniversalActionExtensionPoint extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. User-visible text describing the action taken by activating this
     * extension point, for example, "Add a new contact".
     *
     * Generated from protobuf field <code>string label = 1;</code>
     */
    protected $label = '';
    protected $action_type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $label
     *           Required. User-visible text describing the action taken by activating this
     *           extension point, for example, "Add a new contact".
     *     @type string $open_link
     *           URL to be opened by the UniversalAction.
     *     @type string $run_function
     *           Endpoint to be run by the UniversalAction.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Apps\Script\Type\ExtensionPoint::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. User-visible text describing the action taken by activating this
     * extension point, for example, "Add a new contact".
     *
     * Generated from protobuf field <code>string label = 1;</code>
     * @return string
     */
    public function getLabel()
    {
        return $this->label;
    }

    /**
     * Required. User-visible text describing the action taken by activating this
     * extension point, for example, "Add a new contact".
     *
     * Generated from protobuf field <code>string label = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setLabel($var)
    {
        GPBUtil::checkString($var, True);
        $this->label = $var;

        return $this;
    }

    /**
     * URL to be opened by the UniversalAction.
     *
     * Generated from protobuf field <code>string open_link = 2;</code>
     * @return string
     */
    public function getOpenLink()
    {
        return $this->readOneof(2);
    }

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

    /**
     * URL to be opened by the UniversalAction.
     *
     * Generated from protobuf field <code>string open_link = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setOpenLink($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Endpoint to be run by the UniversalAction.
     *
     * Generated from protobuf field <code>string run_function = 3;</code>
     * @return string
     */
    public function getRunFunction()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Endpoint to be run by the UniversalAction.
     *
     * Generated from protobuf field <code>string run_function = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setRunFunction($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

