Module: Google::Cloud::DiscoveryEngine::V1beta::AssistantService::Paths
- Extended by:
- Paths
- Included in:
- Client, Paths, Rest::Client
- Defined in:
- lib/google/cloud/discovery_engine/v1beta/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.
-
#engine_path(project:, location:, collection:, engine:) ⇒ ::String
Create a fully-qualified Engine resource string.
-
#session_path(**args) ⇒ ::String
Create a fully-qualified Session resource string.
-
#template_path(project:, location:, template:) ⇒ ::String
Create a fully-qualified Template 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/v1beta/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/v1beta/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 |
#engine_path(project:, location:, collection:, engine:) ⇒ ::String
Create a fully-qualified Engine resource string.
The resource will be in the following format:
projects/{project}/locations/{location}/collections/{collection}/engines/{engine}
108 109 110 111 112 113 114 |
# File 'lib/google/cloud/discovery_engine/v1beta/assistant_service/paths.rb', line 108 def engine_path project:, location:, collection:, engine: 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}/engines/#{engine}" 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 #session_path(project:, location:, collection:, engine:, collaborative_project:, session:) ⇒ ::String
Create a fully-qualified Session resource string.
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/google/cloud/discovery_engine/v1beta/assistant_service/paths.rb', line 164 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), "collaborative_project:collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, collaborative_project:, 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? "/" raise ::ArgumentError, "collaborative_project cannot contain /" if collaborative_project.to_s.include? "/" "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/collaborativeProjects/#{collaborative_project}/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 |
#template_path(project:, location:, template:) ⇒ ::String
Create a fully-qualified Template resource string.
The resource will be in the following format:
projects/{project}/locations/{location}/templates/{template}
217 218 219 220 221 222 |
# File 'lib/google/cloud/discovery_engine/v1beta/assistant_service/paths.rb', line 217 def template_path project:, location:, template: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "projects/#{project}/locations/#{location}/templates/#{template}" end |