lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/operations.rb in google-cloud-bigtable-admin-v2-0.7.0 vs lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/operations.rb in google-cloud-bigtable-admin-v2-0.7.1
- old
+ new
@@ -142,10 +142,31 @@
#
# @return [::Gapic::PagedEnumerable<::Gapic::Operation>]
#
# @raise [::Google::Cloud::Error] if the RPC is aborted.
#
+ # @example Basic example
+ # require "google/longrunning"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Longrunning::Operations::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Longrunning::ListOperationsRequest.new
+ #
+ # # Call the list_operations method.
+ # result = client.list_operations 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::Longrunning::Operation.
+ # p response
+ # end
+ #
def list_operations request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest
@@ -159,13 +180,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::Bigtable::Admin::V2::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.list_operations.timeout,
metadata: metadata,
@@ -214,10 +237,32 @@
#
# @return [::Gapic::Operation]
#
# @raise [::Google::Cloud::Error] if the RPC is aborted.
#
+ # @example Basic example
+ # require "google/longrunning"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Longrunning::Operations::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Longrunning::GetOperationRequest.new
+ #
+ # # Call the get_operation method.
+ # result = client.get_operation 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 get_operation request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest
@@ -231,13 +276,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::Bigtable::Admin::V2::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_operation.timeout,
metadata: metadata,
@@ -286,10 +333,25 @@
#
# @return [::Google::Protobuf::Empty]
#
# @raise [::Google::Cloud::Error] if the RPC is aborted.
#
+ # @example Basic example
+ # require "google/longrunning"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Longrunning::Operations::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Longrunning::DeleteOperationRequest.new
+ #
+ # # Call the delete_operation method.
+ # result = client.delete_operation request
+ #
+ # # The returned object is of type Google::Protobuf::Empty.
+ # p result
+ #
def delete_operation request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest
@@ -303,13 +365,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::Bigtable::Admin::V2::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_operation.timeout,
metadata: metadata,
@@ -363,10 +427,25 @@
#
# @return [::Google::Protobuf::Empty]
#
# @raise [::Google::Cloud::Error] if the RPC is aborted.
#
+ # @example Basic example
+ # require "google/longrunning"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Longrunning::Operations::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Longrunning::CancelOperationRequest.new
+ #
+ # # Call the cancel_operation method.
+ # result = client.cancel_operation request
+ #
+ # # The returned object is of type Google::Protobuf::Empty.
+ # p result
+ #
def cancel_operation request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest
@@ -380,13 +459,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::Bigtable::Admin::V2::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.cancel_operation.timeout,
metadata: metadata,
@@ -442,9 +523,31 @@
# @yieldparam operation [::GRPC::ActiveCall::Operation]
#
# @return [::Gapic::Operation]
#
# @raise [::Google::Cloud::Error] if the RPC is aborted.
+ #
+ # @example Basic example
+ # require "google/longrunning"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Longrunning::Operations::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Longrunning::WaitOperationRequest.new
+ #
+ # # Call the wait_operation method.
+ # result = client.wait_operation 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 wait_operation request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest