lib/google/cloud/app_engine/v1/services/rest/operations.rb in google-cloud-app_engine-v1-0.7.0 vs lib/google/cloud/app_engine/v1/services/rest/operations.rb in google-cloud-app_engine-v1-0.8.0
- old
+ new
@@ -134,10 +134,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
@@ -199,10 +219,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
@@ -265,10 +308,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
@@ -336,9 +395,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