lib/google/cloud/dataproc/v1/job_controller/rest/client.rb in google-cloud-dataproc-v1-0.19.0 vs lib/google/cloud/dataproc/v1/job_controller/rest/client.rb in google-cloud-dataproc-v1-0.20.0

- old
+ new

@@ -239,10 +239,26 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Dataproc::V1::Job] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new + # + # # Call the submit_job method. + # result = client.submit_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # def submit_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::SubmitJobRequest @@ -319,10 +335,33 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new + # + # # Call the submit_job_as_operation method. + # result = client.submit_job_as_operation 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 submit_job_as_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::SubmitJobRequest @@ -387,10 +426,26 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Dataproc::V1::Job] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # def get_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetJobRequest @@ -480,10 +535,30 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Job>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::Job. + # p item + # end + # def list_jobs request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListJobsRequest @@ -557,10 +632,26 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Dataproc::V1::Job] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # def update_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateJobRequest @@ -628,10 +719,26 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Dataproc::V1::Job] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CancelJobRequest.new + # + # # Call the cancel_job method. + # result = client.cancel_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # def cancel_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CancelJobRequest @@ -696,9 +803,25 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteJobRequest