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

namespace Google\Apps\Script\Type\Gmail;

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

/**
 * A trigger that activates when user is composing an email.
 *
 * Generated from protobuf message <code>google.apps.script.type.gmail.ComposeTrigger</code>
 */
class ComposeTrigger extends \Google\Protobuf\Internal\Message
{
    /**
     * Defines the set of actions for compose time add-on. These are actions
     * that user can trigger on a compose time addon.
     *
     * Generated from protobuf field <code>repeated .google.apps.script.type.MenuItemExtensionPoint actions = 5;</code>
     */
    private $actions;
    /**
     * Define the level of data access when a compose time addon is triggered.
     *
     * Generated from protobuf field <code>.google.apps.script.type.gmail.ComposeTrigger.DraftAccess draft_access = 4;</code>
     */
    protected $draft_access = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Apps\Script\Type\MenuItemExtensionPoint>|\Google\Protobuf\Internal\RepeatedField $actions
     *           Defines the set of actions for compose time add-on. These are actions
     *           that user can trigger on a compose time addon.
     *     @type int $draft_access
     *           Define the level of data access when a compose time addon is triggered.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Apps\Script\Type\Gmail\GmailAddonManifest::initOnce();
        parent::__construct($data);
    }

    /**
     * Defines the set of actions for compose time add-on. These are actions
     * that user can trigger on a compose time addon.
     *
     * Generated from protobuf field <code>repeated .google.apps.script.type.MenuItemExtensionPoint actions = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getActions()
    {
        return $this->actions;
    }

    /**
     * Defines the set of actions for compose time add-on. These are actions
     * that user can trigger on a compose time addon.
     *
     * Generated from protobuf field <code>repeated .google.apps.script.type.MenuItemExtensionPoint actions = 5;</code>
     * @param array<\Google\Apps\Script\Type\MenuItemExtensionPoint>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setActions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Script\Type\MenuItemExtensionPoint::class);
        $this->actions = $arr;

        return $this;
    }

    /**
     * Define the level of data access when a compose time addon is triggered.
     *
     * Generated from protobuf field <code>.google.apps.script.type.gmail.ComposeTrigger.DraftAccess draft_access = 4;</code>
     * @return int
     */
    public function getDraftAccess()
    {
        return $this->draft_access;
    }

    /**
     * Define the level of data access when a compose time addon is triggered.
     *
     * Generated from protobuf field <code>.google.apps.script.type.gmail.ComposeTrigger.DraftAccess draft_access = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setDraftAccess($var)
    {
        GPBUtil::checkEnum($var, \Google\Apps\Script\Type\Gmail\ComposeTrigger\DraftAccess::class);
        $this->draft_access = $var;

        return $this;
    }

}

