0.31.0 (latest) 0.30.0 0.29.0 0.28.0 0.27.0 0.23.0 0.20.0 0.19.0 0.18.0 0.17.1 0.16.1 0.15.0 0.14.0 0.13.1 0.12.1 0.11.2 0.10.0 0.9.0 0.8.1 0.7.2 0.6.1 0.5.0 0.4.0 0.3.0 0.2.0 0.1.4 Reference documentation and code samples for the Google Apps Chat V1 Client class Attachment.

An attachment in Google Chat.

Generated from protobuf message `google.chat.v1.Attachment`

## Namespace

Google \\ Apps \\ Chat \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`. |
| `↳ content_name` | `string` Output only. The original file name for the content, not the full path. |
| `↳ content_type` | `string` Output only. The content type (MIME type) of the file. |
| `↳ attachment_data_ref` | `AttachmentDataRef` Optional. A reference to the attachment data. This field is used to create or update messages with attachments, or with the media API to download the attachment data. |
| `↳ drive_data_ref` | `DriveDataRef` Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API. |
| `↳ thumbnail_uri` | `string` Output only. The thumbnail URL which should be used to preview the attachment to a human user. Chat apps shouldn't use this URL to download attachment content. |
| `↳ download_uri` | `string` Output only. The download URL which should be used to allow a human user to download the attachment. Chat apps shouldn't use this URL to download attachment content. |
| `↳ source` | `int` Output only. The source of the attachment. |

### getName

Identifier. Resource name of the attachment.

Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Identifier. Resource name of the attachment.

Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getContentName

Output only. The original file name for the content, not the full path.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setContentName

Output only. The original file name for the content, not the full path.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getContentType

Output only. The content type (MIME type) of the file.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setContentType

Output only. The content type (MIME type) of the file.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAttachmentDataRef

Optional. A reference to the attachment data. This field is used to
create or update messages with attachments, or with the media API to
download the attachment data.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AttachmentDataRef|null` |   |

### hasAttachmentDataRef

### setAttachmentDataRef

Optional. A reference to the attachment data. This field is used to
create or update messages with attachments, or with the media API to
download the attachment data.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `AttachmentDataRef` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDriveDataRef

Output only. A reference to the Google Drive attachment. This field is
used with the Google Drive API.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `DriveDataRef|null` |   |

### hasDriveDataRef

### setDriveDataRef

Output only. A reference to the Google Drive attachment. This field is
used with the Google Drive API.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `DriveDataRef` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getThumbnailUri

Output only. The thumbnail URL which should be used to preview the
attachment to a human user. Chat apps shouldn't use this URL to download
attachment content.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setThumbnailUri

Output only. The thumbnail URL which should be used to preview the
attachment to a human user. Chat apps shouldn't use this URL to download
attachment content.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDownloadUri

Output only. The download URL which should be used to allow a human user to
download the attachment. Chat apps shouldn't use this URL to download
attachment content.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDownloadUri

Output only. The download URL which should be used to allow a human user to
download the attachment. Chat apps shouldn't use this URL to download
attachment content.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSource

Output only. The source of the attachment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Source](https://docs.cloud.google.com/php/docs/reference/apps-chat/latest/Chat.V1.Attachment.Source.md.txt). |

### setSource

Output only. The source of the attachment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Source](https://docs.cloud.google.com/php/docs/reference/apps-chat/latest/Chat.V1.Attachment.Source.md.txt). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDataRef

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |