Module: Google::Cloud::Monitoring::V3::GroupService::Paths
- Extended by:
- Paths
- Defined in:
- lib/google/cloud/monitoring/v3/group_service/paths.rb
Overview
Path helper methods for the GroupService API.
Instance Method Summary collapse
-
#folder_path(folder:) ⇒ ::String
Create a fully-qualified Folder resource string.
-
#group_path(**args) ⇒ ::String
Create a fully-qualified Group resource string.
-
#organization_path(organization:) ⇒ ::String
Create a fully-qualified Organization resource string.
-
#project_path(project:) ⇒ ::String
Create a fully-qualified Project resource string.
-
#workspace_path(**args) ⇒ ::String
Create a fully-qualified Workspace resource string.
Instance Method Details
#folder_path(folder:) ⇒ ::String
Create a fully-qualified Folder resource string.
The resource will be in the following format:
folders/{folder}
37 38 39 |
# File 'lib/google/cloud/monitoring/v3/group_service/paths.rb', line 37 def folder_path folder: "folders/#{folder}" end |
#group_path(project: , group: ) ⇒ ::String #group_path(organization: , group: ) ⇒ ::String #group_path(folder: , group: ) ⇒ ::String
Create a fully-qualified Group resource string.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/google/cloud/monitoring/v3/group_service/paths.rb', line 69 def group_path **args resources = { "group:project" => (proc do |project:, group:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/groups/#{group}" end), "group:organization" => (proc do |organization:, group:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/groups/#{group}" end), "folder:group" => (proc do |folder:, group:| raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" "folders/#{folder}/groups/#{group}" 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}
103 104 105 |
# File 'lib/google/cloud/monitoring/v3/group_service/paths.rb', line 103 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}
117 118 119 |
# File 'lib/google/cloud/monitoring/v3/group_service/paths.rb', line 117 def project_path project: "projects/#{project}" end |
#workspace_path(project: ) ⇒ ::String #workspace_path(workspace: ) ⇒ ::String
Create a fully-qualified Workspace resource string.
139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/google/cloud/monitoring/v3/group_service/paths.rb', line 139 def workspace_path **args resources = { "project" => (proc do |project:| "projects/#{project}" end), "workspace" => (proc do |workspace:| "workspaces/#{workspace}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end |