Class DetectLanguageRequest (2.16.0)

public final class DetectLanguageRequest extends GeneratedMessageV3 implements DetectLanguageRequestOrBuilder

The request message for language detection.

Protobuf type google.cloud.translation.v3.DetectLanguageRequest

Static Fields

CONTENT_FIELD_NUMBER

public static final int CONTENT_FIELD_NUMBER
Field Value
TypeDescription
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
TypeDescription
int

MIME_TYPE_FIELD_NUMBER

public static final int MIME_TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

MODEL_FIELD_NUMBER

public static final int MODEL_FIELD_NUMBER
Field Value
TypeDescription
int

PARENT_FIELD_NUMBER

public static final int PARENT_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static DetectLanguageRequest getDefaultInstance()
Returns
TypeDescription
DetectLanguageRequest

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static DetectLanguageRequest.Builder newBuilder()
Returns
TypeDescription
DetectLanguageRequest.Builder

newBuilder(DetectLanguageRequest prototype)

public static DetectLanguageRequest.Builder newBuilder(DetectLanguageRequest prototype)
Parameter
NameDescription
prototypeDetectLanguageRequest
Returns
TypeDescription
DetectLanguageRequest.Builder

parseDelimitedFrom(InputStream input)

public static DetectLanguageRequest parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
DetectLanguageRequest
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DetectLanguageRequest parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DetectLanguageRequest
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static DetectLanguageRequest parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
DetectLanguageRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static DetectLanguageRequest parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DetectLanguageRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static DetectLanguageRequest parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
DetectLanguageRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static DetectLanguageRequest parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DetectLanguageRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static DetectLanguageRequest parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
DetectLanguageRequest
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static DetectLanguageRequest parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DetectLanguageRequest
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static DetectLanguageRequest parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
DetectLanguageRequest
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DetectLanguageRequest parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DetectLanguageRequest
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static DetectLanguageRequest parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
DetectLanguageRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static DetectLanguageRequest parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DetectLanguageRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<DetectLanguageRequest> parser()
Returns
TypeDescription
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/advanced/labels for more information.

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

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getContent()

public String getContent()

The content of the input stored as a string.

string content = 1;

Returns
TypeDescription
String

The content.

getContentBytes()

public ByteString getContentBytes()

The content of the input stored as a string.

string content = 1;

Returns
TypeDescription
ByteString

The bytes for content.

getDefaultInstanceForType()

public DetectLanguageRequest getDefaultInstanceForType()
Returns
TypeDescription
DetectLanguageRequest

getLabels()

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

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

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

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

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

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

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

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
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/advanced/labels for more information.

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

Parameter
NameDescription
keyString
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for parent.

getParserForType()

public Parser<DetectLanguageRequest> getParserForType()
Returns
TypeDescription
Parser<DetectLanguageRequest>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getSourceCase()

public DetectLanguageRequest.SourceCase getSourceCase()
Returns
TypeDescription
DetectLanguageRequest.SourceCase

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hasContent()

public boolean hasContent()

The content of the input stored as a string.

string content = 1;

Returns
TypeDescription
boolean

Whether the content field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public DetectLanguageRequest.Builder newBuilderForType()
Returns
TypeDescription
DetectLanguageRequest.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected DetectLanguageRequest.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
DetectLanguageRequest.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public DetectLanguageRequest.Builder toBuilder()
Returns
TypeDescription
DetectLanguageRequest.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException