lib/google/cloud/dataproc/v1/batch_controller/client.rb in google-cloud-dataproc-v1-0.7.0 vs lib/google/cloud/dataproc/v1/batch_controller/client.rb in google-cloud-dataproc-v1-0.7.1
- old
+ new
@@ -203,10 +203,32 @@
#
# @return [::Gapic::Operation]
#
# @raise [::Google::Cloud::Error] if the RPC 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::BatchController::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Cloud::Dataproc::V1::CreateBatchRequest.new
+ #
+ # # Call the create_batch method.
+ # result = client.create_batch request
+ #
+ # # The returned object is of type Gapic::Operation. You can use this
+ # # object to check the status of an operation, cancel it, or wait
+ # # for results. Here is how to block until completion:
+ # result.wait_until_done! timeout: 60
+ # if result.response?
+ # p result.response
+ # else
+ # puts "Error!"
+ # end
+ #
def create_batch request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateBatchRequest
@@ -220,13 +242,15 @@
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
- header_params = {
- "parent" => request.parent
- }
+ header_params = {}
+ if request.parent
+ header_params["parent"] = request.parent
+ end
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.create_batch.timeout,
metadata: metadata,
@@ -272,10 +296,25 @@
#
# @return [::Google::Cloud::Dataproc::V1::Batch]
#
# @raise [::Google::Cloud::Error] if the RPC 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::BatchController::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Cloud::Dataproc::V1::GetBatchRequest.new
+ #
+ # # Call the get_batch method.
+ # result = client.get_batch request
+ #
+ # # The returned object is of type Google::Cloud::Dataproc::V1::Batch.
+ # p result
+ #
def get_batch request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetBatchRequest
@@ -289,13 +328,15 @@
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
- header_params = {
- "name" => request.name
- }
+ header_params = {}
+ if request.name
+ header_params["name"] = request.name
+ end
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.get_batch.timeout,
metadata: metadata,
@@ -347,10 +388,31 @@
#
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Batch>]
#
# @raise [::Google::Cloud::Error] if the RPC 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::BatchController::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Cloud::Dataproc::V1::ListBatchesRequest.new
+ #
+ # # Call the list_batches method.
+ # result = client.list_batches request
+ #
+ # # The returned object is of type Gapic::PagedEnumerable. You can
+ # # iterate over all elements by calling #each, and the enumerable
+ # # will lazily make API calls to fetch subsequent pages. Other
+ # # methods are also available for managing paging directly.
+ # result.each do |response|
+ # # Each element is of type ::Google::Cloud::Dataproc::V1::Batch.
+ # p response
+ # end
+ #
def list_batches request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListBatchesRequest
@@ -364,13 +426,15 @@
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
- header_params = {
- "parent" => request.parent
- }
+ header_params = {}
+ if request.parent
+ header_params["parent"] = request.parent
+ end
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.list_batches.timeout,
metadata: metadata,
@@ -417,10 +481,25 @@
#
# @return [::Google::Protobuf::Empty]
#
# @raise [::Google::Cloud::Error] if the RPC 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::BatchController::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Cloud::Dataproc::V1::DeleteBatchRequest.new
+ #
+ # # Call the delete_batch method.
+ # result = client.delete_batch request
+ #
+ # # The returned object is of type Google::Protobuf::Empty.
+ # p result
+ #
def delete_batch request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteBatchRequest
@@ -434,12 +513,14 @@
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
- header_params = {
- "name" => request.name
- }
+ header_params = {}
+ if request.name
+ header_params["name"] = request.name
+ end
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.delete_batch.timeout,
metadata: metadata,