Module: Google::Cloud::Dialogflow::V2::Conversations::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/dialogflow/v2/conversations/paths.rb

Overview

Path helper methods for the Conversations API.

Instance Method Summary collapse

Instance Method Details

#agent_path(project:) ⇒ ::String #agent_path(project:, location:) ⇒ ::String

Create a fully-qualified Agent resource string.

Overloads:

  • #agent_path(project:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/agent

    Parameters:

    • project (String)
  • #agent_path(project:, location:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/agent

    Parameters:

    • project (String)
    • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 46

def agent_path **args
  resources = {
    "project" => (proc do |project:|
      "projects/#{project}/agent"
    end),
    "location:project" => (proc do |project:, location:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agent"
    end)
  }

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

#app_path(project:, location:, app:) ⇒ ::String

Create a fully-qualified App resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/apps/{app}

Parameters:

  • project (String)
  • location (String)
  • app (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


75
76
77
78
79
80
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 75

def app_path project:, location:, app:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

  "projects/#{project}/locations/#{location}/apps/#{app}"
end

#conversation_model_path(project:, location:, conversation_model:) ⇒ ::String #conversation_model_path(project:, conversation_model:) ⇒ ::String

Create a fully-qualified ConversationModel resource string.

Overloads:

  • #conversation_model_path(project:, location:, conversation_model:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/conversationModels/{conversation_model}

    Parameters:

    • project (String)
    • location (String)
    • conversation_model (String)
  • #conversation_model_path(project:, conversation_model:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/conversationModels/{conversation_model}

    Parameters:

    • project (String)
    • conversation_model (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 163

def conversation_model_path **args
  resources = {
    "conversation_model:location:project" => (proc do |project:, location:, conversation_model:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "projects/#{project}/locations/#{location}/conversationModels/#{conversation_model}"
    end),
    "conversation_model:project" => (proc do |project:, conversation_model:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

      "projects/#{project}/conversationModels/#{conversation_model}"
    end)
  }

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

#conversation_path(project:, conversation:) ⇒ ::String #conversation_path(project:, location:, conversation:) ⇒ ::String

Create a fully-qualified Conversation resource string.

Overloads:

  • #conversation_path(project:, conversation:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/conversations/{conversation}

    Parameters:

    • project (String)
    • conversation (String)
  • #conversation_path(project:, location:, conversation:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/conversations/{conversation}

    Parameters:

    • project (String)
    • location (String)
    • conversation (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 122

def conversation_path **args
  resources = {
    "conversation:project" => (proc do |project:, conversation:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

      "projects/#{project}/conversations/#{conversation}"
    end),
    "conversation:location:project" => (proc do |project:, location:, conversation:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "projects/#{project}/locations/#{location}/conversations/#{conversation}"
    end)
  }

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

#conversation_profile_path(project:, conversation_profile:) ⇒ ::String #conversation_profile_path(project:, location:, conversation_profile:) ⇒ ::String

Create a fully-qualified ConversationProfile resource string.

Overloads:

  • #conversation_profile_path(project:, conversation_profile:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/conversationProfiles/{conversation_profile}

    Parameters:

    • project (String)
    • conversation_profile (String)
  • #conversation_profile_path(project:, location:, conversation_profile:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}

    Parameters:

    • project (String)
    • location (String)
    • conversation_profile (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 204

def conversation_profile_path **args
  resources = {
    "conversation_profile:project" => (proc do |project:, conversation_profile:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

      "projects/#{project}/conversationProfiles/#{conversation_profile}"
    end),
    "conversation_profile:location:project" => (proc do |project:, location:, conversation_profile:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "projects/#{project}/locations/#{location}/conversationProfiles/#{conversation_profile}"
    end)
  }

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

#cx_security_settings_path(project:, location:, security_settings:) ⇒ ::String

Create a fully-qualified CXSecuritySettings resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/securitySettings/{security_settings}

Parameters:

  • project (String)
  • location (String)
  • security_settings (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


94
95
96
97
98
99
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 94

def cx_security_settings_path project:, location:, security_settings:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

  "projects/#{project}/locations/#{location}/securitySettings/#{security_settings}"
end

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

Create a fully-qualified DataStore resource string.

Overloads:

  • #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}

    Parameters:

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

    The resource will be in the following format:

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

    Parameters:

    • project (String)
    • location (String)
    • data_store (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 247

def data_store_path **args
  resources = {
    "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),
    "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)
  }

  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:, knowledge_base:, document:) ⇒ ::String #document_path(project:, location:, knowledge_base:, document:) ⇒ ::String

Create a fully-qualified Document resource string.

Overloads:

  • #document_path(project:, knowledge_base:, document:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}

    Parameters:

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

    The resource will be in the following format:

    projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}

    Parameters:

    • project (String)
    • location (String)
    • knowledge_base (String)
    • document (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 292

def document_path **args
  resources = {
    "document:knowledge_base:project" => (proc do |project:, knowledge_base:, document:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/"

      "projects/#{project}/knowledgeBases/#{knowledge_base}/documents/#{document}"
    end),
    "document:knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:, document:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/"

      "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}/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

#generator_path(project:, location:, generator:) ⇒ ::String

Create a fully-qualified Generator resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/generators/{generator}

Parameters:

  • project (String)
  • location (String)
  • generator (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


326
327
328
329
330
331
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 326

def generator_path project:, location:, generator:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

  "projects/#{project}/locations/#{location}/generators/#{generator}"
end

#knowledge_base_path(project:, knowledge_base:) ⇒ ::String #knowledge_base_path(project:, location:, knowledge_base:) ⇒ ::String

Create a fully-qualified KnowledgeBase resource string.

Overloads:

  • #knowledge_base_path(project:, knowledge_base:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/knowledgeBases/{knowledge_base}

    Parameters:

    • project (String)
    • knowledge_base (String)
  • #knowledge_base_path(project:, location:, knowledge_base:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}

    Parameters:

    • project (String)
    • location (String)
    • knowledge_base (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 354

def knowledge_base_path **args
  resources = {
    "knowledge_base:project" => (proc do |project:, knowledge_base:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

      "projects/#{project}/knowledgeBases/#{knowledge_base}"
    end),
    "knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}"
    end)
  }

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

#location_path(project:, location:) ⇒ ::String

Create a fully-qualified Location resource string.

The resource will be in the following format:

projects/{project}/locations/{location}

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


385
386
387
388
389
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 385

def location_path project:, location:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/locations/#{location}"
end

#message_path(project:, conversation:, message:) ⇒ ::String #message_path(project:, location:, conversation:, message:) ⇒ ::String

Create a fully-qualified Message resource string.

Overloads:

  • #message_path(project:, conversation:, message:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/conversations/{conversation}/messages/{message}

    Parameters:

    • project (String)
    • conversation (String)
    • message (String)
  • #message_path(project:, location:, conversation:, message:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}

    Parameters:

    • project (String)
    • location (String)
    • conversation (String)
    • message (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 414

def message_path **args
  resources = {
    "conversation:message:project" => (proc do |project:, conversation:, message:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"

      "projects/#{project}/conversations/#{conversation}/messages/#{message}"
    end),
    "conversation:location:message:project" => (proc do |project:, location:, conversation:, message:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"

      "projects/#{project}/locations/#{location}/conversations/#{conversation}/messages/#{message}"
    end)
  }

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

#phrase_set_path(project:, location:, phrase_set:) ⇒ ::String

Create a fully-qualified PhraseSet resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/phraseSets/{phrase_set}

Parameters:

  • project (String)
  • location (String)
  • phrase_set (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


448
449
450
451
452
453
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 448

def phrase_set_path project:, location:, phrase_set:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

  "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}"
end

#project_path(project:) ⇒ ::String

Create a fully-qualified Project resource string.

The resource will be in the following format:

projects/{project}

Parameters:

  • project (String)

Returns:

  • (::String)


465
466
467
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 465

def project_path project:
  "projects/#{project}"
end

#tool_path(project:, location:, tool:) ⇒ ::String #tool_path(project:, location:, app:, tool:) ⇒ ::String

Create a fully-qualified Tool resource string.

Overloads:

  • #tool_path(project:, location:, tool:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/tools/{tool}

    Parameters:

    • project (String)
    • location (String)
    • tool (String)
  • #tool_path(project:, location:, app:, tool:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/apps/{app}/tools/{tool}

    Parameters:

    • project (String)
    • location (String)
    • app (String)
    • tool (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 492

def tool_path **args
  resources = {
    "location:project:tool" => (proc do |project:, location:, tool:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "projects/#{project}/locations/#{location}/tools/#{tool}"
    end),
    "app:location:project:tool" => (proc do |project:, location:, app:, tool:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/"

      "projects/#{project}/locations/#{location}/apps/#{app}/tools/#{tool}"
    end)
  }

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

#toolset_path(project:, location:, app:, toolset:) ⇒ ::String

Create a fully-qualified Toolset resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}

Parameters:

  • project (String)
  • location (String)
  • app (String)
  • toolset (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


527
528
529
530
531
532
533
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 527

def toolset_path project:, location:, app:, toolset:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/"

  "projects/#{project}/locations/#{location}/apps/#{app}/toolsets/#{toolset}"
end