Class DetectLanguageRequest.Builder (2.73.0)

public static final class DetectLanguageRequest.Builder extends GeneratedMessageV3.Builder<DetectLanguageRequest.Builder> implements DetectLanguageRequestOrBuilder

The request message for language detection.

Protobuf type google.cloud.translation.v3beta1.DetectLanguageRequest

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public DetectLanguageRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
DetectLanguageRequest.Builder
Overrides

build()

public DetectLanguageRequest build()
Returns
Type Description
DetectLanguageRequest

buildPartial()

public DetectLanguageRequest buildPartial()
Returns
Type Description
DetectLanguageRequest

clear()

public DetectLanguageRequest.Builder clear()
Returns
Type Description
DetectLanguageRequest.Builder
Overrides

clearContent()

public DetectLanguageRequest.Builder clearContent()

The content of the input stored as a string.

string content = 1;

Returns
Type Description
DetectLanguageRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public DetectLanguageRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
DetectLanguageRequest.Builder
Overrides

clearLabels()

public DetectLanguageRequest.Builder clearLabels()
Returns
Type Description
DetectLanguageRequest.Builder

clearMimeType()

public DetectLanguageRequest.Builder clearMimeType()

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

string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
DetectLanguageRequest.Builder

This builder for chaining.

clearModel()

public DetectLanguageRequest.Builder clearModel()

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.

string model = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
DetectLanguageRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public DetectLanguageRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
DetectLanguageRequest.Builder
Overrides

clearParent()

public DetectLanguageRequest.Builder clearParent()

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.

string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
DetectLanguageRequest.Builder

This builder for chaining.

clearSource()

public DetectLanguageRequest.Builder clearSource()
Returns
Type Description
DetectLanguageRequest.Builder

clone()

public DetectLanguageRequest.Builder clone()
Returns
Type Description
DetectLanguageRequest.Builder
Overrides

containsLabels(String key)

public boolean containsLabels(String key)

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/labels for more information.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
boolean

getContent()

public String getContent()

The content of the input stored as a string.

string content = 1;

Returns
Type Description
String

The content.

getContentBytes()

public ByteString getContentBytes()

The content of the input stored as a string.

string content = 1;

Returns
Type Description
ByteString

The bytes for content.

getDefaultInstanceForType()

public DetectLanguageRequest getDefaultInstanceForType()
Returns
Type Description
DetectLanguageRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

getLabelsCount()

public int getLabelsCount()

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/labels for more information.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getLabelsMap()

public Map<String,String> getLabelsMap()

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/labels for more information.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

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/labels for more information.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

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/labels for more information.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
String

getMimeType()

public String getMimeType()

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

string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The mimeType.

getMimeTypeBytes()

public ByteString getMimeTypeBytes()

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

string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for mimeType.

getModel()

public String 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.

string model = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The model.

getModelBytes()

public ByteString getModelBytes()

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.

string model = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for model.

getMutableLabels() (deprecated)

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getParent()

public String 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.

string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The parent.

getParentBytes()

public ByteString getParentBytes()

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.

string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for parent.

getSourceCase()

public DetectLanguageRequest.SourceCase getSourceCase()
Returns
Type Description
DetectLanguageRequest.SourceCase

hasContent()

public boolean hasContent()

The content of the input stored as a string.

string content = 1;

Returns
Type Description