Module: Google::Cloud::Dialogflow::V2::Sessions::Paths

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

Overview

Path helper methods for the Sessions API.

Instance Method Summary collapse

Instance Method Details

#context_path(project: , session: , context: ) ⇒ ::String #context_path(project: , environment: , user: , session: , context: ) ⇒ ::String #context_path(project: , location: , session: , context: ) ⇒ ::String #context_path(project: , location: , environment: , user: , session: , context: ) ⇒ ::String

Create a fully-qualified Context resource string.

Overloads:

  • #context_path(project: , session: , context: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/agent/sessions/{session}/contexts/{context}

    Parameters:

    • project (String) (defaults to: )
    • session (String) (defaults to: )
    • context (String) (defaults to: )
  • #context_path(project: , environment: , user: , session: , context: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}

    Parameters:

    • project (String) (defaults to: )
    • environment (String) (defaults to: )
    • user (String) (defaults to: )
    • session (String) (defaults to: )
    • context (String) (defaults to: )
  • #context_path(project: , location: , session: , context: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • session (String) (defaults to: )
    • context (String) (defaults to: )
  • #context_path(project: , location: , environment: , user: , session: , context: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • environment (String) (defaults to: )
    • user (String) (defaults to: )
    • session (String) (defaults to: )
    • context (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/google/cloud/dialogflow/v2/sessions/paths.rb', line 73

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

      "projects/#{project}/agent/sessions/#{session}/contexts/#{context}"
    end),
    "context:environment:project:session:user" => (proc do |project:, environment:, user:, session:, context:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
      raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
      raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"

      "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}"
    end),
    "context:location:project:session" => (proc do |project:, location:, session:, context:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agent/sessions/#{session}/contexts/#{context}"
    end),
    "context:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, context:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
      raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
      raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}"
    end)
  }

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

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

Create a fully-qualified SessionEntityType resource string.

Overloads:

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

    The resource will be in the following format:

    projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}

    Parameters:

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

    The resource will be in the following format:

    projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}

    Parameters:

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

    The resource will be in the following format:

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

    Parameters:

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

    The resource will be in the following format:

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

    Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/google/cloud/dialogflow/v2/sessions/paths.rb', line 235

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

      "projects/#{project}/agent/sessions/#{session}/entityTypes/#{entity_type}"
    end),
    "entity_type:environment:project:session:user" => (proc do |project:, environment:, user:, session:, entity_type:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
      raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
      raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"

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

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

      "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/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: , session: ) ⇒ ::String #session_path(project: , environment: , user: , session: ) ⇒ ::String #session_path(project: , location: , session: ) ⇒ ::String #session_path(project: , location: , environment: , user: , session: ) ⇒ ::String

Create a fully-qualified Session resource string.

Overloads:

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

    The resource will be in the following format:

    projects/{project}/agent/sessions/{session}

    Parameters:

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

    The resource will be in the following format:

    projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}

    Parameters:

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

    The resource will be in the following format:

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

    Parameters:

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

    The resource will be in the following format:

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

    Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/google/cloud/dialogflow/v2/sessions/paths.rb', line 154

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

      "projects/#{project}/agent/sessions/#{session}"
    end),
    "environment:project:session:user" => (proc do |project:, environment:, user:, session:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
      raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"

      "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}"
    end),
    "location:project:session" => (proc do |project:, location:, session:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agent/sessions/#{session}"
    end),
    "environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
      raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/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