Class InputConfig.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<InputConfig.Builder>
com.google.cloud.translate.v3.InputConfig.Builder
All Implemented Interfaces:
InputConfigOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
InputConfig

public static final class InputConfig.Builder extends com.google.protobuf.GeneratedMessage.Builder<InputConfig.Builder> implements InputConfigOrBuilder
 Input configuration for BatchTranslateText request.
 
Protobuf type google.cloud.translation.v3.InputConfig
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<InputConfig.Builder>
    • clear

      public InputConfig.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<InputConfig.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<InputConfig.Builder>
    • getDefaultInstanceForType

      public InputConfig getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public InputConfig build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public InputConfig buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public InputConfig.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<InputConfig.Builder>
    • mergeFrom

      public InputConfig.Builder mergeFrom(InputConfig other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<InputConfig.Builder>
    • mergeFrom

      public InputConfig.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<InputConfig.Builder>
      Throws:
      IOException
    • getSourceCase

      public InputConfig.SourceCase getSourceCase()
      Specified by:
      getSourceCase in interface InputConfigOrBuilder
    • clearSource

      public InputConfig.Builder clearSource()
    • 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];
      Specified by:
      getMimeType in interface InputConfigOrBuilder
      Returns:
      The mimeType.
    • getMimeTypeBytes

      public com.google.protobuf.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];
      Specified by:
      getMimeTypeBytes in interface InputConfigOrBuilder
      Returns:
      The bytes for mimeType.
    • setMimeType

      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];
      Parameters:
      value - The mimeType to set.
      Returns:
      This builder for chaining.
    • 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:
      This builder for chaining.
    • setMimeTypeBytes

      public InputConfig.Builder setMimeTypeBytes(com.google.protobuf.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];
      Parameters:
      value - The bytes for mimeType to set.
      Returns:
      This builder for chaining.
    • 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.v3.GcsSource gcs_source = 2;
      Specified by:
      hasGcsSource in interface InputConfigOrBuilder
      Returns:
      Whether the gcsSource field is set.
    • 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.v3.GcsSource gcs_source = 2;
      Specified by:
      getGcsSource in interface InputConfigOrBuilder
      Returns:
      The gcsSource.
    • setGcsSource

      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;
    • setGcsSource

      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;
    • mergeGcsSource

      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;
    • 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.v3.GcsSource gcs_source = 2;
    • 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.v3.GcsSource gcs_source = 2;
    • 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.v3.GcsSource gcs_source = 2;
      Specified by:
      getGcsSourceOrBuilder in interface InputConfigOrBuilder