# Cloud Translation V3 Client - Class Example (2.3.0)

2.3.0 (latest) 2.2.0 2.1.2 2.0.3 1.21.0 1.20.2 1.19.0 1.18.1 1.17.7 1.16.0 1.15.4 1.14.3 1.13.3 1.12.12 Reference documentation and code samples for the Cloud Translation V3 Client class Example.

A sentence pair.

Generated from protobuf message `google.cloud.translation.v3.Example`

## Namespace

Google \\ Cloud \\ Translate \\ V3

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Output only. The resource name of the example, in form of `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}/examples/{example_id}` |
| `↳ source_text` | `string` Sentence in source language. |
| `↳ target_text` | `string` Sentence in target language. |
| `↳ usage` | `string` Output only. Usage of the sentence pair. Options are TRAIN\|VALIDATION\|TEST. |

### getName

Output only. The resource name of the example, in form of
`projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}/examples/{example_id}`

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

### setName

Output only. The resource name of the example, in form of
`projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}/examples/{example_id}`

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

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

### getSourceText

Sentence in source language.

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

### setSourceText

Sentence in source language.

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

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

### getTargetText

Sentence in target language.

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

### setTargetText

Sentence in target language.

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

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

### getUsage

Output only. Usage of the sentence pair. Options are TRAIN\|VALIDATION\|TEST.

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

### setUsage

Output only. Usage of the sentence pair. Options are TRAIN\|VALIDATION\|TEST.

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

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