Module: Google::Cloud::DiscoveryEngine::V1::SessionService::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/discovery_engine/v1/session_service/paths.rb

Overview

Path helper methods for the SessionService API.

Instance Method Summary collapse

Instance Method Details

#answer_path(project: , location: , data_store: , session: , answer: ) ⇒ ::String #answer_path(project: , location: , collection: , data_store: , session: , answer: ) ⇒ ::String #answer_path(project: , location: , collection: , engine: , session: , answer: ) ⇒ ::String

Create a fully-qualified Answer resource string.

Overloads:

  • #answer_path(project: , location: , data_store: , session: , answer: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}

  • #answer_path(project: , location: , collection: , data_store: , session: , answer: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer}

  • #answer_path(project: , location: , collection: , engine: , session: , answer: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer}

Raises:

  • (::ArgumentError)


66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/google/cloud/discovery_engine/v1/session_service/paths.rb', line 66

def answer_path **args
  resources = {
    "answer:data_store:location:project:session" => (proc do |project:, location:, data_store:, session:, answer:|
      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? "/"
      raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"

      "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}/answers/#{answer}"
    end),
    "answer:collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:, answer:|
      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? "/"
      raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"

      "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}/answers/#{answer}"
    end),
    "answer:collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:, answer:|
      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, "session cannot contain /" if session.to_s.include? "/"

      "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}/answers/#{answer}"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
end

#chunk_path(project: , location: , data_store: , branch: , document: , chunk: ) ⇒ ::String #chunk_path(project: , location: , collection: , data_store: , branch: , document: , chunk: ) ⇒ ::String

Create a fully-qualified Chunk resource string.

Overloads:

  • #chunk_path(project: , location: , data_store: , branch: , document: , chunk: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}

  • #chunk_path(project: , location: , collection: , data_store: , branch: , document: , chunk: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}

Raises:

  • (::ArgumentError)


130
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
# File 'lib/google/cloud/discovery_engine/v1/session_service/paths.rb', line 130

def chunk_path **args
  resources = {
    "branch:chunk:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:, chunk:|
      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? "/"
      raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/"
      raise ::ArgumentError, "document cannot contain /" if document.to_s.include? "/"

      "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}/chunks/#{chunk}"
    end),
    "branch:chunk:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:, chunk:|
      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? "/"
      raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/"
      raise ::ArgumentError, "document cannot contain /" if document.to_s.include? "/"

      "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}/chunks/#{chunk}"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
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.

Overloads:

  • #data_store_path(project: , location: , data_store: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/dataStores/{data_store}

  • #data_store_path(project: , location: , collection: , data_store: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}

Raises:

  • (::ArgumentError)


181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/google/cloud/discovery_engine/v1/session_service/paths.rb', line 181

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

#document_path(project: , location: , data_store: , branch: , document: ) ⇒ ::String #document_path(project: , location: , collection: , data_store: , branch: , document: ) ⇒ ::String

Create a fully-qualified Document resource string.

Overloads:

  • #document_path(project: , location: , data_store: , branch: , document: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}

  • #document_path(project: , location: , collection: , data_store: , branch: , document: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}

Raises:

  • (::ArgumentError)


230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/google/cloud/discovery_engine/v1/session_service/paths.rb', line 230

def document_path **args
  resources = {
    "branch:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:|
      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? "/"
      raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/"

      "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}"
    end),
    "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:|
      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? "/"
      raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/"

      "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}"
    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.

Overloads:

  • #session_path(project: , location: , data_store: , session: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}

  • #session_path(project: , location: , collection: , data_store: , session: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}

  • #session_path(project: , location: , collection: , engine: , session: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}

Raises:

  • (::ArgumentError)


292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/google/cloud/discovery_engine/v1/session_service/paths.rb', line 292

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