Class InputConfig.Builder (2.44.0)

public static final class InputConfig.Builder extends GeneratedMessageV3.Builder<InputConfig.Builder> implements InputConfigOrBuilder

Input configuration for BatchTranslateText request.

Protobuf type google.cloud.translation.v3beta1.InputConfig

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public InputConfig build()
Returns
Type Description
InputConfig

buildPartial()

public InputConfig buildPartial()
Returns
Type Description
InputConfig

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearGcsSource()

public InputConfig.Builder clearGcsSource()

Required. Google Cloud Storage location for the source input. This can be a single file (for example, gs://translation-test/input.tsv) or a wildcard (for example, gs://translation-test/*). If a file extension is .tsv, it can contain either one or two columns. The first column (optional) is the id of the text request. If the first column is missing, we use the row number (0-based) from the input file as the ID in the output file. The second column is the actual text to be translated. We recommend each row be <= 10K Unicode codepoints, otherwise an error might be returned. Note that the input tsv must be RFC 4180 compliant.

You could use https://github.com/Clever/csvlint to check potential formatting errors in your tsv file. csvlint --delimiter='\t' your_input_file.tsv

The other supported file extensions are .txt or .html, which is treated as a single large chunk of text.

.google.cloud.translation.v3beta1.GcsSource gcs_source = 2;

Returns
Type Description
InputConfig.Builder

clearMimeType()

public InputConfig.Builder clearMimeType()

Optional. Can be "text/plain" or "text/html". For .tsv, "text/html" is used if mime_type is missing. For .html, this field must be "text/html" or empty. For .txt, this field must be "text/plain" or empty.

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

Returns
Type Description
InputConfig.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearSource()

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

clone()

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

getDefaultInstanceForType()

public InputConfig getDefaultInstanceForType()
Returns
Type Description
InputConfig

getDescriptorForType()

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

getGcsSource()

public GcsSource getGcsSource()

Required. Google Cloud Storage location for the source input. This can be a single file (for example, gs://translation-test/input.tsv) or a wildcard (for example, gs://translation-test/*). If a file extension is .tsv, it can contain either one or two columns. The first column (optional) is the id of the text request. If the first column is missing, we use the row number (0-based) from the input file as the ID in the output file. The second column is the actual text to be translated. We recommend each row be <= 10K Unicode codepoints, otherwise an error might be returned. Note that the input tsv must be RFC 4180 compliant.

You could use https://github.com/Clever/csvlint to check potential formatting errors in your tsv file. csvlint --delimiter='\t' your_input_file.tsv

The other supported file extensions are .txt or .html, which is treated as a single large chunk of text.

.google.cloud.translation.v3beta1.GcsSource gcs_source = 2;

Returns
Type Description
GcsSource

The gcsSource.

getGcsSourceBuilder()

public GcsSource.Builder getGcsSourceBuilder()

Required. Google Cloud Storage location for the source input. This can be a single file (for example, gs://translation-test/input.tsv) or a wildcard (for example, gs://translation-test/*). If a file extension is .tsv, it can contain either one or two columns. The first column (optional) is the id of the text request. If the first column is missing, we use the row number (0-based) from the input file as the ID in the output file. The second column is the actual text to be translated. We recommend each row be <= 10K Unicode codepoints, otherwise an error might be returned. Note that the input tsv must be RFC 4180 compliant.

You could use https://github.com/Clever/csvlint to check potential formatting errors in your tsv file. csvlint --delimiter='\t' your_input_file.tsv

The other supported file extensions are .txt or .html, which is treated as a single large chunk of text.

.google.cloud.translation.v3beta1.GcsSource gcs_source = 2;

Returns
Type Description
GcsSource.Builder

getGcsSourceOrBuilder()

public GcsSourceOrBuilder getGcsSourceOrBuilder()

Required. Google Cloud Storage location for the source input. This can be a single file (for example, gs://translation-test/input.tsv) or a wildcard (for example, gs://translation-test/*). If a file extension is .tsv, it can contain either one or two columns. The first column (optional) is the id of the text request. If the first column is missing, we use the row number (0-based) from the input file as the ID in the output file. The second column is the actual text to be translated. We recommend each row be <= 10K Unicode codepoints, otherwise an error might be returned. Note that the input tsv must be RFC 4180 compliant.

You could use https://github.com/Clever/csvlint to check potential formatting errors in your tsv file. csvlint --delimiter='\t' your_input_file.tsv

The other supported file extensions are .txt or .html, which is treated as a single large chunk of text.

.google.cloud.translation.v3beta1.GcsSource gcs_source = 2;

Returns
Type Description
GcsSourceOrBuilder

getMimeType()

public String getMimeType()

Optional. Can be "text/plain" or "text/html". For .tsv, "text/html" is used if mime_type is missing. For .html, this field must be "text/html" or empty. For .txt, this field must be "text/plain" or empty.

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

Returns
Type Description
String

The mimeType.

getMimeTypeBytes()

public ByteString getMimeTypeBytes()

Optional. Can be "text/plain" or "text/html". For .tsv, "text/html" is used if mime_type is missing. For .html, this field must be "text/html" or empty. For .txt, this field must be "text/plain" or empty.

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

Returns
Type Description
ByteString

The bytes for mimeType.

getSourceCase()

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

hasGcsSource()

public boolean hasGcsSource()

Required. Google Cloud Storage location for the source input. This can be a single file (for example, gs://translation-test/input.tsv) or a wildcard (for example, gs://translation-test/*). If a file extension is .tsv, it can contain either one or two columns. The first column (optional) is the id of the text request. If the first column is missing, we use the row number (0-based) from the input file as the ID in the output file. The second column is the actual text to be translated. We recommend each row be <= 10K Unicode codepoints, otherwise an error might be returned. Note that the input tsv must be RFC 4180 compliant.

You could use https://github.com/Clever/csvlint to check potential formatting errors in your tsv file. csvlint --delimiter='\t' your_input_file.tsv

The other supported file extensions are .txt or .html, which is treated as a single large chunk of text.

.google.cloud.translation.v3beta1.GcsSource gcs_source = 2;

Returns
Type Description
boolean

Whether the gcsSource field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(InputConfig other)

public InputConfig.Builder mergeFrom(InputConfig other)
Parameter
Name Description
other InputConfig
Returns
Type Description
InputConfig.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public InputConfig.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
InputConfig.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public InputConfig.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
InputConfig.Builder
Overrides

mergeGcsSource(GcsSource value)

public InputConfig.Builder mergeGcsSource(GcsSource value)

Required. Google Cloud Storage location for the source input. This can be a single file (for example, gs://translation-test/input.tsv) or a wildcard (for example, gs://translation-test/*). If a file extension is .tsv, it can contain either one or two columns. The first column (optional) is the id of the text request. If the first column is missing, we use the row number (0-based) from the input file as the ID in the output file. The second column is the actual text to be translated. We recommend each row be <= 10K Unicode codepoints, otherwise an error might be returned. Note that the input tsv must be RFC 4180 compliant.

You could use https://github.com/Clever/csvlint to check potential formatting errors in your tsv file. csvlint --delimiter='\t' your_input_file.tsv

The other supported file extensions are .txt or .html, which is treated as a single large chunk of text.

.google.cloud.translation.v3beta1.GcsSource gcs_source = 2;

Parameter
Name Description
value GcsSource
Returns
Type Description
InputConfig.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final InputConfig.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
InputConfig.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

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

setGcsSource(GcsSource value)

public InputConfig.Builder setGcsSource(GcsSource value)

Required. Google Cloud Storage location for the source input. This can be a single file (for example, gs://translation-test/input.tsv) or a wildcard (for example, gs://translation-test/*). If a file extension is .tsv, it can contain either one or two columns. The first column (optional) is the id of the text request. If the first column is missing, we use the row number (0-based) from the input file as the ID in the output file. The second column is the actual text to be translated. We recommend each row be <= 10K Unicode codepoints, otherwise an error might be returned. Note that the input tsv must be RFC 4180 compliant.

You could use https://github.com/Clever/csvlint to check potential formatting errors in your tsv file. csvlint --delimiter='\t' your_input_file.tsv

The other supported file extensions are .txt or .html, which is treated as a single large chunk of text.

.google.cloud.translation.v3beta1.GcsSource gcs_source = 2;

Parameter
Name Description
value GcsSource
Returns
Type Description
InputConfig.Builder

setGcsSource(GcsSource.Builder builderForValue)

public InputConfig.Builder setGcsSource(GcsSource.Builder builderForValue)

Required. Google Cloud Storage location for the source input. This can be a single file (for example, gs://translation-test/input.tsv) or a wildcard (for example, gs://translation-test/*). If a file extension is .tsv, it can contain either one or two columns. The first column (optional) is the id of the text request. If the first column is missing, we use the row number (0-based) from the input file as the ID in the output file. The second column is the actual text to be translated. We recommend each row be <= 10K Unicode codepoints, otherwise an error might be returned. Note that the input tsv must be RFC 4180 compliant.

You could use https://github.com/Clever/csvlint to check potential formatting errors in your tsv file. csvlint --delimiter='\t' your_input_file.tsv

The other supported file extensions are .txt or .html, which is treated as a single large chunk of text.

.google.cloud.translation.v3beta1.GcsSource gcs_source = 2;

Parameter
Name Description
builderForValue GcsSource.Builder
Returns
Type Description
InputConfig.Builder

setMimeType(String value)

public InputConfig.Builder setMimeType(String value)

Optional. Can be "text/plain" or "text/html". For .tsv, "text/html" is used if mime_type is missing. For .html, this field must be "text/html" or empty. For .txt, this field must be "text/plain" or empty.

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

Parameter
Name Description
value String

The mimeType to set.

Returns
Type Description
InputConfig.Builder

This builder for chaining.

setMimeTypeBytes(ByteString value)

public InputConfig.Builder setMimeTypeBytes(ByteString value)

Optional. Can be "text/plain" or "text/html". For .tsv, "text/html" is used if mime_type is missing. For .html, this field must be "text/html" or empty. For .txt, this field must be "text/plain" or empty.

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

Parameter
Name Description
value ByteString

The bytes for mimeType to set.

Returns
Type Description
InputConfig.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public InputConfig.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
InputConfig.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final InputConfig.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
InputConfig.Builder
Overrides