Module: Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Paths
- Extended by:
- Paths
- Included in:
- Client, Paths, Rest::Client
- Defined in:
- lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/paths.rb
Overview
Path helper methods for the ConsumerProcurementService API.
Instance Method Summary collapse
-
#billing_account_path(billing_account:) ⇒ ::String
Create a fully-qualified BillingAccount resource string.
-
#offer_path(**args) ⇒ ::String
Create a fully-qualified Offer resource string.
Instance Method Details
#billing_account_path(billing_account:) ⇒ ::String
Create a fully-qualified BillingAccount resource string.
The resource will be in the following format:
billingAccounts/{billing_account}
39 40 41 |
# File 'lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/paths.rb', line 39 def billing_account_path billing_account: "billingAccounts/#{billing_account}" end |
#offer_path(service: , offer: ) ⇒ ::String #offer_path(consumer_billing_account: , offer: ) ⇒ ::String
Create a fully-qualified Offer resource string.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/paths.rb', line 63 def offer_path **args resources = { "offer:service" => (proc do |service:, offer:| raise ::ArgumentError, "service cannot contain /" if service.to_s.include? "/" "services/#{service}/standardOffers/#{offer}" end), "consumer_billing_account:offer" => (proc do |consumer_billing_account:, offer:| raise ::ArgumentError, "consumer_billing_account cannot contain /" if consumer_billing_account.to_s.include? "/" "billingAccounts/#{consumer_billing_account}/offers/#{offer}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end |