ActionResponseBuilder

A builder for `https://developers.google.com/apps-script/reference/card-service/action-response` objects.

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/card-service/action-response-builder#build()` | `https://developers.google.com/apps-script/reference/card-service/action-response` | Builds the current action response and validates it. |
| `https://developers.google.com/apps-script/reference/card-service/action-response-builder#setNavigation(Navigation)` | `https://developers.google.com/apps-script/reference/card-service/action-response-builder#` | Sets the response to a `https://developers.google.com/apps-script/reference/card-service/navigation` action. |
| `https://developers.google.com/apps-script/reference/card-service/action-response-builder#setNotification(Notification)` | `https://developers.google.com/apps-script/reference/card-service/action-response-builder#` | Sets the notification to display when the action is activated. |
| `https://developers.google.com/apps-script/reference/card-service/action-response-builder#setOpenLink(OpenLink)` | `https://developers.google.com/apps-script/reference/card-service/action-response-builder#` | Sets the URL to navigate to when the action is activated. |
| `https://developers.google.com/apps-script/reference/card-service/action-response-builder#setStateChanged(Boolean)` | `https://developers.google.com/apps-script/reference/card-service/action-response-builder#` | Sets a flag to indicate that this action changed the existing data state. |

## Detailed documentation

### `build()`

Builds the current action response and validates it.

#### Return


`https://developers.google.com/apps-script/reference/card-service/action-response` --- A validated ActionResponse.

#### Throws


[`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) --- if the constructed action response isn't valid.

*** ** * ** ***

### `setNavigation(navigation)`

Sets the response to a `https://developers.google.com/apps-script/reference/card-service/navigation` action.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `navigation` | `https://developers.google.com/apps-script/reference/card-service/navigation` | The `https://developers.google.com/apps-script/reference/card-service/navigation` to use. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/action-response-builder#` --- This object, for chaining.

*** ** * ** ***

### `setNotification(notification)`

Sets the notification to display when the action is activated.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `notification` | `https://developers.google.com/apps-script/reference/card-service/notification` | The `https://developers.google.com/apps-script/reference/card-service/notification` to use. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/action-response-builder#` --- This object, for chaining.

*** ** * ** ***

### `setOpenLink(openLink)`

Sets the URL to navigate to when the action is activated.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `openLink` | `https://developers.google.com/apps-script/reference/card-service/open-link` | The `https://developers.google.com/apps-script/reference/card-service/open-link` to use. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/action-response-builder#` --- This object, for chaining.

*** ** * ** ***

### `setStateChanged(stateChanged)`

Sets a flag to indicate that this action changed the existing data state. For example, if the
action created a task or updated contact information. When this flag is set to true, services
such as Gmail can attempt to clear any cached state data associated with this action.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `stateChanged` | `Boolean` | Whether this action has changed the existing state data. Defaults to false. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/action-response-builder#` --- This object, for chaining.