Class ComposeActionResponseBuilder

  • ComposeActionResponseBuilder helps create responses for actions that generate draft emails when a UI element is interacted with.

  • It's important to understand that this is distinct from compose actions used to extend the Gmail compose UI.

  • Developers can use this builder to set a Gmail draft created using methods like GmailMessage.createDraftReply().

  • The build() method finalizes the response and ensures it's valid before use.

ComposeActionResponseBuilder

A builder for ComposeActionResponse objects.

Methods

MethodReturn typeBrief description
build() ComposeActionResponse Builds the current compose action response and validates it.
setGmailDraft(draft) ComposeActionResponseBuilder Sets the draft GmailMessage created using GmailMessage.createDraftReply(body) or similar functions.

Detailed documentation

build()

Builds the current compose action response and validates it.

Return

ComposeActionResponse — A validated ComposeActionResponse .

Throws

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


setGmailDraft(draft)

Sets the draft GmailMessage created using GmailMessage.createDraftReply(body) or similar functions.

Parameters

NameTypeDescription
draftGmailDraft The GmailDraft to use.

Return

ComposeActionResponseBuilder — This object, for chaining.

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

Last updated 2024年12月02日 UTC.