Module: Google::Cloud::DiscoveryEngine::V1::AssistantService::Paths
- Extended by:
- Paths
- Included in:
- Client, Paths, Rest::Client
- Defined in:
- lib/google/cloud/discovery_engine/v1/assistant_service/paths.rb
Overview
Path helper methods for the AssistantService API.
Instance Method Summary collapse
-
#assistant_path(project:, location:, collection:, engine:, assistant:) ⇒ ::String
Create a fully-qualified Assistant resource string.
-
#data_store_path(**args) ⇒ ::String
Create a fully-qualified DataStore resource string.
-
#session_path(**args) ⇒ ::String
Create a fully-qualified Session resource string.
Instance Method Details
#assistant_path(project:, location:, collection:, engine:, assistant:) ⇒ ::String
Create a fully-qualified Assistant resource string.
The resource will be in the following format:
projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}
41 42 43 44 45 46 47 48 |
# File 'lib/google/cloud/discovery_engine/v1/assistant_service/paths.rb', line 41 def assistant_path project:, location:, collection:, engine:, assistant: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/assistants/#{assistant}" end |
#data_store_path(project: , location: , data_store: ) ⇒ ::String #data_store_path(project: , location: , collection: , data_store: ) ⇒ ::String
Create a fully-qualified DataStore resource string.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/google/cloud/discovery_engine/v1/assistant_service/paths.rb', line 73 def data_store_path **args resources = { "data_store:location:project" => (proc do |project:, location:, data_store:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "projects/#{project}/locations/#{location}/dataStores/#{data_store}" end), "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end |
#session_path(project: , location: , data_store: , session: ) ⇒ ::String #session_path(project: , location: , collection: , data_store: , session: ) ⇒ ::String #session_path(project: , location: , collection: , engine: , session: ) ⇒ ::String
Create a fully-qualified Session resource string.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/google/cloud/discovery_engine/v1/assistant_service/paths.rb', line 131 def session_path **args resources = { "data_store:location:project:session" => (proc do |project:, location:, data_store:, session:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}" end), "collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}" end), "collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end |