Class DetectLanguageRequest (2.43.0)

public final class DetectLanguageRequest extends GeneratedMessageV3 implements DetectLanguageRequestOrBuilder

The request message for language detection.

Protobuf type google.cloud.translation.v3beta1.DetectLanguageRequest

Static Fields

CONTENT_FIELD_NUMBER

public static final int CONTENT_FIELD_NUMBER
Field Value
Type Description
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
Type Description
int

MIME_TYPE_FIELD_NUMBER

public static final int MIME_TYPE_FIELD_NUMBER
Field Value
Type Description
int

MODEL_FIELD_NUMBER

public static final int MODEL_FIELD_NUMBER
Field Value
Type Description
int

PARENT_FIELD_NUMBER

public static final int PARENT_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static DetectLanguageRequest getDefaultInstance()
Returns
Type Description
DetectLanguageRequest

getDescriptor()

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

newBuilder()

public static DetectLanguageRequest.Builder newBuilder()
Returns
Type Description
DetectLanguageRequest.Builder

newBuilder(DetectLanguageRequest prototype)

public static DetectLanguageRequest.Builder newBuilder(DetectLanguageRequest prototype)
Parameter
Name Description
prototype DetectLanguageRequest
Returns
Type Description
DetectLanguageRequest.Builder

parseDelimitedFrom(InputStream input)

public static DetectLanguageRequest parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
DetectLanguageRequest
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DetectLanguageRequest parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DetectLanguageRequest
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static DetectLanguageRequest parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
DetectLanguageRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static DetectLanguageRequest parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DetectLanguageRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static DetectLanguageRequest parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
DetectLanguageRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static DetectLanguageRequest parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DetectLanguageRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static DetectLanguageRequest parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
DetectLanguageRequest
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static DetectLanguageRequest parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DetectLanguageRequest
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static DetectLanguageRequest parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
DetectLanguageRequest
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DetectLanguageRequest parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DetectLanguageRequest
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static DetectLanguageRequest parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
DetectLanguageRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static DetectLanguageRequest parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DetectLanguageRequest
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<DetectLanguageRequest> parser()
Returns
Type Description
Parser<DetectLanguageRequest>

Methods

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

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

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

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.

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.

getParserForType()

public Parser<DetectLanguageRequest> getParserForType()
Returns
Type Description
Parser<DetectLanguageRequest>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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
boolean

Whether the content field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected DetectLanguageRequest.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
DetectLanguageRequest.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

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

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException