lib/google/iam/v2/policies/rest/operations.rb in google-iam-v2-0.3.1 vs lib/google/iam/v2/policies/rest/operations.rb in google-iam-v2-0.4.0
- old
+ new
@@ -133,10 +133,30 @@
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Gapic::Operation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
+ #
+ # @example Basic example
+ # require "google/longrunning"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Longrunning::Operations::Rest::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 elements, and API calls will be issued to fetch pages as needed.
+ # result.each do |item|
+ # # Each element is of type ::Google::Longrunning::Operation.
+ # p item
+ # 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
@@ -198,10 +218,33 @@
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Gapic::Operation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
+ #
+ # @example Basic example
+ # require "google/longrunning"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Longrunning::Operations::Rest::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 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 get_operation request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest
@@ -264,10 +307,26 @@
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Google::Protobuf::Empty]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
+ #
+ # @example Basic example
+ # require "google/longrunning"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Longrunning::Operations::Rest::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
@@ -335,9 +394,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/longrunning"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Longrunning::Operations::Rest::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