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

The request message for language detection.

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

## Namespace

Google \\ Cloud \\ Translate \\ V3

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned. |
| `↳ model` | `string` Optional. The language detection model to be used. Format: `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` Only one language detection model is currently supported: `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. If not specified, the default model is used. |
| `↳ content` | `string` The content of the input stored as a string. |
| `↳ mime_type` | `string` Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
| `↳ 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. Project or location to make a call. Must refer to a caller's
project.

Format: `projects/{project-number-or-id}/locations/{location-id}` or
`projects/{project-number-or-id}`.
For global calls, use `projects/{project-number-or-id}/locations/global` or
`projects/{project-number-or-id}`.
Only models within the same region (has same location-id) can be used.
Otherwise an INVALID_ARGUMENT (400) error is returned.

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

### setParent

Required. Project or location to make a call. Must refer to a caller's
project.

Format: `projects/{project-number-or-id}/locations/{location-id}` or
`projects/{project-number-or-id}`.
For global calls, use `projects/{project-number-or-id}/locations/global` or
`projects/{project-number-or-id}`.
Only models within the same region (has same location-id) can be used.
Otherwise an INVALID_ARGUMENT (400) error is returned.

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

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

### getModel

Optional. The language detection model to be used.

Format:
`projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
Only one language detection model is currently supported:
`projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
If not specified, the default model is used.

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

### setModel

Optional. The language detection model to be used.

Format:
`projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
Only one language detection model is currently supported:
`projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
If not specified, the default model is used.

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

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

### getContent

The content of the input stored as a string.

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

### hasContent

### setContent

The content of the input stored as a string.

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

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

### getMimeType

Optional. The format of the source text, for example, "text/html",
"text/plain". If left blank, the MIME type defaults to "text/html".

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

### setMimeType

Optional. The format of the source text, for example, "text/html",
"text/plain". If left blank, the MIME type defaults to "text/html".

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

| **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` |   |

### getSource

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned. Please see TranslationServiceClient::locationName() for help formatting this field. |
| `model` | `string` Optional. The language detection model to be used. Format: `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` Only one language detection model is currently supported: `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. If not specified, the default model is used. |
| `mimeType` | `string` Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
| `content` | `string` The content of the input stored as a string. |

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