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) (defaults to: )
  • #agent_path(project: , location: ) ⇒ ::String

    The resource will be in the following format:

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

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )

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

#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) (defaults to: )
    • location (String) (defaults to: )
    • conversation_model (String) (defaults to: )
  • #conversation_model_path(project: , conversation_model: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/conversationModels/{conversation_model}

    Parameters:

    • project (String) (defaults to: )
    • conversation_model (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 144

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) (defaults to: )
    • conversation (String) (defaults to: )
  • #conversation_path(project: , location: , conversation: ) ⇒ ::String

    The resource will be in the following format:

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

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • conversation (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 103

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) (defaults to: )
    • conversation_profile (String) (defaults to: )
  • #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) (defaults to: )
    • location (String) (defaults to: )
    • conversation_profile (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 185

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)


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

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) (defaults to: )
    • location (String) (defaults to: )
    • collection (String) (defaults to: )
    • data_store (String) (defaults to: )
  • #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) (defaults to: )
    • location (String) (defaults to: )
    • data_store (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 228

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) (defaults to: )
    • knowledge_base (String) (defaults to: )
    • document (String) (defaults to: )
  • #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) (defaults to: )
    • location (String) (defaults to: )
    • knowledge_base (String) (defaults to: )
    • document (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 273

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)


307
308
309
310
311
312
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 307

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) (defaults to: )
    • knowledge_base (String) (defaults to: )
  • #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) (defaults to: )
    • location (String) (defaults to: )
    • knowledge_base (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 335

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)


366
367
368
369
370
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 366

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) (defaults to: )
    • conversation (String) (defaults to: )
    • message (String) (defaults to: )
  • #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) (defaults to: )
    • location (String) (defaults to: )
    • conversation (String) (defaults to: )
    • message (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 395

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)


429
430
431
432
433
434
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 429

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)


446
447
448
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 446

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