Method: Google::Cloud::Support::V2::CommentService::Paths#comment_path
- Defined in:
- lib/google/cloud/support/v2/comment_service/paths.rb
#comment_path(organization: ) ⇒ ::String #comment_path(project: ) ⇒ ::String
Create a fully-qualified Comment resource string.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/google/cloud/support/v2/comment_service/paths.rb', line 88 def comment_path **args resources = { "case:comment:organization" => (proc do |organization:, case:, comment:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" "organizations/#{organization}/cases/#{binding.local_variable_get :case}/comments/#{comment}" end), "case:comment:project" => (proc do |project:, case:, comment:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" "projects/#{project}/cases/#{binding.local_variable_get :case}/comments/#{comment}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end |