# Class TextFormatElement

TextFormatElement

A text format element, which can be a `TextFormatChip`, `StyledText`, `Hyperlink`, or `ListContainer`.

Only available for Google Workspace add-ons that extend Google Workspace Studio.

Sample usage:

```javascript
const sampleChip = AddOnsResponseService.newTextFormatChip()
        .setLabel("Label!");
const textFormatElement = AddOnsResponseService.newTextFormatElement()
        .setTextFormatChip(sampleChip);
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `setHyperlink(hyperlink)` | `TextFormatElement` | Sets the text format element as a `Hyperlink`. |
| `setListContainer(listContainer)` | `TextFormatElement` | Sets the text format element as a `ListContainer`. |
| `setStyledText(styledText)` | `TextFormatElement` | Sets the text format element as a `StyledText`. |
| `setText(text)` | `TextFormatElement` | Sets the text format element as a text string. |
| `setTextFormatChip(chip)` | `TextFormatElement` | Sets the text format element as a `TextFormatChip`. |

## Detailed documentation

### `setHyperlink(hyperlink)`

Sets the text format element as a `Hyperlink`.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `hyperlink` | `Hyperlink` | The `Hyperlink` of the text format element. |

#### Return


`TextFormatElement` --- This text format element object.

*** ** * ** ***

### `setListContainer(listContainer)`

Sets the text format element as a `ListContainer`.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `listContainer` | `ListContainer` | The `ListContainer` of the text format element. |

#### Return


`TextFormatElement` --- This text format element object.

*** ** * ** ***

### `setStyledText(styledText)`

Sets the text format element as a `StyledText`.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `styledText` | `StyledText` | The `StyledText` of the text format element. |

#### Return


`TextFormatElement` --- This text format element object.

*** ** * ** ***

### `setText(text)`

Sets the text format element as a text string.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `text` | `String` | The text of the text format element. |

#### Return


`TextFormatElement` --- This text format element object.

*** ** * ** ***

### `setTextFormatChip(chip)`

Sets the text format element as a `TextFormatChip`.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `chip` | `TextFormatChip` | The `TextFormatChip` of the text format element. |

#### Return


`TextFormatElement` --- This text format element object.