Package google.apps.script.type

Index

AddOnWidgetSet

The widget subset used by an add-on.

Fields
usedWidgets[]

WidgetType

The list of widgets used in an add-on.

WidgetType

The widget type. WIDGET_TYPE_UNSPECIFIED is the basic widget set.

Enums
WIDGET_TYPE_UNSPECIFIED The default widget set.
DATE_PICKER The date picker.
STYLED_BUTTONS Styled buttons include filled buttons and deactivated buttons.
PERSISTENT_FORMS Persistent forms allow persisting form values during actions.
UPDATE_SUBJECT_AND_RECIPIENTS Update the subject and recipients of a draft.
GRID_WIDGET The grid widget.
ADDON_COMPOSE_UI_ACTION A Gmail add-on action that applies to the add-on compose UI.

CommonAddOnManifest

Add-on configuration that is shared across all add-on host applications.

Fields
name

string

Required. The display name of the add-on.

logoUrl

string

Required. The URL for the logo image shown in the add-on toolbar.

layoutProperties

LayoutProperties

Common layout properties for the add-on cards.

addOnWidgetSet

AddOnWidgetSet

The widgets used in the add-on. If this field is not specified, the default set is used.

useLocaleFromApp

bool

Whether to pass locale information from host app.

homepageTrigger

HomepageExtensionPoint

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 might be eclipsed by contextual content when this add-on declares more targeted triggers.

universalActions[]

UniversalActionExtensionPoint

Defines a list of extension points in the universal action menu which serves as a settings menu for the add-on. The extension point can be a link URL to open or an endpoint to execute as a form submission.

openLinkUrlPrefixes

ListValue

An OpenLink action can only use a URL with an HTTPS, MAILTO or TEL scheme. For HTTPS links, the URL must also match one of the prefixes specified in the allowlist. If the prefix omits the scheme, HTTPS is assumed. HTTP links are automatically rewritten to HTTPS links.

CreateActionExtensionPoint

The configuration for a trigger that fires when a user invokes the resource creation workflow in a Google Workspace application. For more information, see Create third-party resources from the @ menu.

Fields
id

string

Required. The unique ID to differentiate this extension point. The ID can have up to 64 characters and should be in the format of [a-zA-Z0-9-]+.

labelText

string

Required. The text that displays alongside an icon for the resource creation entry point, such as Create support case. This text is static and displays before users execute the add-on.

localizedLabelText

map<string, string>

Optional. A map of labelText to localize into other languages. Format the language in ISO 639 and the country/region in ISO 3166, separated by a hyphen -. For example, en-US.

If a user's locale is present in the map's keys, the user sees the localized version of the labelText.

runFunction

string

Required. Endpoint to execute when a resource creation workflow is triggered to create a link.

logoUrl

string

Optional. The icon that displays for the resource creation entry point. If omitted, the menu uses your add-on's toolbar icon, logoUrl.

HomepageExtensionPoint

Common format for declaring an add-on's homepage view.

Fields
runFunction

string

Required. The endpoint to execute when this extension point is activated.

enabled

BoolValue

Optional. If set to false, deactivates the homepage view in this context.

Defaults to true if unset.

If an add-on's custom homepage view is disabled, a generic overview card is provided for users instead.

HttpAuthorizationHeader

Authorization header sent in add-on HTTP requests.

Enums
HTTP_AUTHORIZATION_HEADER_UNSPECIFIED Default value, equivalent to SYSTEM_ID_TOKEN.
SYSTEM_ID_TOKEN Send an ID token for the project-specific Google Workspace Add-on's system service account (default).
USER_ID_TOKEN Send an ID token for the end user.
NONE Do not send an Authentication header.

HttpOptions

Options for sending requests to add-on HTTP endpoints.

Fields
authorizationHeader

HttpAuthorizationHeader

Configuration for the token sent in the HTTP Authorization header.

LayoutProperties

Card layout properties shared across all add-on host applications.

Fields
primaryColor

string

The primary color of the add-on. It sets the color of the toolbar. If no primary color is set, the default value provided by the framework is used.

secondaryColor

string

The secondary color of the add-on. It sets the color of buttons. If the primary color is set but no secondary color is set, the secondary color is the same as the primary color. If neither primary color nor secondary color is set, the default value provided by the framework is used.

useNewMaterialDesign

bool

Enables material design for cards.

LinkPreviewExtensionPoint

The configuration for a trigger that fires when a user types or pastes a link from a third-party or non-Google service into a Google Docs, Sheets, or Slides file.

Fields
labelText

string

Required. The text for an example smart chip that prompts users to preview the link, such as Example: Support case. This text is static and displays before users execute the add-on.

localizedLabelText

map<string, string>

Optional. A map of labelText to localize into other languages. Format the language in ISO 639 and the country/region in ISO 3166, separated by a hyphen -. For example, en-US.

If a user's locale is present in the map's keys, the user sees the localized version of the labelText.

patterns[]

UriPattern

Required. An array of URL patterns that trigger the add-on to preview links.

runFunction

string

Required. Endpoint to execute when a link preview is triggered.

logoUrl

string

Optional. The icon that displays in the smart chip and preview card. If omitted, the add-on uses its toolbar icon, logoUrl.

Common format for declaring a menu item or button that appears within a host app.

Fields
runFunction

string

Required. The endpoint to execute when this extension point is activated.

label

string

Required. User-visible text that describes the action taken by activating this extension point. For example, "Insert invoice."

logoUrl

string

The URL for the logo image shown in the add-on toolbar.

If not set, defaults to the add-on's primary logo URL.

UniversalActionExtensionPoint

Format for declaring a universal action menu item extension point.

Fields
label

string

Required. User-visible text that describes the action taken by activating this extension point, for example, "Add a new contact."

Union field action_type. Required. The action type supported on a universal action menu item. It can either be a link to open or an endpoint to execute. action_type can be only one of the following:
runFunction

string

Endpoint to be run by the UniversalAction.

UriPattern

The configuration for each URL pattern that triggers a link preview.

Fields
hostPattern

string

Required for each URL pattern to preview. The domain of the URL pattern. The add-on previews links that contain this domain in the URL. To preview links for a specific subdomain, like subdomain.example.com, include the subdomain. To preview links for the entire domain, specify a wildcard character with an asterisk (*) as the subdomain.

For example, *.example.com matches subdomain.example.com and another.subdomain.example.com.

pathPrefix

string

Optional. The path that appends the domain of the hostPattern.

For example, if the URL host pattern is support.example.com, to match URLs for cases hosted at support.example.com/cases/, enter cases.

To match all URLs in the host pattern domain, leave pathPrefix empty.