Module: Google::Cloud::Dialogflow::V2::Intents::Paths

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

Overview

Path helper methods for the Intents API.

Instance Method Summary collapse

Instance Method Details

#agent_path(project:) ⇒ String

Create a fully-qualified Agent resource string.

The resource will be in the following format:

projects/{project}/agent

Parameters:

  • project (String)

Returns:

  • (String)


37
38
39
# File 'lib/google/cloud/dialogflow/v2/intents/paths.rb', line 37

def agent_path project:
  "projects/#{project}/agent"
end

#context_path(project:, session:, context:) ⇒ String

Create a fully-qualified Context resource string.

The resource will be in the following format:

projects/{project}/agent/sessions/{session}/contexts/{context}

Parameters:

  • project (String)
  • session (String)
  • context (String)

Returns:

  • (String)

Raises:

  • (ArgumentError)


53
54
55
56
57
58
# File 'lib/google/cloud/dialogflow/v2/intents/paths.rb', line 53

def context_path project:, session:, context:
  raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ArgumentError, "session cannot contain /" if session.to_s.include? "/"

  "projects/#{project}/agent/sessions/#{session}/contexts/#{context}"
end

#intent_path(project:, intent:) ⇒ String

Create a fully-qualified Intent resource string.

The resource will be in the following format:

projects/{project}/agent/intents/{intent}

Parameters:

  • project (String)
  • intent (String)

Returns:

  • (String)

Raises:

  • (ArgumentError)


71
72
73
74
75
# File 'lib/google/cloud/dialogflow/v2/intents/paths.rb', line 71

def intent_path project:, intent:
  raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/agent/intents/#{intent}"
end