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

namespace Google\Apps\Script\Type;

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

/**
 * Add-on configuration that is shared across all add-on host applications.
 *
 * Generated from protobuf message <code>google.apps.script.type.CommonAddOnManifest</code>
 */
class CommonAddOnManifest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The display name of the add-on.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * Required. The URL for the logo image shown in the add-on toolbar.
     *
     * Generated from protobuf field <code>string logo_url = 2;</code>
     */
    protected $logo_url = '';
    /**
     * Common layout properties for the add-on cards.
     *
     * Generated from protobuf field <code>.google.apps.script.type.LayoutProperties layout_properties = 3;</code>
     */
    protected $layout_properties = null;
    /**
     * The widgets used in the add-on. If this field is not specified,
     * it indicates that default set is used.
     *
     * Generated from protobuf field <code>.google.apps.script.type.AddOnWidgetSet add_on_widget_set = 4;</code>
     */
    protected $add_on_widget_set = null;
    /**
     * Whether to pass locale information from host app.
     *
     * Generated from protobuf field <code>bool use_locale_from_app = 5;</code>
     */
    protected $use_locale_from_app = false;
    /**
     * Defines an endpoint that will be executed in any context, in
     * any host. Any cards generated by this function will always be available to
     * the user, but may be eclipsed by contextual content when this add-on
     * declares more targeted triggers.
     *
     * Generated from protobuf field <code>.google.apps.script.type.HomepageExtensionPoint homepage_trigger = 6;</code>
     */
    protected $homepage_trigger = null;
    /**
     * Defines a list of extension points in the universal action menu which
     * serves as a setting menu for the add-on. The extension point can be
     * link URL to open or an endpoint to execute as a form
     * submission.
     *
     * Generated from protobuf field <code>repeated .google.apps.script.type.UniversalActionExtensionPoint universal_actions = 7;</code>
     */
    private $universal_actions;
    /**
     * An OpenLink action
     * can only use a URL with an HTTPS, MAILTO or TEL scheme.  For HTTPS links,
     * the URL must also
     * [match](/gmail/add-ons/concepts/manifests#whitelisting_urls) one of the
     * prefixes specified in this whitelist. If the prefix omits the scheme, HTTPS
     * is assumed.  Notice that HTTP links are automatically rewritten to HTTPS
     * links.
     *
     * Generated from protobuf field <code>.google.protobuf.ListValue open_link_url_prefixes = 8;</code>
     */
    protected $open_link_url_prefixes = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. The display name of the add-on.
     *     @type string $logo_url
     *           Required. The URL for the logo image shown in the add-on toolbar.
     *     @type \Google\Apps\Script\Type\LayoutProperties $layout_properties
     *           Common layout properties for the add-on cards.
     *     @type \Google\Apps\Script\Type\AddOnWidgetSet $add_on_widget_set
     *           The widgets used in the add-on. If this field is not specified,
     *           it indicates that default set is used.
     *     @type bool $use_locale_from_app
     *           Whether to pass locale information from host app.
     *     @type \Google\Apps\Script\Type\HomepageExtensionPoint $homepage_trigger
     *           Defines an endpoint that will be executed in any context, in
     *           any host. Any cards generated by this function will always be available to
     *           the user, but may be eclipsed by contextual content when this add-on
     *           declares more targeted triggers.
     *     @type array<\Google\Apps\Script\Type\UniversalActionExtensionPoint>|\Google\Protobuf\Internal\RepeatedField $universal_actions
     *           Defines a list of extension points in the universal action menu which
     *           serves as a setting menu for the add-on. The extension point can be
     *           link URL to open or an endpoint to execute as a form
     *           submission.
     *     @type \Google\Protobuf\ListValue $open_link_url_prefixes
     *           An OpenLink action
     *           can only use a URL with an HTTPS, MAILTO or TEL scheme.  For HTTPS links,
     *           the URL must also
     *           [match](/gmail/add-ons/concepts/manifests#whitelisting_urls) one of the
     *           prefixes specified in this whitelist. If the prefix omits the scheme, HTTPS
     *           is assumed.  Notice that HTTP links are automatically rewritten to HTTPS
     *           links.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Apps\Script\Type\ScriptManifest::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The display name of the add-on.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. The display name of the add-on.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Required. The URL for the logo image shown in the add-on toolbar.
     *
     * Generated from protobuf field <code>string logo_url = 2;</code>
     * @return string
     */
    public function getLogoUrl()
    {
        return $this->logo_url;
    }

    /**
     * Required. The URL for the logo image shown in the add-on toolbar.
     *
     * Generated from protobuf field <code>string logo_url = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setLogoUrl($var)
    {
        GPBUtil::checkString($var, True);
        $this->logo_url = $var;

        return $this;
    }

    /**
     * Common layout properties for the add-on cards.
     *
     * Generated from protobuf field <code>.google.apps.script.type.LayoutProperties layout_properties = 3;</code>
     * @return \Google\Apps\Script\Type\LayoutProperties|null
     */
    public function getLayoutProperties()
    {
        return $this->layout_properties;
    }

    public function hasLayoutProperties()
    {
        return isset($this->layout_properties);
    }

    public function clearLayoutProperties()
    {
        unset($this->layout_properties);
    }

    /**
     * Common layout properties for the add-on cards.
     *
     * Generated from protobuf field <code>.google.apps.script.type.LayoutProperties layout_properties = 3;</code>
     * @param \Google\Apps\Script\Type\LayoutProperties $var
     * @return $this
     */
    public function setLayoutProperties($var)
    {
        GPBUtil::checkMessage($var, \Google\Apps\Script\Type\LayoutProperties::class);
        $this->layout_properties = $var;

        return $this;
    }

    /**
     * The widgets used in the add-on. If this field is not specified,
     * it indicates that default set is used.
     *
     * Generated from protobuf field <code>.google.apps.script.type.AddOnWidgetSet add_on_widget_set = 4;</code>
     * @return \Google\Apps\Script\Type\AddOnWidgetSet|null
     */
    public function getAddOnWidgetSet()
    {
        return $this->add_on_widget_set;
    }

    public function hasAddOnWidgetSet()
    {
        return isset($this->add_on_widget_set);
    }

    public function clearAddOnWidgetSet()
    {
        unset($this->add_on_widget_set);
    }

    /**
     * The widgets used in the add-on. If this field is not specified,
     * it indicates that default set is used.
     *
     * Generated from protobuf field <code>.google.apps.script.type.AddOnWidgetSet add_on_widget_set = 4;</code>
     * @param \Google\Apps\Script\Type\AddOnWidgetSet $var
     * @return $this
     */
    public function setAddOnWidgetSet($var)
    {
        GPBUtil::checkMessage($var, \Google\Apps\Script\Type\AddOnWidgetSet::class);
        $this->add_on_widget_set = $var;

        return $this;
    }

    /**
     * Whether to pass locale information from host app.
     *
     * Generated from protobuf field <code>bool use_locale_from_app = 5;</code>
     * @return bool
     */
    public function getUseLocaleFromApp()
    {
        return $this->use_locale_from_app;
    }

    /**
     * Whether to pass locale information from host app.
     *
     * Generated from protobuf field <code>bool use_locale_from_app = 5;</code>
     * @param bool $var
     * @return $this
     */
    public function setUseLocaleFromApp($var)
    {
        GPBUtil::checkBool($var);
        $this->use_locale_from_app = $var;

        return $this;
    }

    /**
     * Defines an endpoint that will be executed in any context, in
     * any host. Any cards generated by this function will always be available to
     * the user, but may be eclipsed by contextual content when this add-on
     * declares more targeted triggers.
     *
     * Generated from protobuf field <code>.google.apps.script.type.HomepageExtensionPoint homepage_trigger = 6;</code>
     * @return \Google\Apps\Script\Type\HomepageExtensionPoint|null
     */
    public function getHomepageTrigger()
    {
        return $this->homepage_trigger;
    }

    public function hasHomepageTrigger()
    {
        return isset($this->homepage_trigger);
    }

    public function clearHomepageTrigger()
    {
        unset($this->homepage_trigger);
    }

    /**
     * Defines an endpoint that will be executed in any context, in
     * any host. Any cards generated by this function will always be available to
     * the user, but may be eclipsed by contextual content when this add-on
     * declares more targeted triggers.
     *
     * Generated from protobuf field <code>.google.apps.script.type.HomepageExtensionPoint homepage_trigger = 6;</code>
     * @param \Google\Apps\Script\Type\HomepageExtensionPoint $var
     * @return $this
     */
    public function setHomepageTrigger($var)
    {
        GPBUtil::checkMessage($var, \Google\Apps\Script\Type\HomepageExtensionPoint::class);
        $this->homepage_trigger = $var;

        return $this;
    }

    /**
     * Defines a list of extension points in the universal action menu which
     * serves as a setting menu for the add-on. The extension point can be
     * link URL to open or an endpoint to execute as a form
     * submission.
     *
     * Generated from protobuf field <code>repeated .google.apps.script.type.UniversalActionExtensionPoint universal_actions = 7;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getUniversalActions()
    {
        return $this->universal_actions;
    }

    /**
     * Defines a list of extension points in the universal action menu which
     * serves as a setting menu for the add-on. The extension point can be
     * link URL to open or an endpoint to execute as a form
     * submission.
     *
     * Generated from protobuf field <code>repeated .google.apps.script.type.UniversalActionExtensionPoint universal_actions = 7;</code>
     * @param array<\Google\Apps\Script\Type\UniversalActionExtensionPoint>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setUniversalActions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Script\Type\UniversalActionExtensionPoint::class);
        $this->universal_actions = $arr;

        return $this;
    }

    /**
     * An OpenLink action
     * can only use a URL with an HTTPS, MAILTO or TEL scheme.  For HTTPS links,
     * the URL must also
     * [match](/gmail/add-ons/concepts/manifests#whitelisting_urls) one of the
     * prefixes specified in this whitelist. If the prefix omits the scheme, HTTPS
     * is assumed.  Notice that HTTP links are automatically rewritten to HTTPS
     * links.
     *
     * Generated from protobuf field <code>.google.protobuf.ListValue open_link_url_prefixes = 8;</code>
     * @return \Google\Protobuf\ListValue|null
     */
    public function getOpenLinkUrlPrefixes()
    {
        return $this->open_link_url_prefixes;
    }

    public function hasOpenLinkUrlPrefixes()
    {
        return isset($this->open_link_url_prefixes);
    }

    public function clearOpenLinkUrlPrefixes()
    {
        unset($this->open_link_url_prefixes);
    }

    /**
     * An OpenLink action
     * can only use a URL with an HTTPS, MAILTO or TEL scheme.  For HTTPS links,
     * the URL must also
     * [match](/gmail/add-ons/concepts/manifests#whitelisting_urls) one of the
     * prefixes specified in this whitelist. If the prefix omits the scheme, HTTPS
     * is assumed.  Notice that HTTP links are automatically rewritten to HTTPS
     * links.
     *
     * Generated from protobuf field <code>.google.protobuf.ListValue open_link_url_prefixes = 8;</code>
     * @param \Google\Protobuf\ListValue $var
     * @return $this
     */
    public function setOpenLinkUrlPrefixes($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\ListValue::class);
        $this->open_link_url_prefixes = $var;

        return $this;
    }

}

