Module: Google::Cloud::Dialogflow::V2::Participants::Paths

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

Overview

Path helper methods for the Participants 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/participants/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

#conversation_path(project: , conversation: ) ⇒ ::String #conversation_path(project: , location: , conversation: ) ⇒ ::String

Create a fully-qualified Conversation resource string.

Overloads:

  • #conversation_path(project: , conversation: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/conversations/{conversation}

    Parameters:

    • project (String) (defaults to: )
    • conversation (String) (defaults to: )
  • #conversation_path(project: , location: , conversation: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/conversations/{conversation}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • conversation (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/google/cloud/dialogflow/v2/participants/paths.rb', line 133

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

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

      "projects/#{project}/locations/#{location}/conversations/#{conversation}"
    end)
  }

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

#message_path(project: , conversation: , message: ) ⇒ ::String #message_path(project: , location: , conversation: , message: ) ⇒ ::String

Create a fully-qualified Message resource string.

Overloads:

  • #message_path(project: , conversation: , message: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/conversations/{conversation}/messages/{message}

    Parameters:

    • project (String) (defaults to: )
    • conversation (String) (defaults to: )
    • message (String) (defaults to: )
  • #message_path(project: , location: , conversation: , message: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • conversation (String) (defaults to: )
    • message (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/google/cloud/dialogflow/v2/participants/paths.rb', line 176

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

      "projects/#{project}/conversations/#{conversation}/messages/#{message}"
    end),
    "conversation:location:message:project" => (proc do |project:, location:, conversation:, message:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"

      "projects/#{project}/locations/#{location}/conversations/#{conversation}/messages/#{message}"
    end)
  }

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

#participant_path(project: , conversation: , participant: ) ⇒ ::String #participant_path(project: , location: , conversation: , participant: ) ⇒ ::String

Create a fully-qualified Participant resource string.

Overloads:

  • #participant_path(project: , conversation: , participant: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/conversations/{conversation}/participants/{participant}

    Parameters:

    • project (String) (defaults to: )
    • conversation (String) (defaults to: )
    • participant (String) (defaults to: )
  • #participant_path(project: , location: , conversation: , participant: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • conversation (String) (defaults to: )
    • participant (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/google/cloud/dialogflow/v2/participants/paths.rb', line 221

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

      "projects/#{project}/conversations/#{conversation}/participants/#{participant}"
    end),
    "conversation:location:participant:project" => (proc do |project:, location:, conversation:, participant:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"

      "projects/#{project}/locations/#{location}/conversations/#{conversation}/participants/#{participant}"
    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)


289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/google/cloud/dialogflow/v2/participants/paths.rb', line 289

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