Class RecognitionAudio.Builder

  • All Implemented Interfaces:
    RecognitionAudioOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    RecognitionAudio

    public static final class RecognitionAudio.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<RecognitionAudio.Builder>
    implements RecognitionAudioOrBuilder
     Contains audio data in the encoding specified in the `RecognitionConfig`.
     Either `content` or `uri` must be supplied. Supplying both or neither
     returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
     See [content limits](https://cloud.google.com/speech-to-text/quotas#content).
     
    Protobuf type google.cloud.speech.v1.RecognitionAudio
    • Method Detail

      • getDescriptor

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

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

        public RecognitionAudio.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.GeneratedMessageV3.Builder<RecognitionAudio.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.GeneratedMessageV3.Builder<RecognitionAudio.Builder>
      • getDefaultInstanceForType

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

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

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

        public RecognitionAudio.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionAudio.Builder>
      • setField

        public RecognitionAudio.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                 Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionAudio.Builder>
      • clearField

        public RecognitionAudio.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionAudio.Builder>
      • clearOneof

        public RecognitionAudio.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionAudio.Builder>
      • setRepeatedField

        public RecognitionAudio.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                         int index,
                                                         Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionAudio.Builder>
      • addRepeatedField

        public RecognitionAudio.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                         Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionAudio.Builder>
      • mergeFrom

        public RecognitionAudio.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<RecognitionAudio.Builder>
      • isInitialized

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

        public RecognitionAudio.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<RecognitionAudio.Builder>
        Throws:
        IOException
      • hasContent

        public boolean hasContent()
         The audio data bytes encoded as specified in
         `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
         pure binary representation, whereas JSON representations use base64.
         
        bytes content = 1;
        Specified by:
        hasContent in interface RecognitionAudioOrBuilder
        Returns:
        Whether the content field is set.
      • getContent

        public com.google.protobuf.ByteString getContent()
         The audio data bytes encoded as specified in
         `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
         pure binary representation, whereas JSON representations use base64.
         
        bytes content = 1;
        Specified by:
        getContent in interface RecognitionAudioOrBuilder
        Returns:
        The content.
      • setContent

        public RecognitionAudio.Builder setContent​(com.google.protobuf.ByteString value)
         The audio data bytes encoded as specified in
         `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
         pure binary representation, whereas JSON representations use base64.
         
        bytes content = 1;
        Parameters:
        value - The content to set.
        Returns:
        This builder for chaining.
      • clearContent

        public RecognitionAudio.Builder clearContent()
         The audio data bytes encoded as specified in
         `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
         pure binary representation, whereas JSON representations use base64.
         
        bytes content = 1;
        Returns:
        This builder for chaining.
      • hasUri

        public boolean hasUri()
         URI that points to a file that contains audio data bytes as specified in
         `RecognitionConfig`. The file must not be compressed (for example, gzip).
         Currently, only Google Cloud Storage URIs are
         supported, which must be specified in the following format:
         `gs://bucket_name/object_name` (other URI formats return
         [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
         For more information, see [Request
         URIs](https://cloud.google.com/storage/docs/reference-uris).
         
        string uri = 2;
        Specified by:
        hasUri in interface RecognitionAudioOrBuilder
        Returns:
        Whether the uri field is set.
      • getUri

        public String getUri()
         URI that points to a file that contains audio data bytes as specified in
         `RecognitionConfig`. The file must not be compressed (for example, gzip).
         Currently, only Google Cloud Storage URIs are
         supported, which must be specified in the following format:
         `gs://bucket_name/object_name` (other URI formats return
         [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
         For more information, see [Request
         URIs](https://cloud.google.com/storage/docs/reference-uris).
         
        string uri = 2;
        Specified by:
        getUri in interface RecognitionAudioOrBuilder
        Returns:
        The uri.
      • getUriBytes

        public com.google.protobuf.ByteString getUriBytes()
         URI that points to a file that contains audio data bytes as specified in
         `RecognitionConfig`. The file must not be compressed (for example, gzip).
         Currently, only Google Cloud Storage URIs are
         supported, which must be specified in the following format:
         `gs://bucket_name/object_name` (other URI formats return
         [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
         For more information, see [Request
         URIs](https://cloud.google.com/storage/docs/reference-uris).
         
        string uri = 2;
        Specified by:
        getUriBytes in interface RecognitionAudioOrBuilder
        Returns:
        The bytes for uri.
      • setUri

        public RecognitionAudio.Builder setUri​(String value)
         URI that points to a file that contains audio data bytes as specified in
         `RecognitionConfig`. The file must not be compressed (for example, gzip).
         Currently, only Google Cloud Storage URIs are
         supported, which must be specified in the following format:
         `gs://bucket_name/object_name` (other URI formats return
         [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
         For more information, see [Request
         URIs](https://cloud.google.com/storage/docs/reference-uris).
         
        string uri = 2;
        Parameters:
        value - The uri to set.
        Returns:
        This builder for chaining.
      • clearUri

        public RecognitionAudio.Builder clearUri()
         URI that points to a file that contains audio data bytes as specified in
         `RecognitionConfig`. The file must not be compressed (for example, gzip).
         Currently, only Google Cloud Storage URIs are
         supported, which must be specified in the following format:
         `gs://bucket_name/object_name` (other URI formats return
         [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
         For more information, see [Request
         URIs](https://cloud.google.com/storage/docs/reference-uris).
         
        string uri = 2;
        Returns:
        This builder for chaining.
      • setUriBytes

        public RecognitionAudio.Builder setUriBytes​(com.google.protobuf.ByteString value)
         URI that points to a file that contains audio data bytes as specified in
         `RecognitionConfig`. The file must not be compressed (for example, gzip).
         Currently, only Google Cloud Storage URIs are
         supported, which must be specified in the following format:
         `gs://bucket_name/object_name` (other URI formats return
         [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
         For more information, see [Request
         URIs](https://cloud.google.com/storage/docs/reference-uris).
         
        string uri = 2;
        Parameters:
        value - The bytes for uri to set.
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final RecognitionAudio.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionAudio.Builder>
      • mergeUnknownFields

        public final RecognitionAudio.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionAudio.Builder>