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

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

Overview

Path helper methods for the TestCases API.

Instance Method Summary collapse

Instance Method Details

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

Create a fully-qualified Agent resource string.

The resource will be in the following format:

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

Raises:

  • (::ArgumentError)


40
41
42
43
44
45
# File 'lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb', line 40

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

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

#entity_type_path(project:, location:, agent:, entity_type:) ⇒ ::String

Create a fully-qualified EntityType resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}

Raises:

  • (::ArgumentError)


60
61
62
63
64
65
66
# File 'lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb', line 60

def entity_type_path project:, location:, agent:, entity_type:
  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}/entityTypes/#{entity_type}"
end

#environment_path(project:, location:, agent:, environment:) ⇒ ::String

Create a fully-qualified Environment resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agents/{agent}/environments/{environment}

Raises:

  • (::ArgumentError)


81
82
83
84
85
86
87
# File 'lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb', line 81

def environment_path project:, location:, agent:, environment:
  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}/environments/#{environment}"
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}

Raises:

  • (::ArgumentError)


102
103
104
105
106
107
108
# File 'lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb', line 102

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

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

Create a fully-qualified Generator resource string.

The resource will be in the following format:

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

Raises:

  • (::ArgumentError)


123
124
125
126
127
128
129
# File 'lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb', line 123

def generator_path project:, location:, agent:, generator:
  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}/generators/#{generator}"
end

#intent_path(project:, location:, agent:, intent:) ⇒ ::String

Create a fully-qualified Intent resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agents/{agent}/intents/{intent}

Raises:

  • (::ArgumentError)


144
145
146
147
148
149
150
# File 'lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb', line 144

def intent_path project:, location:, agent:, intent:
  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}/intents/#{intent}"
end

#page_path(project:, location:, agent:, flow:, page:) ⇒ ::String

Create a fully-qualified Page resource string.

The resource will be in the following format:

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

Raises:

  • (::ArgumentError)


166
167
168
169
170
171
172
173
# File 'lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb', line 166

def page_path project:, location:, agent:, flow:, page:
  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, "flow cannot contain /" if flow.to_s.include? "/"

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

#test_case_path(project:, location:, agent:, test_case:) ⇒ ::String

Create a fully-qualified TestCase resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}

Raises:

  • (::ArgumentError)


188
189
190
191
192
193
194
# File 'lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb', line 188

def test_case_path project:, location:, agent:, test_case:
  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}/testCases/#{test_case}"
end

#test_case_result_path(project:, location:, agent:, test_case:, result:) ⇒ ::String

Create a fully-qualified TestCaseResult resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}

Raises:

  • (::ArgumentError)


210
211
212
213
214
215
216
217
# File 'lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb', line 210

def test_case_result_path project:, location:, agent:, test_case:, result:
  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, "test_case cannot contain /" if test_case.to_s.include? "/"

  "projects/#{project}/locations/#{location}/agents/#{agent}/testCases/#{test_case}/results/#{result}"
end

#transition_route_group_path(project: , location: , agent: , flow: , transition_route_group: ) ⇒ ::String #transition_route_group_path(project: , location: , agent: , transition_route_group: ) ⇒ ::String

Create a fully-qualified TransitionRouteGroup resource string.

Overloads:

  • #transition_route_group_path(project: , location: , agent: , flow: , transition_route_group: ) ⇒ ::String

    The resource will be in the following format:

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

  • #transition_route_group_path(project: , location: , agent: , transition_route_group: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}

Raises:

  • (::ArgumentError)


244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb', line 244

def transition_route_group_path **args
  resources = {
    "agent:flow:location:project:transition_route_group" => (proc do |project:, location:, agent:, flow:, transition_route_group:|
      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, "flow cannot contain /" if flow.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/transitionRouteGroups/#{transition_route_group}"
    end),
    "agent:location:project:transition_route_group" => (proc do |project:, location:, agent:, transition_route_group:|
      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}/transitionRouteGroups/#{transition_route_group}"
    end)
  }

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

#webhook_path(project:, location:, agent:, webhook:) ⇒ ::String

Create a fully-qualified Webhook resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}

Raises:

  • (::ArgumentError)


281
282
283
284
285
286
287
# File 'lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb', line 281

def webhook_path project:, location:, agent:, webhook:
  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}/webhooks/#{webhook}"
end