Module: Google::Cloud::Logging::V2::LoggingService::Paths
- Extended by:
- Paths
- Defined in:
- lib/google/cloud/logging/v2/logging_service/paths.rb
Overview
Path helper methods for the LoggingService API.
Instance Method Summary collapse
-
#billing_account_path(billing_account:) ⇒ ::String
Create a fully-qualified BillingAccount resource string.
-
#folder_path(folder:) ⇒ ::String
Create a fully-qualified Folder resource string.
-
#log_path(**args) ⇒ ::String
Create a fully-qualified Log resource string.
-
#organization_path(organization:) ⇒ ::String
Create a fully-qualified Organization resource string.
-
#project_path(project:) ⇒ ::String
Create a fully-qualified Project 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}
37 38 39 |
# File 'lib/google/cloud/logging/v2/logging_service/paths.rb', line 37 def billing_account_path billing_account: "billingAccounts/#{billing_account}" end |
#folder_path(folder:) ⇒ ::String
Create a fully-qualified Folder resource string.
The resource will be in the following format:
folders/{folder}
51 52 53 |
# File 'lib/google/cloud/logging/v2/logging_service/paths.rb', line 51 def folder_path folder: "folders/#{folder}" end |
#log_path(project: , log: ) ⇒ ::String #log_path(organization: , log: ) ⇒ ::String #log_path(folder: , log: ) ⇒ ::String #log_path(billing_account: , log: ) ⇒ ::String
Create a fully-qualified Log resource string.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/google/cloud/logging/v2/logging_service/paths.rb', line 91 def log_path **args resources = { "log:project" => (proc do |project:, log:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/logs/#{log}" end), "log:organization" => (proc do |organization:, log:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/logs/#{log}" end), "folder:log" => (proc do |folder:, log:| raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" "folders/#{folder}/logs/#{log}" end), "billing_account:log" => (proc do |billing_account:, log:| raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" "billingAccounts/#{billing_account}/logs/#{log}" 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}
130 131 132 |
# File 'lib/google/cloud/logging/v2/logging_service/paths.rb', line 130 def organization_path organization: "organizations/#{organization}" end |
#project_path(project:) ⇒ ::String
Create a fully-qualified Project resource string.
The resource will be in the following format:
projects/{project}
144 145 146 |
# File 'lib/google/cloud/logging/v2/logging_service/paths.rb', line 144 def project_path project: "projects/#{project}" end |