Attachment

Represents an attachment created by an add-on. This can be used within the context of different
Google extensibility products to generate new attachments, such as for Calendar events.

```javascript
const attachment = CardService.newAttachment()
                       .setResourceUrl('https://fakeresourceurl.com')
                       .setTitle('Attachment title')
                       .setMimeType('text/html')
                       .setIconUrl('https://fakeresourceurl.com/iconurl.png');
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/card-service/attachment#setIconUrl(String)` | `https://developers.google.com/apps-script/reference/card-service/attachment#` | Sets the icon URL for the attachment. |
| `https://developers.google.com/apps-script/reference/card-service/attachment#setMimeType(String)` | `https://developers.google.com/apps-script/reference/card-service/attachment#` | Sets the MIME type for the attachment. |
| `https://developers.google.com/apps-script/reference/card-service/attachment#setResourceUrl(String)` | `https://developers.google.com/apps-script/reference/card-service/attachment#` | Sets the resource URL for the attachment. |
| `https://developers.google.com/apps-script/reference/card-service/attachment#setTitle(String)` | `https://developers.google.com/apps-script/reference/card-service/attachment#` | Sets the title for the attachment. |

## Detailed documentation

### `setIconUrl(iconUrl)`

Sets the icon URL for the attachment.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `iconUrl` | `String` | The URL address of the attachment icon. |

#### Return


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

*** ** * ** ***

### `setMimeType(mimeType)`

Sets the MIME type for the attachment.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `mimeType` | `String` | The MIME type of the content in the attachment resource. |

#### Return


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

*** ** * ** ***

### `setResourceUrl(resourceUrl)`

Sets the resource URL for the attachment.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `resourceUrl` | `String` | The URL address of a resource. |

#### Return


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

*** ** * ** ***

### `setTitle(title)`

Sets the title for the attachment.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `title` | `String` | The title of the attachment. |

#### Return


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