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

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

Overview

Path helper methods for the Versions API.

Instance Method Summary collapse

Instance Method Details

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


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

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

#version_path(project:, location:, agent:, flow:, version:) ⇒ ::String

Create a fully-qualified Version resource string.

The resource will be in the following format:

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

Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

def version_path project:, location:, agent:, flow:, version:
  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}/versions/#{version}"
end