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

#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)


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 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)


262
263
264
265
266
267
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 262

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)


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

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)


321
322
323
324
325
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 321

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)


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

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

#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)


382
383
384
# File 'lib/google/cloud/dialogflow/v2/conversations/paths.rb', line 382

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