public static final class InputConfig.Builder extends GeneratedMessageV3.Builder<InputConfig.Builder> implements InputConfigOrBuilder
Input configuration for BatchTranslateText request.
Protobuf type google.cloud.translation.v3.InputConfig
Static Methods
public static final Descriptors.Descriptor getDescriptor()
Returns
Methods
public InputConfig.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
public InputConfig build()
Returns
public InputConfig buildPartial()
Returns
public InputConfig.Builder clear()
Returns
Overrides
public InputConfig.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
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.v3.GcsSource gcs_source = 2;
Returns
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
public InputConfig.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
Overrides
public InputConfig.Builder clearSource()
Returns
public InputConfig.Builder clone()
Returns
Overrides
public InputConfig getDefaultInstanceForType()
Returns
public Descriptors.Descriptor getDescriptorForType()
Returns
Overrides
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.v3.GcsSource gcs_source = 2;
Returns
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.v3.GcsSource gcs_source = 2;
Returns
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.v3.GcsSource gcs_source = 2;
Returns
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.
|
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
public InputConfig.SourceCase getSourceCase()
Returns
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.v3.GcsSource gcs_source = 2;
Returns
Type | Description |
boolean | Whether the gcsSource field is set.
|
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
public final boolean isInitialized()
Returns
Overrides
public InputConfig.Builder mergeFrom(InputConfig other)
Parameter
Returns
public InputConfig.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
public InputConfig.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
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.v3.GcsSource gcs_source = 2;
Parameter
Returns
public final InputConfig.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides
public InputConfig.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
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.v3.GcsSource gcs_source = 2;
Parameter
Returns
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.v3.GcsSource gcs_source = 2;
Parameter
Returns
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
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
public InputConfig.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
Overrides
public final InputConfig.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides