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

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

Overview

Path helper methods for the Sessions API.

Instance Method Summary collapse

Instance Method Details

#data_store_path(project: , location: , data_store: ) ⇒ ::String #data_store_path(project: , location: , collection: , data_store: ) ⇒ ::String

Create a fully-qualified DataStore resource string.

Overloads:

  • #data_store_path(project: , location: , data_store: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/dataStores/{data_store}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • data_store (String) (defaults to: )
  • #data_store_path(project: , location: , collection: , data_store: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • collection (String) (defaults to: )
    • data_store (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb', line 51

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

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

      "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}"
    end)
  }

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

#entity_type_path(project:, location:, agent:, entity_type:) ⇒ ::String

Create a fully-qualified EntityType resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}

Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


86
87
88
89
90
91
92
# File 'lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb', line 86

def entity_type_path project:, location:, agent:, entity_type:
  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}/entityTypes/#{entity_type}"
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)


107
108
109
110
111
112
113
# File 'lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb', line 107

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)


129
130
131
132
133
134
135
136
# File 'lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb', line 129

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

#session_entity_type_path(project: , location: , agent: , session: , entity_type: ) ⇒ ::String #session_entity_type_path(project: , location: , agent: , environment: , session: , entity_type: ) ⇒ ::String

Create a fully-qualified SessionEntityType resource string.

Overloads:

  • #session_entity_type_path(project: , location: , agent: , session: , entity_type: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • agent (String) (defaults to: )
    • session (String) (defaults to: )
    • entity_type (String) (defaults to: )
  • #session_entity_type_path(project: , location: , agent: , environment: , session: , entity_type: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • agent (String) (defaults to: )
    • environment (String) (defaults to: )
    • session (String) (defaults to: )
    • entity_type (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb', line 214

def session_entity_type_path **args
  resources = {
    "agent:entity_type:location:project:session" => (proc do |project:, location:, agent:, session:, entity_type:|
      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, "session cannot contain /" if session.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agents/#{agent}/sessions/#{session}/entityTypes/#{entity_type}"
    end),
    "agent:entity_type:environment:location:project:session" => (proc do |project:, location:, agent:, environment:, session:, entity_type:|
      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, "environment cannot contain /" if environment.to_s.include? "/"
      raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/sessions/#{session}/entityTypes/#{entity_type}"
    end)
  }

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

#session_path(project: , location: , agent: , session: ) ⇒ ::String #session_path(project: , location: , agent: , environment: , session: ) ⇒ ::String

Create a fully-qualified Session resource string.

Overloads:

  • #session_path(project: , location: , agent: , session: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/agents/{agent}/sessions/{session}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • agent (String) (defaults to: )
    • session (String) (defaults to: )
  • #session_path(project: , location: , agent: , environment: , session: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • agent (String) (defaults to: )
    • environment (String) (defaults to: )
    • session (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb', line 163

def session_path **args
  resources = {
    "agent:location:project:session" => (proc do |project:, location:, agent:, session:|
      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}/sessions/#{session}"
    end),
    "agent:environment:location:project:session" => (proc do |project:, location:, agent:, environment:, session:|
      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, "environment cannot contain /" if environment.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/sessions/#{session}"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
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)


254
255
256
257
258
259
260
261
# File 'lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb', line 254

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