Module: Google::Cloud::Billing::V1::CloudBilling::Paths
- Extended by:
- Paths
- Included in:
- Client, Paths, Rest::Client
- Defined in:
- lib/google/cloud/billing/v1/cloud_billing/paths.rb
Overview
Path helper methods for the CloudBilling API.
Instance Method Summary collapse
-
#billing_account_path(**args) ⇒ ::String
Create a fully-qualified BillingAccount resource string.
-
#organization_path(organization:) ⇒ ::String
Create a fully-qualified Organization resource string.
-
#project_billing_info_path(project:) ⇒ ::String
Create a fully-qualified ProjectBillingInfo resource string.
-
#project_path(project:) ⇒ ::String
Create a fully-qualified Project resource string.
Instance Method Details
#billing_account_path(billing_account: ) ⇒ ::String #billing_account_path(organization: , billing_account: ) ⇒ ::String
Create a fully-qualified BillingAccount resource string.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/google/cloud/billing/v1/cloud_billing/paths.rb', line 46 def billing_account_path **args resources = { "billing_account" => (proc do |billing_account:| "billingAccounts/#{billing_account}" end), "billing_account:organization" => (proc do |organization:, billing_account:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/billingAccounts/#{billing_account}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end |
#organization_path(organization:) ⇒ ::String
Create a fully-qualified Organization resource string.
The resource will be in the following format:
organizations/{organization}
73 74 75 |
# File 'lib/google/cloud/billing/v1/cloud_billing/paths.rb', line 73 def organization_path organization: "organizations/#{organization}" end |
#project_billing_info_path(project:) ⇒ ::String
Create a fully-qualified ProjectBillingInfo resource string.
The resource will be in the following format:
projects/{project}/billingInfo
101 102 103 |
# File 'lib/google/cloud/billing/v1/cloud_billing/paths.rb', line 101 def project_billing_info_path project: "projects/#{project}/billingInfo" end |
#project_path(project:) ⇒ ::String
Create a fully-qualified Project resource string.
The resource will be in the following format:
projects/{project}
87 88 89 |
# File 'lib/google/cloud/billing/v1/cloud_billing/paths.rb', line 87 def project_path project: "projects/#{project}" end |