public final class Translation extends GeneratedMessageV3 implements TranslationOrBuilder
A single translation response.Protobuf type
google.cloud.translation.v3beta1.Translation
Modifier and Type | Class and Description |
---|---|
static class |
Translation.Builder
A single translation response.
|
GeneratedMessageV3.BuilderParent, GeneratedMessageV3.ExtendableBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage,BuilderType extends GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.FieldAccessorTable, GeneratedMessageV3.UnusedPrivateParameter
AbstractMessageLite.InternalOneOfEnum
Modifier and Type | Field and Description |
---|---|
static int |
DETECTED_LANGUAGE_CODE_FIELD_NUMBER |
static int |
GLOSSARY_CONFIG_FIELD_NUMBER |
static int |
MODEL_FIELD_NUMBER |
static int |
TRANSLATED_TEXT_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFields
memoizedSize
memoizedHashCode
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof
toByteArray, toByteString, writeDelimitedTo, writeTo
public static final int TRANSLATED_TEXT_FIELD_NUMBER
public static final int MODEL_FIELD_NUMBER
public static final int DETECTED_LANGUAGE_CODE_FIELD_NUMBER
public static final int GLOSSARY_CONFIG_FIELD_NUMBER
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance
in class GeneratedMessageV3
public final UnknownFieldSet getUnknownFields()
getUnknownFields
in interface MessageOrBuilder
getUnknownFields
in class GeneratedMessageV3
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3
public String getTranslatedText()
Text translated into the target language. If an error occurs during translation, this field might be excluded from the response.
string translated_text = 1;
getTranslatedText
in interface TranslationOrBuilder
public ByteString getTranslatedTextBytes()
Text translated into the target language. If an error occurs during translation, this field might be excluded from the response.
string translated_text = 1;
getTranslatedTextBytes
in interface TranslationOrBuilder
public String getModel()
Only present when `model` is present in the request. `model` here is normalized to have project number. For example: If the `model` requested in TranslationTextRequest is `projects/{project-id}/locations/{location-id}/models/general/nmt` then `model` here would be normalized to `projects/{project-number}/locations/{location-id}/models/general/nmt`.
string model = 2;
getModel
in interface TranslationOrBuilder
public ByteString getModelBytes()
Only present when `model` is present in the request. `model` here is normalized to have project number. For example: If the `model` requested in TranslationTextRequest is `projects/{project-id}/locations/{location-id}/models/general/nmt` then `model` here would be normalized to `projects/{project-number}/locations/{location-id}/models/general/nmt`.
string model = 2;
getModelBytes
in interface TranslationOrBuilder
public String getDetectedLanguageCode()
The BCP-47 language code of source text in the initial request, detected automatically, if no source language was passed within the initial request. If the source language was passed, auto-detection of the language does not occur and this field is empty.
string detected_language_code = 4;
getDetectedLanguageCode
in interface TranslationOrBuilder
public ByteString getDetectedLanguageCodeBytes()
The BCP-47 language code of source text in the initial request, detected automatically, if no source language was passed within the initial request. If the source language was passed, auto-detection of the language does not occur and this field is empty.
string detected_language_code = 4;
getDetectedLanguageCodeBytes
in interface TranslationOrBuilder
public boolean hasGlossaryConfig()
The `glossary_config` used for this translation.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 3;
hasGlossaryConfig
in interface TranslationOrBuilder
public TranslateTextGlossaryConfig getGlossaryConfig()
The `glossary_config` used for this translation.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 3;
getGlossaryConfig
in interface TranslationOrBuilder
public TranslateTextGlossaryConfigOrBuilder getGlossaryConfigOrBuilder()
The `glossary_config` used for this translation.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 3;
getGlossaryConfigOrBuilder
in interface TranslationOrBuilder
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3
public void writeTo(CodedOutputStream output) throws IOException
writeTo
in interface MessageLite
writeTo
in class GeneratedMessageV3
IOException
public int getSerializedSize()
getSerializedSize
in interface MessageLite
getSerializedSize
in class GeneratedMessageV3
public boolean equals(Object obj)
equals
in interface Message
equals
in class AbstractMessage
public int hashCode()
hashCode
in interface Message
hashCode
in class AbstractMessage
public static Translation parseFrom(ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Translation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Translation parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Translation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Translation parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Translation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Translation parseFrom(InputStream input) throws IOException
IOException
public static Translation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static Translation parseDelimitedFrom(InputStream input) throws IOException
IOException
public static Translation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static Translation parseFrom(CodedInputStream input) throws IOException
IOException
public static Translation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public Translation.Builder newBuilderForType()
newBuilderForType
in interface Message
newBuilderForType
in interface MessageLite
public static Translation.Builder newBuilder()
public static Translation.Builder newBuilder(Translation prototype)
public Translation.Builder toBuilder()
toBuilder
in interface Message
toBuilder
in interface MessageLite
protected Translation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class GeneratedMessageV3
public static Translation getDefaultInstance()
public static Parser<Translation> parser()
public Parser<Translation> getParserForType()
getParserForType
in interface Message
getParserForType
in interface MessageLite
getParserForType
in class GeneratedMessageV3
public Translation getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
Copyright © 2022 Google LLC. All rights reserved.