Module: Google::Cloud::Dialogflow::V2::Tools::Paths

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

Overview

Path helper methods for the Tools API.

Instance Method Summary collapse

Instance Method Details

#location_path(project:, location:) ⇒ ::String

Create a fully-qualified Location resource string.

The resource will be in the following format:

projects/{project}/locations/{location}

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


38
39
40
41
42
# File 'lib/google/cloud/dialogflow/v2/tools/paths.rb', line 38

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

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

#secret_version_path(project:, secret:, version:) ⇒ ::String

Create a fully-qualified SecretVersion resource string.

The resource will be in the following format:

projects/{project}/secrets/{secret}/versions/{version}

Parameters:

  • project (String)
  • secret (String)
  • version (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


56
57
58
59
60
61
# File 'lib/google/cloud/dialogflow/v2/tools/paths.rb', line 56

def secret_version_path project:, secret:, version:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/"

  "projects/#{project}/secrets/#{secret}/versions/#{version}"
end

#service_path(project:, location:, namespace:, service:) ⇒ ::String

Create a fully-qualified Service resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}

Parameters:

  • project (String)
  • location (String)
  • namespace (String)
  • service (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


76
77
78
79
80
81
82
# File 'lib/google/cloud/dialogflow/v2/tools/paths.rb', line 76

def service_path project:, location:, namespace:, service:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/"

  "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}"
end

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

Create a fully-qualified Tool resource string.

The resource will be in the following format:

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

Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


96
97
98
99
100
101
# File 'lib/google/cloud/dialogflow/v2/tools/paths.rb', line 96

def tool_path 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