# Cloud Translation V3 Client - Class BatchTranslateTextRequest (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 BatchTranslateTextRequest.

The batch translation request.

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

## Namespace

Google \\ Cloud \\ Translate \\ V3

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. Location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}`. The `global` location is not supported for batch translation. Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
| `↳ source_language_code` | `string` Required. Source language code. Supported language codes are listed in [Language Support](https://cloud.google.com/translate/docs/languages). |
| `↳ target_language_codes` | `string[]` Required. Specify up to 10 language codes here. Supported language codes are listed in [Language Support](https://cloud.google.com/translate/docs/languages). |
| `↳ models` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. The models to use for translation. Map's key is target language code. Map's value is model name. Value can be a built-in general model, or an AutoML Translation model. The value format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used. |
| `↳ input_configs` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.InputConfig>` Required. Input configurations. The total number of files matched should be \<= 100. The total content size should be \<= 100M Unicode codepoints. The files must use UTF-8 encoding. |
| `↳ output_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.OutputConfig` Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. |
| `↳ glossaries` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. Glossaries to be applied for translation. It's keyed by target language code. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See <https://cloud.google.com/translate/docs/advanced/labels> for more information. |

### getParent

Required. Location to make a call. Must refer to a caller's project.

Format: `projects/{project-number-or-id}/locations/{location-id}`.
The `global` location is not supported for batch translation.
Only AutoML Translation models or glossaries within the same region (have
the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
error is returned.

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

### setParent

Required. Location to make a call. Must refer to a caller's project.

Format: `projects/{project-number-or-id}/locations/{location-id}`.
The `global` location is not supported for batch translation.
Only AutoML Translation models or glossaries within the same region (have
the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
error is returned.

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

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

### getSourceLanguageCode

Required. Source language code. Supported language codes are listed in
[Language
Support](https://cloud.google.com/translate/docs/languages).

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

### setSourceLanguageCode

Required. Source language code. Supported language codes are listed in
[Language
Support](https://cloud.google.com/translate/docs/languages).

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

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

### getTargetLanguageCodes

Required. Specify up to 10 language codes here. Supported language codes
are listed in [Language
Support](https://cloud.google.com/translate/docs/languages).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setTargetLanguageCodes

Required. Specify up to 10 language codes here. Supported language codes
are listed in [Language
Support](https://cloud.google.com/translate/docs/languages).

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

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

### getModels

Optional. The models to use for translation. Map's key is target language
code. Map's value is model name. Value can be a built-in general model,
or an AutoML Translation model.

The value format depends on model type:

- AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
- General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setModels

Optional. The models to use for translation. Map's key is target language
code. Map's value is model name. Value can be a built-in general model,
or an AutoML Translation model.

The value format depends on model type:

- AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
- General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getInputConfigs

Required. Input configurations.

The total number of files matched should be \<= 100.
The total content size should be \<= 100M Unicode codepoints.
The files must use UTF-8 encoding.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.InputConfig>` |   |

### setInputConfigs

Required. Input configurations.

The total number of files matched should be \<= 100.
The total content size should be \<= 100M Unicode codepoints.
The files must use UTF-8 encoding.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.InputConfig>` |

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

### getOutputConfig

Required. Output configuration.

If 2 input configs match to the same file (that is, same input path),
we don't generate output for duplicate inputs.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.OutputConfig|null` |   |

### hasOutputConfig

### clearOutputConfig

### setOutputConfig

Required. Output configuration.

If 2 input configs match to the same file (that is, same input path),
we don't generate output for duplicate inputs.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-translate/latest/V3.OutputConfig` |

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

### getGlossaries

Optional. Glossaries to be applied for translation.

It's keyed by target language code.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setGlossaries

Optional. Glossaries to be applied for translation.

It's keyed by target language code.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getLabels

Optional. The labels with user-defined metadata for the request.

Label keys and values can be no longer than 63 characters
(Unicode codepoints), can only contain lowercase letters, numeric
characters, underscores and dashes. International characters are allowed.
Label values are optional. Label keys must start with a letter.
See <https://cloud.google.com/translate/docs/advanced/labels> for more
information.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

Optional. The labels with user-defined metadata for the request.

Label keys and values can be no longer than 63 characters
(Unicode codepoints), can only contain lowercase letters, numeric
characters, underscores and dashes. International characters are allowed.
Label values are optional. Label keys must start with a letter.
See <https://cloud.google.com/translate/docs/advanced/labels> for more
information.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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