As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

Types for Google Apps Script Type Gmail API

class google.apps.script.type.gmail.types.ComposeTrigger(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A trigger that activates when user is composing an email.

actions

Defines the set of actions for compose time add-on. These are actions that user can trigger on a compose time addon.

Type

MutableSequence[google.apps.script.type.types.MenuItemExtensionPoint]

draft_access

Define the level of data access when a compose time addon is triggered.

Type

google.apps.script.type.gmail.types.ComposeTrigger.DraftAccess

class DraftAccess(value)[source]

Bases: proto.enums.Enum

An enum defining the level of data access this compose trigger requires.

Values:
UNSPECIFIED (0):

Default value when nothing is set for DraftAccess.

NONE (1):

NONE means compose trigger won’t be able to access any data of the draft when a compose addon is triggered.

METADATA (2):

METADATA gives compose trigger the permission to access the metadata of the draft when a compose addon is triggered. This includes the audience list (To/cc list) of a draft message.

class google.apps.script.type.gmail.types.ContextualTrigger(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Defines a trigger that fires when the open email meets a specific criteria. When the trigger fires, it executes a specific endpoint, usually in order to create new cards and update the UI.

unconditional

UnconditionalTriggers are executed when any mail message is opened.

This field is a member of oneof trigger.

Type

google.apps.script.type.gmail.types.UnconditionalTrigger

on_trigger_function

Required. The name of the endpoint to call when a message matches the trigger.

Type

str

class google.apps.script.type.gmail.types.GmailAddOnManifest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Properties customizing the appearance and execution of a Gmail add-on.

homepage_trigger

Defines an endpoint that will be executed in 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

google.apps.script.type.types.HomepageExtensionPoint

contextual_triggers

Defines the set of conditions that trigger the add-on.

Type

MutableSequence[google.apps.script.type.gmail.types.ContextualTrigger]

universal_actions

Defines set of universal actions for the add-on. The user triggers universal actions from the add-on toolbar menu.

Type

MutableSequence[google.apps.script.type.gmail.types.UniversalAction]

compose_trigger

Defines the compose time trigger for a compose time add-on. This is the trigger that causes an add-on to take action when the user is composing an email. All compose time addons are required to have the gmail.addons.current.action.compose scope even though it might not edit the draft.

Type

google.apps.script.type.gmail.types.ComposeTrigger

authorization_check_function

The name of an endpoint that verifies that the add-on has all the required third-party authorizations, by probing the third-party APIs. If the probe fails, the function should throw an exception to initiate the authorization flow. This function is called before each invocation of the add-on, in order to ensure a smooth user experience.

Type

str

class google.apps.script.type.gmail.types.UnconditionalTrigger(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A trigger that fires when any email message is opened.

class google.apps.script.type.gmail.types.UniversalAction(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An action that is always available in the add-on toolbar menu regardless of message context.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

text

Required. User-visible text describing the action, for example, “Add a new contact.”.

Type

str

A link that is opened by Gmail when the user triggers the action.

This field is a member of oneof action_type.

Type

str

run_function

An endpoint that is called when the user triggers the action. See the universal actions guide for details.

This field is a member of oneof action_type.

Type

str