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

namespace Google\Apps\Script\Type\Calendar;

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

/**
 * Calendar add-on manifest.
 *
 * Generated from protobuf message <code>google.apps.script.type.calendar.CalendarAddOnManifest</code>
 */
class CalendarAddOnManifest extends \Google\Protobuf\Internal\Message
{
    /**
     * Defines an endpoint that will be executed contexts that don't
     * match a declared contextual trigger. 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.
     * If present, this overrides the configuration from
     * `addOns.common.homepageTrigger`.
     *
     * Generated from protobuf field <code>.google.apps.script.type.HomepageExtensionPoint homepage_trigger = 6;</code>
     */
    protected $homepage_trigger = null;
    /**
     * Defines conference solutions provided by this add-on.
     *
     * Generated from protobuf field <code>repeated .google.apps.script.type.calendar.ConferenceSolution conference_solution = 3;</code>
     */
    private $conference_solution;
    /**
     * An endpoint to execute that creates a URL to the add-on's settings page.
     *
     * Generated from protobuf field <code>string create_settings_url_function = 5;</code>
     */
    protected $create_settings_url_function = '';
    /**
     * An endpoint to trigger when an event is opened (viewed/edited).
     *
     * Generated from protobuf field <code>.google.apps.script.type.calendar.CalendarExtensionPoint event_open_trigger = 10;</code>
     */
    protected $event_open_trigger = null;
    /**
     * An endpoint to trigger when the open event is updated.
     *
     * Generated from protobuf field <code>.google.apps.script.type.calendar.CalendarExtensionPoint event_update_trigger = 11;</code>
     */
    protected $event_update_trigger = null;
    /**
     * Define the level of data access when an event addon is triggered.
     *
     * Generated from protobuf field <code>.google.apps.script.type.calendar.CalendarAddOnManifest.EventAccess current_event_access = 12;</code>
     */
    protected $current_event_access = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Apps\Script\Type\HomepageExtensionPoint $homepage_trigger
     *           Defines an endpoint that will be executed contexts that don't
     *           match a declared contextual trigger. 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.
     *           If present, this overrides the configuration from
     *           `addOns.common.homepageTrigger`.
     *     @type array<\Google\Apps\Script\Type\Calendar\ConferenceSolution>|\Google\Protobuf\Internal\RepeatedField $conference_solution
     *           Defines conference solutions provided by this add-on.
     *     @type string $create_settings_url_function
     *           An endpoint to execute that creates a URL to the add-on's settings page.
     *     @type \Google\Apps\Script\Type\Calendar\CalendarExtensionPoint $event_open_trigger
     *           An endpoint to trigger when an event is opened (viewed/edited).
     *     @type \Google\Apps\Script\Type\Calendar\CalendarExtensionPoint $event_update_trigger
     *           An endpoint to trigger when the open event is updated.
     *     @type int $current_event_access
     *           Define the level of data access when an event addon is triggered.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Apps\Script\Type\Calendar\CalendarAddonManifest::initOnce();
        parent::__construct($data);
    }

    /**
     * Defines an endpoint that will be executed contexts that don't
     * match a declared contextual trigger. 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.
     * If present, this overrides the configuration from
     * `addOns.common.homepageTrigger`.
     *
     * 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 contexts that don't
     * match a declared contextual trigger. 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.
     * If present, this overrides the configuration from
     * `addOns.common.homepageTrigger`.
     *
     * 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 conference solutions provided by this add-on.
     *
     * Generated from protobuf field <code>repeated .google.apps.script.type.calendar.ConferenceSolution conference_solution = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getConferenceSolution()
    {
        return $this->conference_solution;
    }

    /**
     * Defines conference solutions provided by this add-on.
     *
     * Generated from protobuf field <code>repeated .google.apps.script.type.calendar.ConferenceSolution conference_solution = 3;</code>
     * @param array<\Google\Apps\Script\Type\Calendar\ConferenceSolution>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setConferenceSolution($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Script\Type\Calendar\ConferenceSolution::class);
        $this->conference_solution = $arr;

        return $this;
    }

    /**
     * An endpoint to execute that creates a URL to the add-on's settings page.
     *
     * Generated from protobuf field <code>string create_settings_url_function = 5;</code>
     * @return string
     */
    public function getCreateSettingsUrlFunction()
    {
        return $this->create_settings_url_function;
    }

    /**
     * An endpoint to execute that creates a URL to the add-on's settings page.
     *
     * Generated from protobuf field <code>string create_settings_url_function = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setCreateSettingsUrlFunction($var)
    {
        GPBUtil::checkString($var, True);
        $this->create_settings_url_function = $var;

        return $this;
    }

    /**
     * An endpoint to trigger when an event is opened (viewed/edited).
     *
     * Generated from protobuf field <code>.google.apps.script.type.calendar.CalendarExtensionPoint event_open_trigger = 10;</code>
     * @return \Google\Apps\Script\Type\Calendar\CalendarExtensionPoint|null
     */
    public function getEventOpenTrigger()
    {
        return $this->event_open_trigger;
    }

    public function hasEventOpenTrigger()
    {
        return isset($this->event_open_trigger);
    }

    public function clearEventOpenTrigger()
    {
        unset($this->event_open_trigger);
    }

    /**
     * An endpoint to trigger when an event is opened (viewed/edited).
     *
     * Generated from protobuf field <code>.google.apps.script.type.calendar.CalendarExtensionPoint event_open_trigger = 10;</code>
     * @param \Google\Apps\Script\Type\Calendar\CalendarExtensionPoint $var
     * @return $this
     */
    public function setEventOpenTrigger($var)
    {
        GPBUtil::checkMessage($var, \Google\Apps\Script\Type\Calendar\CalendarExtensionPoint::class);
        $this->event_open_trigger = $var;

        return $this;
    }

    /**
     * An endpoint to trigger when the open event is updated.
     *
     * Generated from protobuf field <code>.google.apps.script.type.calendar.CalendarExtensionPoint event_update_trigger = 11;</code>
     * @return \Google\Apps\Script\Type\Calendar\CalendarExtensionPoint|null
     */
    public function getEventUpdateTrigger()
    {
        return $this->event_update_trigger;
    }

    public function hasEventUpdateTrigger()
    {
        return isset($this->event_update_trigger);
    }

    public function clearEventUpdateTrigger()
    {
        unset($this->event_update_trigger);
    }

    /**
     * An endpoint to trigger when the open event is updated.
     *
     * Generated from protobuf field <code>.google.apps.script.type.calendar.CalendarExtensionPoint event_update_trigger = 11;</code>
     * @param \Google\Apps\Script\Type\Calendar\CalendarExtensionPoint $var
     * @return $this
     */
    public function setEventUpdateTrigger($var)
    {
        GPBUtil::checkMessage($var, \Google\Apps\Script\Type\Calendar\CalendarExtensionPoint::class);
        $this->event_update_trigger = $var;

        return $this;
    }

    /**
     * Define the level of data access when an event addon is triggered.
     *
     * Generated from protobuf field <code>.google.apps.script.type.calendar.CalendarAddOnManifest.EventAccess current_event_access = 12;</code>
     * @return int
     */
    public function getCurrentEventAccess()
    {
        return $this->current_event_access;
    }

    /**
     * Define the level of data access when an event addon is triggered.
     *
     * Generated from protobuf field <code>.google.apps.script.type.calendar.CalendarAddOnManifest.EventAccess current_event_access = 12;</code>
     * @param int $var
     * @return $this
     */
    public function setCurrentEventAccess($var)
    {
        GPBUtil::checkEnum($var, \Google\Apps\Script\Type\Calendar\CalendarAddOnManifest\EventAccess::class);
        $this->current_event_access = $var;

        return $this;
    }

}

