AddOns Response Service

AddOns Response Service

This service allows scripts to configure and build Google Workspace add-ons that extend Google Workspace Studio.

Classes

NameBrief description
ActionAn action that Google Workspace add-ons that extend Google Workspace Studio can use to render a new card.
AddOnsResponseServiceAddOnsResponseService provides the ability to create responses for Google Workspace add-ons that extend Google Workspace Studio.
BasicDataTypeAn enum that represents the basic generic data types.
ColorA Color object which represents a color in the RGBA color space.
DataTypeA DataType is used to set the type of a variable.
DynamicResourceDefinitionA DynamicResourceDefinition is a building block for a ResourceFieldsDefinitionRetrievedAction, it can contain one or more numbers of ResourceField to dynamically define the number of output variables provided by a step in Google Workspace Studio.
ErrorActionabilityA Enum that represents the error actionability.
ErrorRetryabilityA Enum that represents the retry-ability of action invocation when having an error.
FontWeightAn enum that represents the font weight of the styled text.
HostAppActionA HostAppAction is a type of Action that is handled by individual host apps.
HyperlinkA Hyperlink element used in TextFormatElement.
InsertSectionA builder for InsertSection objects.
InsertWidgetA builder for InsertWidget objects.
LinkThe link object from a third-party resource which gets converted it to a smart chip in the host application.
ListContainerContainer for list items, where each list item can contain multiple TextFormatElement.
ListItemA list item, where each list item can contain multiple TextFormatElement.
ListTypeAn enum that represents the type of the list.
ModifyCardA builder for ModifyCard objects that changes and updates an existing card's interface by passing the ModifyCard object to a Action.
NavigationA helper object that controls card navigation.
RemoveSectionA builder for RemoveSection objects.
RemoveWidgetA builder for RemoveWidget objects.
RenderActionRenders or updates a card by performing an Action in response to a user interaction.
RenderActionBuilderA builder for RenderAction objects.
ResourceDataRepresents a application specific resource data, a resource data contains a collection of key-value pairs of variable names and VariableData.
ResourceFieldA ResourceField is a basic building block of a DynamicResourceDefinition, each resource field corresponds to a output variable of the current step.
ResourceFieldsDefinitionRetrievedActionA ResourceFieldsDefinitionRetrievedAction is a type of ResourceFieldsDefinitionRetrievedAction that is used to retrieve the definition of a list of resource fields through the dynamicResourceDefinitionProvider function specified in the manifest.
ResourceRetrievedActionA ResourceRetrievedAction is used to retrieve custom resource content when needed, where the custom resource field is defined in the ResourceData.
ResourceTypeAn application specific resource type, the unique identifier of the resource type should have a corresponding WorkflowResourceDefinition.
ReturnElementErrorActionA ReturnElementErrorAction indicates that an error occurred during element invocation.
ReturnOutputVariablesActionContains output variables generated by the executed action in Google Workspace Studio.
SaveWorkflowActionThis action indicates that the host app (Google Workspace Studio) should save the agent.
StyledTextText element with styles such as bold, italic and color.
TextFormatChipA clickable chip in the text format.
TextFormatElementA text format element, which can be a TextFormatChip, StyledText, Hyperlink, or ListContainer.
TextFormatIconAn icon that is displayed in a TextFormatChip.
TextStyleAn enum that represents the style of the styled text.
TimeStampRepresents a timestamp object which is can be added to a VariableData.
UpdateWidgetA builder for UpdateWidget objects.
ValidationErrorSeverityAn enum that represents the severity of the validation error.
ValueMetadataA valueMetadata contains information about the potential values of a variable.
VariableDataRepresents a variable data which can contain a collection of values in various types.
WorkflowActionA WorkflowAction is a type of HostAppAction that is used to perform a specific action in Google Workspace Studio.
WorkflowTextFormatA block of text with rich formatting options including styles, hyperlinks, and interactive elements defined in TextFormatElement.
WorkflowValidationErrorActionThis action indicates that the host app (Google Workspace Studio) should display a validation error.

Action

Methods

MethodReturn typeBrief description
addModifyCard(modifyCard)ActionAdds a ModifyCard operation to the action.
addNavigation(navigation)ActionAdds a card navigation to the action.

AddOnsResponseService

Methods

MethodReturn typeBrief description
newAction()ActionCreates a new Action.
newNavigation()NavigationCreates a new Navigation.
newRenderActionBuilder()RenderActionBuilderCreates a new RenderActionBuilder.

BasicDataType

Properties

PropertyTypeDescription
BASIC_TYPE_UNSPECIFIEDEnumDefault value.
STRINGEnumA string of characters.
INTEGEREnumAn integer value.
FLOATEnumA floating point number.
TIMESTAMPEnumA timestamp in ISO 8601 format.
BOOLEANEnumA boolean value.
EMAIL_ADDRESSEnumA string in the format of an email address.
GOOGLE_USEREnumA user of the Google services, in the format of “users/encoded_GAIA_ID”
FILEEnumA file type.
FORMATTED_TEXTEnumA text with rich formatting.

Color

Methods

MethodReturn typeBrief description
setAlpha(alpha)ColorSets the alpha component of the color.
setBlue(blue)ColorSets the blue component of the color.
setGreen(green)ColorSets the green component of the color.
setRed(red)ColorSets the red component of the color.

DataType

Methods

MethodReturn typeBrief description
setBasicDataType(basicDataType)DataTypeSets the data type to one of the supported BasicDataTypes.
setResourceType(resourceType)DataTypeSets the data type to a custom defined ResourceType.
setValueMetadata(valueMetadata)DataTypeSets the ValueMetadata, which contains type-related information related to the variable.

DynamicResourceDefinition

Methods

MethodReturn typeBrief description
addResourceField(resourceField)DynamicResourceDefinitionAdds a resource field to the dynamic resource definition.
setResourceId(resourceId)DynamicResourceDefinitionSets the ID for the dynamic resource definition, this ID corresponds to the workflowResourceDefinitionId in the manifest.

ErrorActionability

Properties

PropertyTypeDescription
ERROR_ACTIONABILITY_UNSPECIFIEDEnumUnspecified.
NOT_ACTIONABLEEnumThe error is not fixable by the user through the configuration card.
ACTIONABLEEnumThe error is fixable by the user through the configuration card.

ErrorRetryability

Properties

PropertyTypeDescription
RETRYABILITY_UNSPECIFIEDEnumUnspecified.
NOT_RETRYABLEEnumThe error is not retryable, the flow terminates after the first try.
RETRYABLEEnumThe error is retryable, Workflow is going to try to execute the Step for up to 5 times.

FontWeight

Properties

PropertyTypeDescription
FONT_WEIGHT_UNSPECIFIEDEnumStandard weight with normal thickness.
LIGHTEnumLighter weight with reduced thickness.
MEDIUMEnumIntermediate weight between light and bold.
BOLDEnumHeavier weight with increased thickness.

HostAppAction

Methods

MethodReturn typeBrief description
setWorkflowAction(workflowAction)HostAppActionSets the host app action to Workflow action.

Methods

MethodReturn typeBrief description
setLink(link)HyperlinkSets the destination URL of the hyperlink.
setText(text)HyperlinkSets the text of the hyperlink.

InsertSection

Methods

MethodReturn typeBrief description
insertAtTop(onCardTop)InsertSectionSets the onCardTop flag, which indicates whether the new section should be inserted at the top of the card.
insertBelowSection(sectionId)InsertSectionSets the section ID, and the new section is inserted below it.
setSection(section)InsertSectionSets the card section to be inserted.

InsertWidget

Methods

MethodReturn typeBrief description
insertAboveWidget(widgetId)InsertWidgetSets the widget ID, and the new widget is inserted above the widget with the given ID.
insertBelowWidget(widgetId)InsertWidgetSets the widget ID, and the new widget is inserted below the widget with the given ID.
setWidget(widget)InsertWidgetSets the Widget to be inserted.

Methods

MethodReturn typeBrief description
setTitle(title)LinkSets the title of the link.
setUrl(url)LinkSets the URL of the link.

ListContainer

Methods

MethodReturn typeBrief description
addListItem(listItem)ListContainerAdds a list item to the list container.
setListNestLevel(listLevel)ListContainerSets the level of the list, starts from 0 for the top level, and increases by 1 for each nested list.
setListType(listType)ListContainerSets the type of the list to be ordered or unordered.

ListItem

Methods

MethodReturn typeBrief description
addTextFormatElement(textFormatElement)ListItemAdds a TextFormatElement to the list item.

ListType

Properties

PropertyTypeDescription
LIST_TYPE_UNSPECIFIEDEnumDefault value.
ORDEREDEnumOrdered list.
UNORDEREDEnumUnordered list.

ModifyCard

Methods

MethodReturn typeBrief description
setInsertSection(insertSection)ModifyCardSets the InsertSection for this modify card object.
setInsertWidget(insertWidget)ModifyCardSets the InsertWidget for this modify card object.
setRemoveSection(removeSection)ModifyCardSets the RemoveSection for this modify card object.
setRemoveWidget(removeWidget)ModifyCardSets the RemoveWidget for this modify card object.
setReplaceSection(replacementSection)ModifyCardSets the replacement CardSection for this modify card object, the replacement section should have the same id as an existing card section.
setReplaceWidget(replacementWidget)ModifyCardSets the replacement widget for this modify card object, the replacement widget should have the same id as an existing widget.
setUpdateWidget(updateWidget)ModifyCardSets the UpdateWidget for this modify card object.

Methods

MethodReturn typeBrief description
printJson()StringPrints the JSON representation of this object.
pushCard(card)NavigationPushes the given card onto the stack.

RemoveSection

Methods

MethodReturn typeBrief description
setSectionId(sectionId)RemoveSectionSets the section ID of the section to be removed.

RemoveWidget

Methods

MethodReturn typeBrief description
setWidgetId(widgetId)RemoveWidgetSets the widget ID of the widget to be removed.

RenderAction

Methods

MethodReturn typeBrief description
printJson()StringPrints the JSON representation of this object.

RenderActionBuilder

Methods

MethodReturn typeBrief description
build()RenderActionBuilds the current render action and validates it.
setAction(action)RenderActionBuilderSets the action that add-ons can use to update the UI to the render action.
setHostAppAction(hostAppAction)RenderActionBuilderSets the HostAppAction handled by individual host apps to the render action.

ResourceData

Methods

MethodReturn typeBrief description
addVariableData(key, value)ResourceDataAdds a VariableData keyed by its variable name, a value is overwritten if the key already exists.
setVariableDataMap(fields)ResourceDataSets the map of the variable data keyed by variable names.

ResourceField

Methods

MethodReturn typeBrief description
setDataType(dataType)ResourceFieldSets the data type of the field, allows other steps to filter the variables by type at selection.
setDisplayText(displayText)ResourceFieldSets the description of the field that is displayed to the end user during variable selection in subsequent steps.
setSelector(selector)ResourceFieldSets a key for the provider function to provide the value to during the step's execution.

ResourceFieldsDefinitionRetrievedAction

Methods

MethodReturn typeBrief description
addDynamicResourceDefinition(dynamicResourceDefinition)ResourceFieldsDefinitionRetrievedActionAdds a DynamicResourceDefinition to the resource fields definition retrieved action.

ResourceRetrievedAction

Methods

MethodReturn typeBrief description
setResourceData(resourceData)ResourceRetrievedActionSets the ResourceData to the resource retrieved action to provide values to the dynamic resource fields or custom resource fields.

ResourceType

Methods

MethodReturn typeBrief description
setWorkflowResourceDefinitionId(resourceType)ResourceTypeSets the workflow resource definition id.

ReturnElementErrorAction

Methods

MethodReturn typeBrief description
setErrorActionability(errorActionability)ReturnElementErrorActionSets the error actionability, an error should be actionable if it can be resolved by re-configuring the Step.
setErrorLog(log)ReturnElementErrorActionSets the error log to be displayed to the end user at Workflow's activity feed.
setErrorRetryability(errorRetryability)ReturnElementErrorActionSets the error retry-ability, the flow terminates after the first try if an error is not retryable.

ReturnOutputVariablesAction

Methods

MethodReturn typeBrief description
addVariableData(key, value)ReturnOutputVariablesActionAdds a variable data keyed by its variable name, a value is overwritten if the key already exists.
setLog(log)ReturnOutputVariablesActionSets the Log of the executed workflow action to the end user at Workflow's activity feed.
setVariableDataMap(variables)ReturnOutputVariablesActionSets the map of the variable data keyed by variable name, a value is overwritten if the key already exists.

SaveWorkflowAction

StyledText

Methods

MethodReturn typeBrief description
addStyle(style)StyledTextSets the style of the styled text, can apply multiple styles to a single styled text.
setColor(color)StyledTextSets the color of the styled text.
setFontWeight(fontWeight)StyledTextSets the font weight of the styled text.
setText(text)StyledTextSets the main content of the styled text.

TextFormatChip

Methods

MethodReturn typeBrief description
setLabel(label)TextFormatChipSets the text displayed in the chip.
setTextFormatIcon(icon)TextFormatChipSets the icon displayed in the chip.
setUrl(url)TextFormatChipSets the URL to navigate to when the chip is clicked.

TextFormatElement

Methods

MethodReturn typeBrief description
setHyperlink(hyperlink)TextFormatElementSets the text format element as a Hyperlink.
setListContainer(listContainer)TextFormatElementSets the text format element as a ListContainer.
setStyledText(styledText)TextFormatElementSets the text format element as a StyledText.
setText(text)TextFormatElementSets the text format element as a text string.
setTextFormatChip(chip)TextFormatElementSets the text format element as a TextFormatChip.

TextFormatIcon

Methods

MethodReturn typeBrief description
setIconUrl(iconUrl)TextFormatIconSets the icon URL.
setMaterialIconName(materialIconName)TextFormatIconSets the material icon name defined in Google Material Icons.

TextStyle

Properties

PropertyTypeDescription
STYLE_UNSPECIFIEDEnumNo style applied.
ITALICEnumItalic style.
UNDERLINEEnumUnderline style.
STRIKETHROUGHEnumStrikethrough style.
LINE_BREAKEnumLine break.
UPPERCASEEnumUppercase style.
CODEEnumCode style.
CODE_BLOCKEnumCode block style.

TimeStamp

Methods

MethodReturn typeBrief description
setNanos(nanos)TimeStampSets the nanos of the timestamp, it represents the number of nanoseconds within the current second.
setSeconds(seconds)TimeStampSets the seconds of the timestamp, it represents the number of seconds since the Unix epoch(January 1, 1970, 00:00:00 UTC).

UpdateWidget

Methods

MethodReturn typeBrief description
addSuggestion(text, value, selected, startIconUri, bottomText)UpdateWidgetAdds a new item that can be selected, for multi-select menus.

ValidationErrorSeverity

Properties

PropertyTypeDescription
SEVERITY_UNSPECIFIEDEnumUnspecified.
CRITICALEnumCritical, the error is critical and must be fixed before publish.
WARNINGEnumWarning, the error is non-critical and is not blocking publish.

ValueMetadata

Methods

MethodReturn typeBrief description
addCastableType(dataType)ValueMetadataAdds a optional allowed types that can be dynamically casted for a variable data to this value metadata.
addEnumValue(enumValue)ValueMetadataAdds an optional string value to the allowed enum values of a variable, this field can only be set if the DataType is set to String type.
setDefaultValue(defaultValue)ValueMetadataSets the optional default value of the variable, example, if the variable type is boolean, defaultValue may be set to "true" or "false".

VariableData

Methods

MethodReturn typeBrief description
addBooleanValue(value)VariableDataAdds a boolean value to the variable data.
addEmailAddress(emailAddress)VariableDataAdds an email address to the variable data.
addFloatValue(value)VariableDataAdds a float value to the variable data.
addGoogleUser(googleUser)VariableDataAdds a google user to the variable data.
addIntegerValue(value)VariableDataAdds an integer value to the variable data.
addResourceData(resourceData)VariableDataAdds a ResourceData value to the variable data.
addResourceReference(resourceReference)VariableDataAdds a resource reference ID to the variable data.
addStringValue(value)VariableDataAdds a string value to the variable data.
addTimestampValue(value)VariableDataAdds a TimeStamp value to the variable data.
addWorkflowTextFormat(workflowTextFormat)VariableDataAdds a WorkflowTextFormat value to the variable data.

WorkflowAction

WorkflowTextFormat

Methods

MethodReturn typeBrief description
addTextFormatElement(textFormatElement)WorkflowTextFormatAdds a TextFormatElement to the workflow text format.

WorkflowValidationErrorAction

Methods

MethodReturn typeBrief description
setSeverity(severity)WorkflowValidationErrorActionSets the severity of the validation error.