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

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

Overview

Path helper methods for the Flows 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}

Parameters:

  • project (String)
  • location (String)
  • agent (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


40
41
42
43
44
45
# File 'lib/google/cloud/dialogflow/cx/v3/flows/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

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


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

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

#flow_validation_result_path(project:, location:, agent:, flow:) ⇒ ::String

Create a fully-qualified FlowValidationResult resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult

Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

def flow_validation_result_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}/validationResult"
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}

Parameters:

  • project (String)
  • location (String)
  • agent (String)
  • intent (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

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}

Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

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

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

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • agent (String) (defaults to: )
    • flow (String) (defaults to: )
    • transition_route_group (String) (defaults to: )
  • #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}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • agent (String) (defaults to: )
    • transition_route_group (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/google/cloud/dialogflow/cx/v3/flows/paths.rb', line 158

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}

Parameters:

  • project (String)
  • location (String)
  • agent (String)
  • webhook (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


195
196
197
198
199
200
201
# File 'lib/google/cloud/dialogflow/cx/v3/flows/paths.rb', line 195

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