ButtonSet

Holds a set of `https://developers.google.com/apps-script/reference/card-service/button` objects that are displayed in a row.

Available for Google Workspace add-ons and Google Chat apps.

```javascript
const textButton = CardService.newTextButton();
// Finish building the text button...

const imageButton = CardService.newImageButton();
// Finish building the image button...

const buttonSet =
    CardService.newButtonSet().addButton(textButton).addButton(imageButton);
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/card-service/button-set#addButton(Button)` | `https://developers.google.com/apps-script/reference/card-service/button-set#` | Adds a button. |
| `https://developers.google.com/apps-script/reference/card-service/button-set#addEventAction(EventAction)` | `https://developers.google.com/apps-script/reference/card-service/widget` | Adds the event action that can be performed on the widget. |
| `https://developers.google.com/apps-script/reference/card-service/button-set#setId(String)` | `https://developers.google.com/apps-script/reference/card-service/widget` | Sets the unique ID assigned that's used to identify the widget to be mutated. |
| `https://developers.google.com/apps-script/reference/card-service/button-set#setVisibility(Visibility)` | `https://developers.google.com/apps-script/reference/card-service/widget` | Sets the visibility of the widget. |

## Detailed documentation

### `addButton(button)`

Adds a button.

#### Parameters

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

#### Return


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

*** ** * ** ***

### `addEventAction(eventAction)`

Adds the event action that can be performed on the widget.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `eventAction` | `https://developers.google.com/apps-script/reference/card-service/event-action` | The `https://developers.google.com/apps-script/reference/card-service/event-action` to be added. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/widget` --- The Object, for chaining.

*** ** * ** ***

### `setId(id)`

Sets the unique ID assigned that's used to identify the widget to be mutated. Widget mutation
is only supported in Add-Ons.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `id` | `String` | The id of the widget, with a limit of 64 characters and in format of \`\[a-zA-Z0-9-\]+\`. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/widget` --- This object, for chaining.

*** ** * ** ***

### `setVisibility(visibility)`

Sets the visibility of the widget. The default value is \`VISIBLE\`.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `visibility` | `https://developers.google.com/apps-script/reference/card-service/visibility` | The `https://developers.google.com/apps-script/reference/card-service/visibility` of the widget. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/widget` --- The Object, for chaining.