Cloud Translation V3 Client - Class DetectLanguageRequest (1.17.5)

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
NameDescription
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|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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$this

getContent

The content of the input stored as a string.

Returns
TypeDescription
string

hasContent

setContent

The content of the input stored as a string.

Parameter
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getSource

Returns
TypeDescription
string

static::build

Parameters
NameDescription
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 Google\Cloud\Translate\V3\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
TypeDescription
Google\Cloud\Translate\V3\DetectLanguageRequest