Class ComposeActionResponseBuilder

  • TheComposeActionResponseBuilder is used to buildComposeActionResponse objects, which are responses to Actions that compose draft messages.

  • This builder is not related to compose actions used for extending the Gmail compose UI.

  • Thebuild() method validates and returns the constructedComposeActionResponse.

  • ThesetGmailDraft(draft) method sets the Gmail draft to be used in the response.

ComposeActionResponseBuilder

A builder forComposeActionResponse objects.

Note: This object isn't related tocompose actions that areused toextend the compose UI. Rather,this builder creates responses to anAction that composes draft messages when a specificUI element is selected.

Methods

MethodReturn typeBrief description
build()ComposeActionResponseBuilds the current compose action response and validates it.
setGmailDraft(draft)ComposeActionResponseBuilderSets the draftGmailMessage createdusingGmailMessage.createDraftReply(body) orsimilar functions.

Detailed documentation

build()

Builds the current compose action response and validates it.

Return

ComposeActionResponse — A validatedComposeActionResponse.

Throws

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


setGmailDraft(draft)

Sets the draftGmailMessage createdusingGmailMessage.createDraftReply(body) orsimilar functions.

Parameters

NameTypeDescription
draftGmailDraftTheGmailDraft to use.

Return

ComposeActionResponseBuilder — 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-11 UTC.