Module: Google::Cloud::Dialogflow::CX::V3::Examples::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/dialogflow/cx/v3/examples/paths.rb

Overview

Path helper methods for the Examples API.

Instance Method Summary collapse

Instance Method Details

#example_path(project:, location:, agent:, playbook:, example:) ⇒ ::String

Create a fully-qualified Example resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}/examples/{example}

Parameters:

  • project (String)
  • location (String)
  • agent (String)
  • playbook (String)
  • example (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


42
43
44
45
46
47
48
49
# File 'lib/google/cloud/dialogflow/cx/v3/examples/paths.rb', line 42

def example_path project:, location:, agent:, playbook:, example:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/"
  raise ::ArgumentError, "playbook cannot contain /" if playbook.to_s.include? "/"

  "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}/examples/#{example}"
end

#flow_path(project:, location:, agent:, flow:) ⇒ ::String

Create a fully-qualified Flow resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agents/{agent}/flows/{flow}

Parameters:

  • project (String)
  • location (String)
  • agent (String)
  • flow (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


64
65
66
67
68
69
70
# File 'lib/google/cloud/dialogflow/cx/v3/examples/paths.rb', line 64

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

  "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}"
end

#playbook_path(project:, location:, agent:, playbook:) ⇒ ::String

Create a fully-qualified Playbook resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agents/{agent}/playbooks/{playbook}

Parameters:

  • project (String)
  • location (String)
  • agent (String)
  • playbook (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


85
86
87
88
89
90
91
# File 'lib/google/cloud/dialogflow/cx/v3/examples/paths.rb', line 85

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

  "projects/#{project}/locations/#{location}/agents/#{agent}/playbooks/#{playbook}"
end

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

Create a fully-qualified Tool resource string.

The resource will be in the following format:

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

Parameters:

  • project (String)
  • location (String)
  • agent (String)
  • tool (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


106
107
108
109
110
111
112
# File 'lib/google/cloud/dialogflow/cx/v3/examples/paths.rb', line 106

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

  "projects/#{project}/locations/#{location}/agents/#{agent}/tools/#{tool}"
end