Module: Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Paths

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

Overview

Path helper methods for the GeneratorEvaluations API.

Instance Method Summary collapse

Instance Method Details

#app_path(project:, location:, app:) ⇒ ::String

Create a fully-qualified App resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/apps/{app}

Parameters:

  • project (String)
  • location (String)
  • app (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
44
# File 'lib/google/cloud/dialogflow/v2/generator_evaluations/paths.rb', line 39

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

  "projects/#{project}/locations/#{location}/apps/#{app}"
end

#generator_evaluation_path(project:, location:, generator:, evaluation:) ⇒ ::String

Create a fully-qualified GeneratorEvaluation resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/generators/{generator}/evaluations/{evaluation}

Parameters:

  • project (String)
  • location (String)
  • generator (String)
  • evaluation (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


78
79
80
81
82
83
84
# File 'lib/google/cloud/dialogflow/v2/generator_evaluations/paths.rb', line 78

def generator_evaluation_path project:, location:, generator:, evaluation:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "generator cannot contain /" if generator.to_s.include? "/"

  "projects/#{project}/locations/#{location}/generators/#{generator}/evaluations/#{evaluation}"
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)


58
59
60
61
62
63
# File 'lib/google/cloud/dialogflow/v2/generator_evaluations/paths.rb', line 58

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

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

Create a fully-qualified Tool resource string.

Overloads:

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

    The resource will be in the following format:

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

    Parameters:

    • project (String)
    • location (String)
    • tool (String)
  • #tool_path(project:, location:, app:, tool:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/apps/{app}/tools/{tool}

    Parameters:

    • project (String)
    • location (String)
    • app (String)
    • tool (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/google/cloud/dialogflow/v2/generator_evaluations/paths.rb', line 109

def tool_path **args
  resources = {
    "location:project:tool" => (proc do |project:, location:, tool:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "projects/#{project}/locations/#{location}/tools/#{tool}"
    end),
    "app:location:project:tool" => (proc do |project:, location:, app:, tool:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/"

      "projects/#{project}/locations/#{location}/apps/#{app}/tools/#{tool}"
    end)
  }

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

#toolset_path(project:, location:, app:, toolset:) ⇒ ::String

Create a fully-qualified Toolset resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}

Parameters:

  • project (String)
  • location (String)
  • app (String)
  • toolset (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

def toolset_path project:, location:, app:, toolset:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/"

  "projects/#{project}/locations/#{location}/apps/#{app}/toolsets/#{toolset}"
end