Class UniversalActionResponseBuilder

  • UniversalActionResponseBuilder is used to build UniversalActionResponse objects.

  • Thebuild() method validates and creates the UniversalActionResponse.

  • ThedisplayAddOnCards() method allows you to show the add-on with specified cards.

  • ThesetOpenLink() method sets the URL that opens when a universal action is chosen.

UniversalActionResponseBuilder

A builder for theUniversalActionResponse objects.

Methods

MethodReturn typeBrief description
build()UniversalActionResponseBuilds the current universal action response and validates it.
displayAddOnCards(cardObjects)UniversalActionResponseBuilderDisplays the add-on with the specified cards.
setOpenLink(openLink)UniversalActionResponseBuilderSets the URL to open when the universal action is selected.

Detailed documentation

build()

Builds the current universal action response and validates it.

Return

UniversalActionResponse — A validated UniversalActionResponse.

Throws

Error — if the constructed universal action response isn't valid.


displayAddOnCards(cardObjects)

Displays the add-on with the specified cards.

Parameters

NameTypeDescription
cardObjectsObject[]An array ofCards to display.

Return

UniversalActionResponseBuilder — This object, for chaining.


setOpenLink(openLink)

Sets the URL to open when the universal action is selected.

Parameters

NameTypeDescription
openLinkOpenLinkThe link object to use.

Return

UniversalActionResponseBuilder — This object, for chaining.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-03 UTC.