lib/google/cloud/automl/v1beta1/prediction_service/rest/client.rb in google-cloud-automl-v1beta1-0.8.0 vs lib/google/cloud/automl/v1beta1/prediction_service/rest/client.rb in google-cloud-automl-v1beta1-0.9.0

- old
+ new

@@ -222,10 +222,26 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::AutoML::V1beta1::PredictResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/automl/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AutoML::V1beta1::PredictionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AutoML::V1beta1::PredictRequest.new + # + # # Call the predict method. + # result = client.predict request + # + # # The returned object is of type Google::Cloud::AutoML::V1beta1::PredictResponse. + # p result + # def predict request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::PredictRequest @@ -371,9 +387,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/automl/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AutoML::V1beta1::PredictionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AutoML::V1beta1::BatchPredictRequest.new + # + # # Call the batch_predict method. + # result = client.batch_predict 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 batch_predict request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::BatchPredictRequest