Method: Google::Cloud::Monitoring::V3::GroupService::Paths#group_path
- Defined in:
- lib/google/cloud/monitoring/v3/group_service/paths.rb
#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 |