lib/google/cloud/speech/v1p1beta1/speech/rest/client.rb in google-cloud-speech-v1p1beta1-0.18.1 vs lib/google/cloud/speech/v1p1beta1/speech/rest/client.rb in google-cloud-speech-v1p1beta1-0.19.0

- old
+ new

@@ -184,10 +184,26 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Speech::V1p1beta1::RecognizeResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new + # + # # Call the recognize method. + # result = client.recognize request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::RecognizeResponse. + # p result + # def recognize request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest @@ -256,9 +272,32 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new + # + # # Call the long_running_recognize method. + # result = client.long_running_recognize request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def long_running_recognize request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest