lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest/client.rb in google-cloud-commerce-consumer-procurement-v1-0.1.0 vs lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest/client.rb in google-cloud-commerce-consumer-procurement-v1-0.2.0
- old
+ new
@@ -217,10 +217,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/commerce/consumer/procurement/v1"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Rest::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Cloud::Commerce::Consumer::Procurement::V1::PlaceOrderRequest.new
+ #
+ # # Call the place_order method.
+ # result = client.place_order 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 place_order request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Commerce::Consumer::Procurement::V1::PlaceOrderRequest
@@ -281,10 +304,26 @@
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Google::Cloud::Commerce::Consumer::Procurement::V1::Order]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
+ #
+ # @example Basic example
+ # require "google/cloud/commerce/consumer/procurement/v1"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Rest::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Cloud::Commerce::Consumer::Procurement::V1::GetOrderRequest.new
+ #
+ # # Call the get_order method.
+ # result = client.get_order request
+ #
+ # # The returned object is of type Google::Cloud::Commerce::Consumer::Procurement::V1::Order.
+ # p result
+ #
def get_order request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Commerce::Consumer::Procurement::V1::GetOrderRequest
@@ -368,9 +407,29 @@
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Commerce::Consumer::Procurement::V1::Order>]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
+ #
+ # @example Basic example
+ # require "google/cloud/commerce/consumer/procurement/v1"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Rest::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Cloud::Commerce::Consumer::Procurement::V1::ListOrdersRequest.new
+ #
+ # # Call the list_orders method.
+ # result = client.list_orders 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::Commerce::Consumer::Procurement::V1::Order.
+ # p item
+ # end
+ #
def list_orders request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Commerce::Consumer::Procurement::V1::ListOrdersRequest