Module: Google::Cloud::Dialogflow::V2::Generators::Paths

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

Overview

Path helper methods for the Generators API.

Instance Method Summary collapse

Instance Method Details

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


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

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

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


56
57
58
# File 'lib/google/cloud/dialogflow/v2/generators/paths.rb', line 56

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