Module: Google::Cloud::EssentialContacts::V1::EssentialContactsService::Paths
- Extended by:
- Paths
- Defined in:
- lib/google/cloud/essential_contacts/v1/essential_contacts_service/paths.rb
Overview
Path helper methods for the EssentialContactsService API.
Instance Method Summary collapse
-
#contact_path(**args) ⇒ ::String
Create a fully-qualified Contact resource string.
-
#folder_path(folder:) ⇒ ::String
Create a fully-qualified Folder 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
#contact_path(project: , contact: ) ⇒ ::String #contact_path(folder: , contact: ) ⇒ ::String #contact_path(organization: , contact: ) ⇒ ::String
Create a fully-qualified Contact resource string.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/google/cloud/essential_contacts/v1/essential_contacts_service/paths.rb', line 55 def contact_path **args resources = { "contact:project" => (proc do |project:, contact:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/contacts/#{contact}" end), "contact:folder" => (proc do |folder:, contact:| raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" "folders/#{folder}/contacts/#{contact}" end), "contact:organization" => (proc do |organization:, contact:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/contacts/#{contact}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end |
#folder_path(folder:) ⇒ ::String
Create a fully-qualified Folder resource string.
The resource will be in the following format:
folders/{folder}
89 90 91 |
# File 'lib/google/cloud/essential_contacts/v1/essential_contacts_service/paths.rb', line 89 def folder_path folder: "folders/#{folder}" 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/essential_contacts/v1/essential_contacts_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/essential_contacts/v1/essential_contacts_service/paths.rb', line 117 def project_path project: "projects/#{project}" end |