Module: Google::Cloud::Support::V2::CaseService::Paths
- Extended by:
- Paths
- Defined in:
- lib/google/cloud/support/v2/case_service/paths.rb
Overview
Path helper methods for the CaseService API.
Instance Method Summary collapse
-
#case_path(**args) ⇒ ::String
Create a fully-qualified Case 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
#case_path(organization: ) ⇒ ::String #case_path(project: ) ⇒ ::String
Create a fully-qualified Case resource string.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/google/cloud/support/v2/case_service/paths.rb', line 47 def case_path **args resources = { "case:organization" => (proc do |organization:, case:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/cases/#{binding.local_variable_get :case}" end), "case:project" => (proc do |project:, case:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/cases/#{binding.local_variable_get :case}" 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}
76 77 78 |
# File 'lib/google/cloud/support/v2/case_service/paths.rb', line 76 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}
90 91 92 |
# File 'lib/google/cloud/support/v2/case_service/paths.rb', line 90 def project_path project: "projects/#{project}" end |